Hi,
If for example, we take one video that has a frame rate of 25 and another with 29.970 FPS and merge them using FFmpeg (without re-encoding because both videos are encoded with the same codec), does the merged video have a variable frame rate or does it use the frame rate of the first video for everything? Because if we check with MediaInfo it shows that the frame rate mode is constant and that it's using the frame rate of the first video of the videos merged, but I don't understand how that's possible without re-encoding to change the frame rate.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 7 of 7
Thread
-
-
I don't know how to concat files directly so I made a list and ran the concat command:
Code:ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.mkv ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 9.1.1 (GCC) 20190807 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 Input #0, concat, from 'mylist.txt': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 1k tbn, 25 tbc Metadata: DURATION : 00:11:22.880000000 Stream #0:1(eng): Audio: aac (LC), 48000 Hz, stereo, fltp Metadata: title : Stereo DURATION : 00:11:22.922000000 Output #0, matroska, to 'output.mkv': Metadata: encoder : Lavf58.29.100 Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 25 tbr, 1k tbn, 1k tbc Metadata: DURATION : 00:11:22.880000000 Stream #0:1(eng): Audio: aac (LC) ([255][0][0][0] / 0x00FF), 48000 Hz, stereo, fltp Metadata: title : Stereo DURATION : 00:11:22.922000000 Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help frame=19409 fps=11687 q=-1.0 Lsize= 481239kB time=00:12:40.94 bitrate=5180.8kbits/s speed= 458x video:463829kB audio:17015kB subtitle:0kB other streams:0kB global headers:2kB muxing overhead: 0.082112%
Code:ffprobe 1.mkv ffprobe version 2020-09-27-git-a3a6b56200-full_build-www.gyan.dev Copyright (c) 2007-2020 the FFmpeg developers built with gcc 10.2.0 (Rev3, Built by MSYS2 project) configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libwavpack --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint libavutil 56. 59.100 / 56. 59.100 libavcodec 58.108.100 / 58.108.100 libavformat 58. 59.100 / 58. 59.100 libavdevice 58. 11.102 / 58. 11.102 libavfilter 7. 87.100 / 7. 87.100 libswscale 5. 8.100 / 5. 8.100 libswresample 3. 8.100 / 3. 8.100 libpostproc 55. 8.100 / 55. 8.100 Input #0, matroska,webm, from '1.mkv': Metadata: creation_time : 2020-12-30T13:25:14.000000Z ENCODER : Lavf58.29.100 Duration: 00:11:22.92, start: 0.000000, bitrate: 5137 kb/s Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 1k tbn, 25 tbc (default) Metadata: DURATION : 00:11:22.880000000 Stream #0:1(eng): Audio: aac (LC), 48000 Hz, stereo, fltp (default) Metadata: title : Stereo DURATION : 00:11:22.922000000 ffprobe 2.mkv ffprobe version 2020-09-27-git-a3a6b56200-full_build-www.gyan.dev Copyright (c) 2007-2020 the FFmpeg developers built with gcc 10.2.0 (Rev3, Built by MSYS2 project) configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libwavpack --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint libavutil 56. 59.100 / 56. 59.100 libavcodec 58.108.100 / 58.108.100 libavformat 58. 59.100 / 58. 59.100 libavdevice 58. 11.102 / 58. 11.102 libavfilter 7. 87.100 / 7. 87.100 libswscale 5. 8.100 / 5. 8.100 libswresample 3. 8.100 / 3. 8.100 libpostproc 55. 8.100 / 55. 8.100 Input #0, matroska,webm, from '2.mkv': Metadata: creation_time : 2020-11-17T07:38:10.000000Z ENCODER : Lavf58.29.100 Duration: 00:01:18.04, start: 0.000000, bitrate: 5556 kb/s Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 1k tbn, 29.97 tbc (default) Metadata: DURATION : 00:01:18.044000000 Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp (default) Metadata: title : Stereo DURATION : 00:01:18.040000000
Last edited by Felow; 2nd Jan 2021 at 19:36.
-
It's not variable frame output, looks to me like the 2nd video is either sped up or slowed down to the first frame rate.
Didn't you observe this yourself?
Doesn't look like a viable solution to concatenate such dissimilar files (there are other members of this forum much
more conversant with FFmpeg than myself, so you may get other answers) -
I don't know how to make ffmpeg do what you want it to do, but this is the "how-to" that I would choose anyway:
1) extract the elementary streams from clip1 and clip2;
2) concatenate video1 with video2 and audio1 with audio2 through the olde and goode copy /b;
3) create a timestamps.txt file in which all the frames from video1 are set to 25fps and all the frames from video2 are set to 29.97fps;
4) generate the new MKV file from video1+video2, audio1+audio2, and timestamps.txt — I recommend MKVtoolnix instead of ffmpeg for this last step, but only because I'm still a newbie at using ffmpeg...Last edited by El Heggunte; 2nd Jan 2021 at 23:28. Reason: grammar
"Programmers are human-shaped machines that transform alcohol into bugs." -
I've been concatenating videos this way for a long time and haven't found any problems and to be honest I don't notice a difference going from 30 to 25 fps or the other way around.
Edit: An FFmpeg maintainer told me: "If your inputs are MKV/WebM, then each video will be played at its native speed." Although I don't know the reason why Mediainfo doesn't say that the merged video has a variable frame rate, I got my answer.
Thanks.Last edited by Felow; 3rd Jan 2021 at 09:50.
-
why Mediainfo doesn't say that the merged video has a variable frame rate, I got my answer.users currently on my ignore list: deadrats, Stears555
Similar Threads
-
Hertz and frame rates
By mauricio vega in forum Newbie / General discussionsReplies: 3Last Post: 3rd Feb 2020, 10:11 -
Synchonizing two videos of different/mixed frame rates
By Baltyshark87 in forum Newbie / General discussionsReplies: 2Last Post: 1st Apr 2018, 18:40 -
need help with frame rates....
By yearofthespider2k3 in forum Authoring (Blu-ray)Replies: 17Last Post: 17th Feb 2018, 14:34 -
Should I convert non standard frame rates?
By BrandoL10 in forum Video ConversionReplies: 6Last Post: 19th Jul 2017, 00:25 -
Differing Frame Rates
By ron spencer in forum EditingReplies: 4Last Post: 8th Mar 2017, 22:59