Hi Vincent,

Do not use -ss and -t parameters simultaneously. FFmpeg cannot form an
output container well in that case.

If you just need to create HLS segments from some source file you can
use the "segment" muxer.

ffmpeg -i source.mp4 -vcodec copy -acodec copy -f ssegment
-segment_list chunklist.m3u8 -segment_time 4  media_%04d.ts

Chunk durations in such an approach may vary, because in your source
file the distance between key-frames may vary.

If you want to create HLS segments of exact length, then you must
transcode your source file and provide exact frame rate -r and exact
GOP -g .

For example, if your source file has a frame rate of 25 frames per
second, then to make HLS chunk duration of 4 second, you need to set
GOP to 100 (or 50, or 25).
To have 1 keyframe in each HLS chunk: -r 25 -g 100
To have 2 keyframes in each HLS chunk: -r 25 -g 50
To have 4 keyframes in each HLS chunk: -r 25 -g 25

So the final command may look like this:

ffmpeg -i source.mp4 -r 25 -g 100 -c:v libx264 -preset fast -crf 24
-c:a aac -b:a 128k -f ssegment -segment_list chunklist.m3u8
-segment_time 4  media_%04d.ts

German
_______________________________________________
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to