简体   繁体   中英

ffmpeg: concatenating mp4 files. Video freezes for few seconds on first frame on output mp4

I created several MP4 files using ffmpeg. All of the videos have same settings and codec. Only difference is frames per second and duration. I then concatenated the videos using command below.

 ffmpeg -f concat myList.txt -c copy output.mp4

I notice that when launching/opening the output.mp4 file in windows media player, it stops/freezes on the first frame of the video for about three four seconds and then starts playing, rest of the videos has correct fps and runs smoothly. Has anyone encountered this issue. I would like the video to start as soon as it is launched. Any suggestions to mitigate this issue?

Update: So far, I have found that the video length is exactly what I expect it to be.

ffprobe -i output.mp4

When i ffplay the video, it runs smoothly, but when I use windows media player, it gets stuck in first frame for about 4-5 seconds then plays smoothly. So I am going to assume that this issue is related to media players (buffers/loading before playing). Can't be sure though.

I solved this problem by converting my input files to avi and resizing them to the same size.

And then run

ffmpeg -i "concat:file1.avi|file2.avi|" -c copy out.avi

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM