0

I am using python to combine several video files together using ffmpeg. Each of the videos files are exactly 20 seconds, 30.00fps, mp4 and the exact same resolution. When I concatenate the files, the outputted .mp4 file has a frame rate of 29.93fps.

I have specified in the command using -r 30, and in fmpeg text output (shown below) it says reads the command correctly, shows the input frame rate correctly, and states the output frame rate to be 30fps, but the resulting file actually is 29.93fps. I am also adding a subtitle track if that could make a difference. Can anyone figure out why, and how I can fix it?

Here is the command that python runs D:\Downloads\ffmpeg\bin\ffmpeg.exe -f concat -safe 0 -i temp\videos.txt -f srt -i temp\subtitles.srt -map 0:0 -map 0:1 -map 1:0 -c:v copy -c:a copy -c:s mov_text -r 30 temp\video.mp4

FFMPEG Text Output

Input #0, concat, from 'temp\videos.txt': Duration: N/A, start: 0.000000, bitrate: 423 kb/s Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m), 480x360, 106 kb/s, 30 fps, 30 tbr, 30k tbn, 60 tbc Metadata: creation_time : 2020-04-08T10:08:14.000000Z handler_name : ?Mainconcept Video Media Handler encoder : AVC Coding Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s Metadata: creation_time : 2020-04-08T10:08:14.000000Z handler_name : #Mainconcept MP4 Sound Media Handler Input #1, srt, from 'temp\subtitles.srt': Duration: N/A, bitrate: N/A Stream #1:0: Subtitle: subrip Output #0, mp4, to 'temp\video.mp4': Metadata: encoder : Lavf58.42.100 Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m), 480x360, q=2-31, 106 kb/s, 30 fps, 30 tbr, 15360 tbn, 30 tbc Metadata: creation_time : 2020-04-08T10:08:14.000000Z handler_name : ?Mainconcept Video Media Handler encoder : AVC Coding Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s Metadata: creation_time : 2020-04-08T10:08:14.000000Z handler_name : #Mainconcept MP4 Sound Media Handler Stream #0:2: Subtitle: mov_text (tx3g / 0x67337874) Metadata: encoder : Lavc58.77.101 mov_text Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Stream #1:0 -> #0:2 (subrip (srt) -> mov_text (native)) Press [q] to stop, [?] for help [mov,mp4,m4a,3gp,3g2,mj2 @ 0000028a2ec769c0] Auto-inserting h264_mp4toannexb bitstream filter [mov,mp4,m4a,3gp,3g2,mj2 @ 0000028a2ec7c980] Auto-inserting h264_mp4toannexb bitstream filter Last message repeated 4 times [mov,mp4,m4a,3gp,3g2,mj2 @ 0000028a2ef28280] Auto-inserting h264_mp4toannexb bitstream filter Last message repeated 5 times frame= 7800 fps=0.0 q=-1.0 Lsize= 13660kB time=00:04:20.62 bitrate= 429.4kbits/s speed=1.04e+03x video:3320kB audio:10078kB subtitle:2kB other streams:0kB global headers:0kB muxing overhead: 1.945927% b''

  • How do you know the output is 29.93? Need to see the complete info of the files listed in temp\videos.txt. ffmpeg -i input1.mp4 -i input2.mp4 -i input3.mp4, etc. – llogan Apr 9 at 18:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.