[FFmpeg-user] Concat movies with different timebase

T4ng10r tanglor at poczta.onet.pl
Wed Nov 1 09:34:38 EET 2017


Hi,

I've got around 100 movies. Part of them are AVI:

[avi @ 0x561e6733c640] non-interleaved AVI
Input #0, avi, from 'V-0018.AVI':
   Duration: 00:00:11.04, start: 0.000000, bitrate: 4571 kb/s
     Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, 
bt470bg/unknown/unknown), 640x480, 4515 kb/s, 28.18 fps, 28.18 tbr, 
28.18 tbn, 28.18 tbc
     Stream #0:1: Audio: pcm_u8 ([1][0][0][0] / 0x0001), 8000 Hz, 1 
channels, u8, 64 kb/s


rest are MP4:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'MAH00607.MP4':
   Metadata:
     major_brand     : MSNV
     minor_version   : 22675568
     compatible_brands: MSNVmp42isom
     creation_time   : 2017-06-14T20:20:24.000000Z
   Duration: 00:00:12.48, start: 0.000000, bitrate: 2795 kb/s
     Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), 
yuv420p(tv, bt709/bt709/iec61966-2-4), 1280x720 [SAR 1:1 DAR 16:9], 2664 
kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc (default)
     Metadata:
       creation_time   : 2017-06-14T20:20:24.000000Z
       handler_name    : Video Media Handler
       encoder         : AVC Coding
     Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 
stereo, fltp, 127 kb/s (default)
     Metadata:
       creation_time   : 2017-06-14T20:20:24.000000Z
       handler_name    : Sound Media Handler


I'm using this script to convert movies (insert timestamp) -> 
https://gist.github.com/T4ng10r/4f57212465a32172e4a4bb7a654fcd0e

As you see - timebase for both movies are different. When I concat 
converted movies time duration of movie is distorted, after few first 
AVI videos movie freeze. And in console I see lots of

"Non-monotonous DTS in output stream 0:0; previous: 131753981, current: 
3274138; changing to 131753982. This may result in incorrect timestamps 
in the output file."

I've tried with adding  -r 25 to convert function for avi, with no 
result. The same with https://stackoverflow.com/a/41744007/603044 Mulvya 
- converting AVI takes ages.


How should I treat AVI (which are far more less then MP4) so the final 
movie be correct?



More information about the ffmpeg-user mailing list