'FFmpeg trying to concat two like videos but the timing is off
I am trying to concat two videos together using FFMPEG, but the output of the second video plays slow with no audio, but not only that, the time elapsed counter in the windows player counts slower as well. When I play it in VLC the timing is right but the audio is still missing.
For a better explanation of this effect please watch this video. Notice how slow the counter is
https://youtube.com/shorts/k6QD_oqTRyE?feature=share
I know the videos have to be the same type and they are both 30 fps, mp4, same size, same tbn. Here is the ffprobe results. My goal is to make compilation videos using ffmpeg since it can combine videos very fast without re-rendering them. I get the videos from tiktok. Please let me know if I can clarify this anymore. Thanks
Video 1
>Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/smpte170m, progressive), 1024x576 [SAR 1:1 DAR 16:9], 622 kb/s, 30 fps, 30 tbr, 15360 tbn (default)
Video 2
>Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1024x576 [SAR 1:1 DAR 16:9], 760 kb/s, 30 fps, 30 tbr, 15360 tbn (default)
Output video
>Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1024x576 [SAR 1:1 DAR 16:9], 655 kb/s, 29.92 fps, 30 tbr, 15360 tbn (default)
And here is the code during the concat process sorry for the weird format
libavutil 57. 24.101 / 57. 24.101
libavcodec 59. 25.100 / 59. 25.100
libavformat 59. 20.101 / 59. 20.101
libavdevice 59. 6.100 / 59. 6.100
libavfilter 8. 29.100 / 8. 29.100
libswscale 6. 6.100 / 6. 6.100
libswresample 4. 6.100 / 4. 6.100
libpostproc 56. 5.100 / 56. 5.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001e74b5668c0] Auto-inserting h264_mp4toannexb bitstream filter
Input #0, concat, from 'mylist.txt':
Duration: N/A, start: 0.000000, bitrate: 792 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1024x576 [SAR 1:1 DAR 16:9], 760 kb/s, 30 fps, 30 tbr, 15360 tbn
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream #0:1(und): Audio: aac (HE-AACv2) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 32 kb/s
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Output #0, mp4, to 'output.mp4':
Metadata:
encoder : Lavf59.20.101
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1024x576 [SAR 1:1 DAR 16:9], q=2-31, 760 kb/s, 30 fps, 30 tbr, 15360 tbn
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream #0:1(und): Audio: aac (HE-AACv2) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 32 kb/s
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001e74b579400] Auto-inserting h264_mp4toannexb bitstream filter
frame= 1737 fps=0.0 q=-1.0 Lsize= 5442kB time=00:00:58.14 bitrate= 766.8kbits/s speed=1.01e+03x
video:4647kB audio:736kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.084181%
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
