2

I'm trying to split an mp4 file into segments and each segment should start with near to zero a/v pts. I'm also re-encoding the mp4 file for different bitrates. This is the command I used;

ffmpeg -i "input.mp4" -c:a libfdk_aac -b:a 128k -c:v libx264 -x264-params "keyint=24:min-keyint=24:scenecut=0:force-cfr=1:nal-hrd=cbr" -b:v 10000k -minrate 10000k -maxrate 10000k -f segment -segment_time 1 -reset_timestamps 1 "output-%01d.mp4"

First audio pts for some segments seems to be negative, this is causing a/v sync issues on web playback. I have tried setpts/asetpts filters with no luck.

Regarding the modified gop, input mp4 is 24fps so each segment is 1s long. How can I overcome the negative pts problem?

1 Answers1

0

Add -segment_format_options avoid_negative_ts=make_zero to your command.

Gyan
  • 38,955