0

I need to set tbc option for output video. For example, input video has 25 fps with 50 tbc and my encoded video has 25fps with 25 tbc. I used settb and video_track_timescale but these options did not change tbc. So my question is how can i set double fps for tbc?

Input video log

Duration: 00:04:41.33, start: 0.000000, bitrate: 1258 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1064 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc (default)

Output video log

Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, max. 1835 kb/s, 25 fps, 12800 tbn, 25 tbc (default)

The ffmpeg command

ffmpeg -y -i input.mp4 -filter_complex "scale=-2:'min(720,ih)',fps=25" -codec:v libx264 -profile:v high -level 4.0 -preset slow -minrate 1835k -maxrate 1835k -bufsize 2441k -c:a aac -strict experimental -q:a 9 -crf 20 -pix_fmt yuv420p output.mp4 1> output.log 2>&1

Full output log

ffmpeg version N-76684-g1fe82ab Copyright (c) 2000-2015 the FFmpeg developers     
built with gcc 5.2.0 (GCC)  
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib  
  libavutil      55.  6.100 / 55.  6.100
  libavcodec     57. 15.100 / 57. 15.100
  libavformat    57. 14.100 / 57. 14.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 15.100 /  6. 15.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2015-02-20 11:51:25
  Duration: 00:04:41.33, start: 0.000000, bitrate: 1258 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1064 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc (default)
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 192 kb/s (default)
    Metadata:
      creation_time   : 2015-02-20 11:51:26
      handler_name    : IsoMedia File Produced by Google, 5-11-2011
[libx264 @ 0000001d2ffe0a00] using SAR=1/1
[libx264 @ 0000001d2ffe0a00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0000001d2ffe0a00] profile High, level 4.0
[libx264 @ 0000001d2ffe0a00] 264 - core 148 r2638 7599210 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=crf mbtree=1 crf=20.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=1835 vbv_bufsize=2441 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    encoder         : Lavf57.14.100
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, max. 1835 kb/s, 25 fps, 12800 tbn, 25 tbc (default)
    Metadata:
      encoder         : Lavc57.15.100 libx264
    Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      creation_time   : 2015-02-20 11:51:26
      handler_name    : IsoMedia File Produced by Google, 5-11-2011
      encoder         : Lavc57.15.100 aac
Stream mapping:
  Stream #0:0 (h264) -> scale (graph 0)
  settb (graph 0) -> Stream #0:0 (libx264)
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
frame=    3 fps=0.0 q=0.0 size=       0kB time=00:00:05.89 bitrate=   0.1kbits/s dup=0 drop=148

Also in output video, i see option q=-1--1. What is this? How can i configure this option?

  • Is this to create 25 PsF streams or what is the purpose of the operation? – Hans Meiser Mar 22 '16 at 17:56
  • @HansMeiser No, i just wanted to set double tbc from fps. Now i understood that there is no neccessary to change this option. – nurmat Mar 25 '16 at 11:40
0

Add -r 25 to your command.

The q readout refers to the allowed range for the quantizer. There's no bounds applied in your command, but you can limit by setting one or both of

-qmin N and -qmax N

Unless you have good reason to, don't change it.

0

You can accomplish that by adding -r 25 or even -r 60, as you like to experiment. Here's example:

 ffmpeg -r 25 -i input.mov codec:v copy codec:a copy -f mp4 output.mp4

instead of

ffmpeg -i input.mov codec:v copy -r 25 codec:a copy -f mp4 output.mp4

The key I found to be in control exactly what I wanted is to place -r 25 right before the input agrument.

  • When streamcopying, this only works for raw video streams. – Gyan Aug 24 '16 at 6:52

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.