I'm fairly new to transcoding.I've been generating some mp4's from mxf files.
I've been playing around with some settings on ffmpeg and been specifying various bitrate's for audio and video with the -b:v
and -b:a
arguments.
When I check the file after they have been created with mediainfo
I notice that the audio bitrate displayed is always exactly the same I as specified, but video bitrate is different.
For example, I specified -b:v 1500k
but the video bitrate for file created when interrogated with mediainfo
says 6 943 kb/s. I was just wondering why this is? Why is audio bitrate always the same as selected and not video?
The full command is:
ffmpeg -i mediafile.mxf -vcodec libx264 -crf 23 -b:v 1500k mediafile.mp4
The output is:
ffmpeg version 2.6.8 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --enable-libfaac --enable-nonfree --enable-libfdk-aac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
libavutil 54. 20.100 / 54. 20.100
libavcodec 56. 26.100 / 56. 26.100
libavformat 56. 25.101 / 56. 25.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.102 / 5. 11.102
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Guessed Channel Layout for Input Stream #0.1 : mono
Guessed Channel Layout for Input Stream #0.2 : mono
Guessed Channel Layout for Input Stream #0.3 : mono
Guessed Channel Layout for Input Stream #0.4 : mono
Input #0, mxf, from 'mediafile.mxf':
Metadata:
uid : adab4424-2f25-4dc7-92ff-29bd000b0000
generation_uid : adab4424-2f25-4dc7-92ff-29bd000b0001
company_name : FFmbc
product_name : OP1a Muxer
product_version : 53.6.0
product_uid : adab4424-2f25-4dc7-92ff-29bd000b0002
modification_date: 2016-04-08 15:58:38
material_package_umid: 0x060A2B340101010501010D0013D24E0A529471342FD24E0A00529471342FD200
timecode : 00:00:00:00
Duration: 00:02:42.56, start: 0.000000, bitrate: 118682 kb/s
Stream #0:0: Video: dvvideo, yuv422p, 1440x1080 [SAR 4:3 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
Metadata:
file_package_umid: 0x060A2B340101010501010D0013D24E0A529471342FD24E0A00529471342FD201
Stream #0:1: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
Metadata:
file_package_umid: 0x060A2B340101010501010D0013D24E0A529471342FD24E0A00529471342FD201
Stream #0:2: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
Metadata:
file_package_umid: 0x060A2B340101010501010D0013D24E0A529471342FD24E0A00529471342FD201
Stream #0:3: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
Metadata:
file_package_umid: 0x060A2B340101010501010D0013D24E0A529471342FD24E0A00529471342FD201
Stream #0:4: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
Metadata:
file_package_umid: 0x060A2B340101010501010D0013D24E0A529471342FD24E0A00529471342FD201
File 'mediafile.mp4' already exists. Overwrite ? [y/N] y
No pixel format specified, yuv422p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0xe3b9a0] using SAR=4/3
[libx264 @ 0xe3b9a0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0xe3b9a0] profile High 4:2:2, level 4.0, 4:2:2 8-bit
[libx264 @ 0xe3b9a0] 264 - core 142 r2495 6a301b6 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 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=18 lookahead_threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'mediafile.mp4':
Metadata:
uid : adab4424-2f25-4dc7-92ff-29bd000b0000
generation_uid : adab4424-2f25-4dc7-92ff-29bd000b0001
company_name : FFmbc
product_name : OP1a Muxer
product_version : 53.6.0
product_uid : adab4424-2f25-4dc7-92ff-29bd000b0002
modification_date: 2016-04-08 15:58:38
material_package_umid: 0x060A2B340101010501010D0013D24E0A529471342FD24E0A00529471342FD200
timecode : 00:00:00:00
encoder : Lavf56.25.101
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv422p, 1440x1080 [SAR 4:3 DAR 16:9], q=-1--1, 1500 kb/s, 25 fps, 12800 tbn, 25 tbc
Metadata:
file_package_umid: 0x060A2B340101010501010D0013D24E0A529471342FD24E0A00529471342FD201
encoder : Lavc56.26.100 libx264
Stream #0:1: Audio: aac (libfaac) ([64][0][0][0] / 0x0040), 48000 Hz, mono, s16, 128 kb/s
Metadata:
file_package_umid: 0x060A2B340101010501010D0013D24E0A529471342FD24E0A00529471342FD201
encoder : Lavc56.26.100 libfaac
Stream mapping:
Stream #0:0 -> #0:0 (dvvideo (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (libfaac))
Press [q] to stop, [?] for help
frame= 4064 fps= 22 q=-1.0 Lsize= 139476kB time=00:02:42.56 bitrate=7028.7kbits/s
video:137744kB audio:1640kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.065406%
[libx264 @ 0xe3b9a0] frame I:72 Avg QP:21.59 size: 65595
[libx264 @ 0xe3b9a0] frame P:3978 Avg QP:24.85 size: 34252
[libx264 @ 0xe3b9a0] frame B:14 Avg QP:23.42 size: 5032
[libx264 @ 0xe3b9a0] consecutive B-frames: 99.3% 0.7% 0.0% 0.0%
[libx264 @ 0xe3b9a0] mb I I16..4: 12.6% 85.9% 1.5%
[libx264 @ 0xe3b9a0] mb P I16..4: 2.4% 25.6% 0.5% P16..4: 44.5% 9.3% 5.3% 0.0% 0.0% skip:12.5%
[libx264 @ 0xe3b9a0] mb B I16..4: 0.2% 0.9% 0.0% B16..8: 27.5% 0.5% 0.1% direct: 1.0% skip:69.9% L0:41.2% L1:57.3% BI: 1.5%
[libx264 @ 0xe3b9a0] 8x8 transform intra:89.8% inter:88.5%
[libx264 @ 0xe3b9a0] coded y,uvDC,uvAC intra: 76.2% 60.7% 7.8% inter: 38.4% 53.3% 0.1%
[libx264 @ 0xe3b9a0] i16 v,h,dc,p: 5% 72% 3% 19%
[libx264 @ 0xe3b9a0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 21% 35% 4% 4% 5% 4% 4% 5%
[libx264 @ 0xe3b9a0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 57% 13% 3% 3% 3% 3% 2% 3%
[libx264 @ 0xe3b9a0] i8c dc,h,v,p: 55% 20% 21% 4%
[libx264 @ 0xe3b9a0] Weighted P-Frames: Y:3.7% UV:2.4%
[libx264 @ 0xe3b9a0] ref P L0: 43.9% 13.1% 26.1% 16.5% 0.4%
[libx264 @ 0xe3b9a0] ref B L0: 68.4% 31.6%
[libx264 @ 0xe3b9a0] kb/s:6941.41
Thanks
-bufsize 1600k -maxrate 1600k