I am transcoding an RTMP stream to HLS using FFmpeg, and I have a problem: when the RTMP stream finishes, the last segment, which does not reach the target duration, is not created as a .ts
file. Consequently, this last segment is not appended to the playlist file.
command:
fmpeg -i rtmp://localhost:1935/live/xyz -c:v libx264 -preset veryfast -b:v 400k -c:a aac -b:a 64k -s 426x240 -hls_playlist_type event -hls_time 10 -hls_list_size 0 -hls_segment_filename jack/240p_%03d.ts jack/240p.m3u8
I expected that when the RTMP stream ends or when i terminate that FFmpeg process, FFmpeg would create a .ts file for the last segment, even if it is shorter than the target duration (10 seconds), and that this segment would be appended to the playlist (output.m3u8).