How do I get avconv/ffmpeg to output video with specific tbn, tbc


How do I get avconv/ffmpeg to output video with specific tbn, tbc

My father can only use an old video editor (Pinnacle Studio 12) that is very picky on what video files it imports. Here is the output of avprobe one of the videos it manages to import:

encoder: Lavf53.24.2 bitrate: 9884 kb/sStream #0.0: Video: mpeg4 (Simple Profile), yuv420p, 1920×1080 [PAR 9:16 DAR 1:1], 25 tbn, 25 tbc

I want to use a linux utility like avconv/ffmpeg to convert all my father’s video files to the above format. After a few hours of reading and tests I was able to match all properties of the video stream except tbn, tbc and bitrate (see note#1 with the command I use). Here is what avprob reports for the videos I create:

bitrate: 36617 kb/sStream #0.0: Video: mpeg4 (Simple Profile), yuv420p, 1920×1080 [PAR 9:16 DAR 1:1], 25 fps, 25 tbr, 90k tbn, 65535 tbc

And here is a diff to save you the trouble of cross-checking the two outputs:

ORIG: bitrate: 9884 kb/s 25 tbn, 25 tbcMINE: bitrate: 36617 kb/s 25 fps, 25 tbr, 90k tbn, 65535 tbc

At this point I’m stuck. I have a hard time even finding and understanding what on earth tbn, tbr and tbc are. I also wonder why avconv ignores the parameter -b:v 9756 but I believe I will figure this out with a bit of more googling and testing.

UPDATE

I’ve tried the same command at my laptop which is running Ubuntu 12.04 and avconv 0.8.16-4:0.8.16 and it produces a video that has exactly the same properties! See note#2. Of course it’s very difficult to downgrade my father’s PC from Ubuntu 14.04 to 12.04 so I’m still looking for a solution that will work there. [to be frank there is a difference in the audio codec in the command that runs at my PC. I had to replace mp3 with libmp3lame since for some reason the former doesn’t work.]


Note#1 Here is the command I use (on ubuntu 14.04):

avconv -i GOPR0392.MP4 -codec:a mp3 -b:a 128k -ar:a 44100 -codec:v libxvid -aspect:v 1 -b:v 9756k test.avi

And this is the output:

avconv version 9.16-6:9.16-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers built on Aug 10 2014 18:16:02 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)[mov,mp4,m4a,3gp,3g2,mj2 @ 0x11f8060] Non-increasing DTS in stream 3: packet 2 with DTS 0, packet 3 with DTS 0……[mov,mp4,m4a,3gp,3g2,mj2 @ 0x11f8060] Non-increasing DTS in stream 3: packet 54 with DTS 0, packet 55 with DTS 0[mov,mp4,m4a,3gp,3g2,mj2 @ 0x11f8060] Non-increasing DTS in stream 3: packet 55 with DTS 0, packet 56 with DTS 0[mov,mp4,m4a,3gp,3g2,mj2 @ 0x11f8060] Non-increasing DTS in stream 3: packet 56 with DTS 0, packet 57 with DTS 0Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ‘GOPR0392.MP4’: Metadata: major_brand : mp41 minor_version : 538120216 compatible_brands: mp41 creation_time : 2015-02-08 01:30:55 Duration: 00:03:02.33, start: 0.000000, bitrate: 45149 kb/s Stream #0.0(eng): Video: h264 (High), yuvj420p, 1920×1080 [PAR 1:1 DAR 16:9], 45007 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc Metadata: creation_time : 2015-02-08 01:30:55 Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, fltp, 128 kb/s Metadata: creation_time : 2015-02-08 01:30:55 Stream #0.2(eng): Data: tmcd / 0x64636D74 Metadata: creation_time : 2015-02-08 01:30:55 Stream #0.3(eng): Data: fdsc / 0x63736466, 9 kb/s Metadata: creation_time : 2015-02-08 01:30:55File ‘test.avi’ already exists. Overwrite ? [y/N] yOutput #0, avi, to ‘test.avi’: Metadata: major_brand : mp41 minor_version : 538120216 compatible_brands: mp41 creation_time : 2015-02-08 01:30:55 ISFT : Lavf54.20.4 Stream #0.0(eng): Video: libxvid, yuv420p, 1920×1080 [PAR 9:16 DAR 1:1], q=2-31, 9756 kb/s, 90k tbn, 90k tbc Metadata: creation_time : 2015-02-08 01:30:55 Stream #0.1(eng): Audio: libmp3lame, 44100 Hz, stereo, fltp, 128 kb/s Metadata: creation_time : 2015-02-08 01:30:55Stream mapping: Stream #0:0 -> #0:0 (h264 -> libxvid) Stream #0:1 -> #0:1 (aac -> libmp3lame)Press ctrl-c to stop encoding^Cframe= 1531 fps= 11 q=2.0 Lsize= 261134kB time=61.18 bitrate=34966.6kbits/s video:131019kB audio:955kB global headers:0kB muxing overhead 97.868984%Received signal 2: terminating.

Note #2 The same command from my latop (Ubuntu 12.04):

avconv -i GOPR0399.MP4 -codec:a libmp3lame -b:a 128k -ar:a 44100 -codec:v libxvid -aspect:v 1 -b:v 9756k test.aviavconv version 0.8.16-4:0.8.16-0ubuntu0.12.04.1, Copyright (c) 2000-2014 the Libav developersbuilt on Sep 16 2014 18:35:14 with gcc 4.6.3Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ‘GOPR0399.MP4’:Metadata: major_brand : mp41 minor_version : 538120216 compatible_brands: mp41 creation_time : 2015-02-11 17:53:34Duration: 00:00:29.48, start: 0.000000, bitrate: 45176 kb/s Stream #0.0(eng): Video: h264 (High), yuvj420p, 1920×1080 [PAR 1:1 DAR 16:9], 45028 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc Metadata: creation_time : 2015-02-11 17:53:34 Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, s16, 128 kb/s Metadata: creation_time : 2015-02-11 17:53:34 Stream #0.2(eng): Data: tmcd / 0x64636D74, 0 kb/s Metadata: creation_time : 2015-02-11 17:53:34 Stream #0.3(eng): Data: fdsc / 0x63736466, 9 kb/s Metadata: creation_time : 2015-02-11 17:53:34File ‘test.avi’ already exists. Overwrite ? [y/N] yIncompatible pixel format ‘yuvj420p’ for codec ‘libxvid’, auto-selecting format ‘yuv420p'[buffer @ 0x9bd81a0] w:1920 h:1080 pixfmt:yuvj420p[avsink @ 0x9bc89c0] auto-inserting filter ‘auto-inserted scaler 0’ between the filter ‘src’ and the filter ‘out'[scale @ 0x9bc8520] w:1920 h:1080 fmt:yuvj420p -> w:1920 h:1080 fmt:yuv420p flags:0x4Output #0, avi, to ‘test.avi’:Metadata: major_brand : mp41 minor_version : 538120216 compatible_brands: mp41 creation_time : 2015-02-11 17:53:34 ISFT : Lavf53.21.1 Stream #0.0(eng): Video: mpeg4, yuv420p, 1920×1080 [PAR 9:16 DAR 1:1], q=2-31, 9756 kb/s, 25 tbn, 25 tbc Metadata: creation_time : 2015-02-11 17:53:34 Stream #0.1(eng): Audio: libmp3lame, 44100 Hz, stereo, s16, 128 kb/s Metadata: creation_time : 2015-02-11 17:53:34Stream mapping:Stream #0:0 -> #0:0 (h264 -> libxvid)Stream #0:1 -> #0:1 (aac -> libmp3lame)Press ctrl-c to stop encodingframe= 737 fps= 14 q=3.0 Lsize= 36119kB time=29.48 bitrate=10037.0kbits/s video:35605kB audio:461kB global headers:0kB muxing overhead 0.149473%

And now avprobe reports exactly the same video properties (well the bitrate is bit different but I guess this is expected):

avprobe test.avi avprobe version 0.8.16-4:0.8.16-0ubuntu0.12.04.1, Copyright (c) 2007-2014 the Libav developersbuilt on Sep 16 2014 18:35:14 with gcc 4.6.3Input #0, avi, from ‘test.avi’:Metadata: encoder : Lavf53.21.1Duration: 00:00:29.49, start: 0.000000, bitrate: 10032 kb/s Stream #0.0: Video: mpeg4 (Simple Profile), yuv420p, 1920×1080 [PAR 9:16 DAR 1:1], 25 tbr, 25 tbn, 25 tbc Stream #0.1: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s

1 Answer

Leave a Reply

Your email address will not be published. Required fields are marked *