gain the highest quality with H264 at a certain bit rate
I have encoded my videos using ffmpeg and H264, and this is my ffmpeg command (2 pass encoding): ffmpeg -y -i Edited\ Clips/arsenalVScristalPalas.mp4 -movflags faststart -c:v libx264 -x264opts 'keyint=300:min-keyint=25:8x8dct:sliced-threads=0:subq=6' -deblock 0:0 -flags +loop -preset slow -tune zerolatency -b:v 2048k -maxrate 2048k -bufsize 3000k -vf "scale=-1280:720" -pass 1 -acodec libmp3lame -b:a 128k -coder 1 -me_range 16 -sc_threshold 42 -bf 10 -qmin 0 -qmax 51 -trellis 2 -rc_lookahead 60 -ss 00:01:00 -t 00:01:00 -f mp4 /dev/null ffmpeg -i Edited\ Clips/arsenalVScristalPalas.mp4 -movflags faststart -c:v libx264 -x264opts 'keyint=300:min-keyint=25:8x8dct:sliced-threads=0:subq=6' -deblock 0:0 -flags +loop -preset slow -tune zerolatency -b:v 2048k -maxrate 2048k -bufsize 3000k -vf "scale=-1280:720" -pass 2 -acodec libmp3lame -b:a 128k -coder 1 -me_range 16 -sc_threshold 42 -bf 10 -qmin 0 -qmax 51 -trellis 2 -rc_lookahead 60 -ss 00:01:00 -t 00:01:00 2pass15.mp4 I need the video to be in the highest quality (at the 2000kbps bitrate). I have another video with the same bitrate (from another source), but It has a better quality than my video. I need to reach that quality. I used mediainfo to get the encoding options for that video, and here is the information: General Complete name : arsenalVScristalPalas_hd.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom (isom/iso2/avc1/mp41) File size : 171 MiB Duration : 11mn 1s Overall bit rate : 2 164 Kbps Encoded date : UTC 1904-01-01 00:00:00 Tagged date : UTC 1904-01-01 00:00:00 Writing application : Lavf57.63.100 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : Main@L3.1 Format settings, CABAC : Yes Format settings, ReFrames : 6 frames Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 11mn 1s Bit rate : 2 048 Kbps Width : 1 280 pixels Height : 720 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 50.000 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.044 Stream size : 160 MiB (94%) Writing library : x264 core 148 r2643 5c65704 Encoding settings : cabac=1 / ref=6 / deblock=1:1:1 / analyse=0x1:0x131 / me=umh / subme=9 / psy=1 / psy_rd=0.40:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=22 / lookahead_threads=5 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=10 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=300 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=2pass / mbtree=1 / bitrate=2048 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=2048 / vbv_bufsize=5000 / nal_hrd=none / filler=0 / ip_ratio=1.41 / aq=1:0.60 Language : English Encoded date : UTC 1904-01-01 00:00:00 Tagged date : UTC 1904-01-01 00:00:00 Audio ID : 2 Format : AAC Format/Info : Advanced Audio Codec Format profile : HE-AAC / LC Codec ID : 40 Duration : 11mn 1s Duration_LastFrame : -23ms Bit rate mode : Constant Bit rate : 128 Kbps Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 48.0 KHz / 24.0 KHz Frame rate : 23.438 fps (1024 spf) Compression mode : Lossy Stream size : 10.1 MiB (6%) Language : English Default : Yes Alternate group : 1 Encoded date : UTC 1904-01-01 00:00:00 Tagged date : UTC 1904-01-01 00:00:00 and this is the information of my video: General Complete name : 2pass14.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom (isom/iso2/avc1/mp41) File size : 15.4 MiB Duration : 1mn 0s Overall bit rate : 2 150 Kbps Encoded date : UTC 1904-01-01 00:00:00 Tagged date : UTC 1904-01-01 00:00:00 Writing application : Lavf56.40.101 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L3.2 Format settings, CABAC : Yes Format settings, ReFrames : 5 frames Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 1mn 0s Bit rate : 2 048 Kbps Width : 1 280 pixels Height : 720 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 50.000 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.044 Stream size : 14.4 MiB (94%) Writing library : x264 core 148 r2643 5c65704 Encoding settings : cabac=1 / ref=5 / deblock=1:3:3 / analyse=0x3:0x113 / me=umh / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=3 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=10 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=300 / keyint_min=25 / scenecut=42 / intra_refresh=0 / rc_lookahead=0 / rc=2pass / mbtree=0 / bitrate=2048 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=2048 / vbv_bufsize=3000 / nal_hrd=none / filler=0 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00 Language : English Encoded date : UTC 1904-01-01 00:00:00 Tagged date : UTC 1904-01-01 00:00:00 Audio ID : 2 Format : MPEG Audio Format version : Version 1 Format profile : Layer 3 Mode : Joint stereo Mode extension : MS Stereo Codec ID : 6B Duration : 1mn 0s Duration_LastFrame : -1ms Bit rate mode : Constant Bit rate : 128 Kbps Maximum bit rate : 2 048 Kbps Channel(s) : 2 channels Sampling rate : 48.0 KHz Compression mode : Lossy Stream size : 938 KiB (6%) Language : English Default : Yes Alternate group : 1 Encoded date : UTC 1904-01-01 00:00:00 Tagged date : UTC 1904-01-01 00:00:00 is there anything that I am doing wrong?? any suggestions on how to improve my output quality?? and here is a demo of videos, the video that has a better quality: https://ufile.io/b7a1b my video, that I need to improve quality: https://ufile.io/363f11
negin tebyani wrote:
I have encoded my videos using ffmpeg and H264, and this is my ffmpeg command (2 pass encoding):
I don't think 2 pass is needed for constant bitrate - but am in no way an expert on encoding. Look at the differences in the params you pasted .... bufsize 3000k (you) vs 5000k. possibly omit -tune zerolatency subme is different - maybe try -preset veryslow See what it looks like ... Can you post the master for these?
I am trying to reach that quality and using those parameters but the result is still low quality.. you mean bufsize could affect the quality?? I removed zerolatency but I am not getting a impressive result. On Mon, Mar 27, 2017 at 7:32 PM, Andy Furniss <adf.lists@gmail.com> wrote:
negin tebyani wrote:
I have encoded my videos using ffmpeg and H264, and this is my ffmpeg command (2 pass encoding):
I don't think 2 pass is needed for constant bitrate - but am in no way an expert on encoding.
Look at the differences in the params you pasted ....
bufsize 3000k (you) vs 5000k.
possibly omit -tune zerolatency
subme is different - maybe try -preset veryslow
See what it looks like ...
Can you post the master for these? _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
negin tebyani wrote:
I am trying to reach that quality and using those parameters but the result is still low quality..
Please don't top post on this list - reply in line like I do here.
you mean bufsize could affect the quality??
A bit, but I don't know how much in this case, just that it was an obvious difference between good and bad - so worth changing.
I removed zerolatency but I am not getting a impressive result.
For good reason it is usual on here to be asked for full console output as well as the command used. Can you post that please and if possible supply the section of the master file you used to make the results you posted. Do you absolutely need constant bitrate output or are you just testing to match up with the other encode?
this is the source video mediainfo: General Complete name : arsenalVScristalPalas.mp4 Format : MPEG-4 Format profile : JVT Codec ID : avc1 (avc1/mp42) File size : 347 MiB Duration : 11mn 1s Overall bit rate mode : Constant Overall bit rate : 4 407 Kbps Encoded date : UTC 2017-01-03 09:36:38 Tagged date : UTC 2017-01-03 09:36:38 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L3.2 Format settings, CABAC : Yes Format settings, ReFrames : 2 frames Format settings, GOP : M=3, N=30 Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 11mn 1s Bit rate mode : Constant Bit rate : 4 000 Kbps Width : 1 280 pixels Height : 720 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 50.000 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.087 Stream size : 315 MiB (91%) Language : English Encoded date : UTC 2017-01-03 09:36:38 Tagged date : UTC 2017-01-03 09:36:38 Audio ID : 2 Format : AAC Format/Info : Advanced Audio Codec Format profile : LC Codec ID : 40 Duration : 11mn 1s Source duration : 11mn 1s Bit rate mode : Constant Bit rate : 384 Kbps Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 48.0 KHz Frame rate : 46.875 fps (1024 spf) Compression mode : Lossy Stream size : 30.3 MiB (9%) Source stream size : 30.3 MiB (9%) Language : English Encoded date : UTC 2017-01-03 09:36:38 Tagged date : UTC 2017-01-03 09:36:38 and yes, I need to use constant bitrate. do I need to use 2 pass with constant bitrate?
W dniu 2017-03-27 o 19:24, negin tebyani pisze:
and yes, I need to use constant bitrate. do I need to use 2 pass with constant bitrate?
You do not need second pass with constant bitrate, but with 2 pass - in first pass it log where it need bitrate and use that knowledge to distrubuate in second pass, because even with constant bitrate you have small variations along time. I add deblock filter before because reencoding favors block artifacts. From source info what you post i saw that you have the same resolutions, you do not need scale. So you doing 1280:720/50fps/yuv422p 4,4 Mbps -> 1280:720/50fps/yuv422p 2 Mbps ? I saw both samples and your was even more crispy sometimes, found that you doing 5 reframes, when others 6 (it help with bitrate a bit). So what you want improve? Dark parts? Or artifacts? Or fast motion scene blocks? Or more sharpen? Try that: ffmpeg -y -i in.mp4 -an -c:v libx264 -preset veryslow -b:v 2048k -bf 8**-qcomp 0.8 -pass 1 /dev/null ffmpeg -y -i in.mp4 -c:a aac -b:a 128k -c:v libx264 -preset veryslow -b:v 2048k -bf 8 -qcomp 0.8 -pass 2 out.mp4
The problem is that when I pause both videos at the same scene, the other video is so smooth and you can't see any noise, but mine is not like that. It seems they have used some video filter or something to Remove the noise.
Then i can think only about that: ffmpeg -y -i in.mp4 -an -c:v libx264 -preset veryslow -b:v 2048k -refs 8 -qcomp 0.7 -nr 40 -flags +loop -deblock 1:0 -pass 1 /dev/null ffmpeg -y -i in.mp4 -c:a aac -b:a 128k -c:v libx264 -preset veryslow -b:v 2048k -refs 8 -qcomp 0.7 -nr 40 -flags +loop -deblock 1:0 -pass 2 out.mp4 W dniu 2017-03-28 o 05:50, negin tebyani pisze:
The problem is that when I pause both videos at the same scene, the other video is so smooth and you can't see any noise, but mine is not like that. It seems they have used some video filter or something to Remove the noise. _______________________________________________
unfortunately this does not make differences in results either: Then i can think only about that:
ffmpeg -y -i in.mp4 -an -c:v libx264 -preset veryslow -b:v 2048k -refs 8 -qcomp 0.7 -nr 40 -flags +loop -deblock 1:0 -pass 1 /dev/null ffmpeg -y -i in.mp4 -c:a aac -b:a 128k -c:v libx264 -preset veryslow -b:v 2048k -refs 8 -qcomp 0.7 -nr 40 -flags +loop -deblock 1:0 -pass 2 out.mp4
I'm realy stuck in here, I have tried any commands and any suggestions, but I'm not even close to that quality (actually I need to be even better than than one).
negin tebyani wrote:
I'm realy stuck in here, I have tried any commands and any suggestions, but
Well ignoring requests for ffmpeg console output and a section of the master that the provided samples were made from means that less people will even try to help you.
Well ignoring requests for ffmpeg console output and a section of the master that the provided samples were made from means that less people will even try to help you.
I don'n know how to reach for ffmpeg output console, but here is a section of the master video: https://ufile.io/6c57f1
Am 28.03.2017 um 14:15 schrieb negin tebyani:
Well ignoring requests for ffmpeg console output and a section of the master that the provided samples were made from means that less people will even try to help you.
I don'n know how to reach for ffmpeg output console
what the hell - you are typing a command in the terminal and that command is producing outputs - you where requested to copy&paste that into your response mail - not more and not less
you where requested to copy&paste that into your response mail - not more and not less
ok, here is the output: ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609 configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv libavutil 54. 31.100 / 54. 31.100 libavcodec 56. 60.100 / 56. 60.100 libavformat 56. 40.101 / 56. 40.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 40.101 / 5. 40.101 libavresample 2. 1. 0 / 2. 1. 0 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 2.101 / 1. 2.101 libpostproc 53. 3.100 / 53. 3.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'arsenalVScristalPalas.mp4': Metadata: major_brand : avc1 minor_version : 0 compatible_brands: avc1mp42 creation_time : 2017-01-03 09:36:38 Duration: 00:11:01.24, start: 0.000000, bitrate: 4407 kb/s Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 3998 kb/s, 50 fps, 50 tbr, 50 tbn, 100 tbc (default) Metadata: creation_time : 2017-01-03 09:36:38 handler_name : Video Media Handler encoder : AVC Coding Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 384 kb/s (default) Metadata: creation_time : 2017-01-03 09:36:38 handler_name : Sound Media Handler File 'quantizer2.mp4' already exists. Overwrite ? [y/N] Y [libx264 @ 0x1e85800] using SAR=1/1 [libx264 @ 0x1e85800] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2 [libx264 @ 0x1e85800] profile High, level 5.0 [libx264 @ 0x1e85800] 264 - core 148 r2643 5c65704 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=16 deblock=1:1:1 analyse=0x3:0x133 me=umh subme=10 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 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=10 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=300 keyint_min=25 scenecut=42 intra_refresh=0 rc_lookahead=60 rc=cbr mbtree=1 bitrate=2048 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=40 qpstep=4 vbv_maxrate=2048 vbv_bufsize=5000 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00 [mp4 @ 0x1e42ba0] Codec for stream 1 does not use global headers but container format requires global headers Output #0, mp4, to 'quantizer2.mp4': Metadata: major_brand : avc1 minor_version : 0 compatible_brands: avc1mp42 encoder : Lavf56.40.101 Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=0-40, 2048 kb/s, 50 fps, 12800 tbn, 50 tbc (default) Metadata: creation_time : 2017-01-03 09:36:38 handler_name : Video Media Handler encoder : Lavc56.60.100 libx264 Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 384 kb/s (default) Metadata: creation_time : 2017-01-03 09:36:38 handler_name : Sound Media Handler Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help [mp4 @ 0x1e42ba0] Starting second pass: moving the moov atom to the beginning of the file frame= 3000 fps= 14 q=-1.0 Lsize= 17917kB time=00:01:00.00 bitrate=2446.2kbits/s video:15036kB audio:2812kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.384389% [libx264 @ 0x1e85800] frame I:11 Avg QP:22.14 size: 51638 [libx264 @ 0x1e85800] frame P:691 Avg QP:27.11 size: 12898 [libx264 @ 0x1e85800] frame B:2298 Avg QP:33.45 size: 2574 [libx264 @ 0x1e85800] consecutive B-frames: 1.6% 4.8% 18.9% 6.5% 3.8% 64.0% 0.0% 0.0% 0.0% 0.3% 0.0% [libx264 @ 0x1e85800] mb I I16..4: 21.9% 53.6% 24.5% [libx264 @ 0x1e85800] mb P I16..4: 10.6% 11.4% 1.0% P16..4: 36.0% 6.8% 5.4% 0.2% 0.1% skip:28.4% [libx264 @ 0x1e85800] mb B I16..4: 0.8% 0.9% 0.1% B16..8: 31.3% 2.5% 0.4% direct: 0.8% skip:63.3% L0:43.7% L1:52.4% BI: 3.9% [libx264 @ 0x1e85800] 8x8 transform intra:50.1% inter:65.1% [libx264 @ 0x1e85800] direct mvs spatial:99.8% temporal:0.2% [libx264 @ 0x1e85800] coded y,uvDC,uvAC intra: 23.1% 27.6% 5.5% inter: 4.0% 4.7% 0.5% [libx264 @ 0x1e85800] i16 v,h,dc,p: 18% 38% 19% 26% [libx264 @ 0x1e85800] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 21% 24% 5% 6% 6% 8% 6% 9% [libx264 @ 0x1e85800] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 17% 16% 6% 9% 9% 10% 7% 9% [libx264 @ 0x1e85800] i8c dc,h,v,p: 61% 22% 12% 5% [libx264 @ 0x1e85800] Weighted P-Frames: Y:0.1% UV:0.1% [libx264 @ 0x1e85800] ref P L0: 63.7% 9.2% 12.1% 4.1% 2.4% 1.8% 1.4% 0.9% 0.7% 0.8% 0.5% 0.5% 0.5% 0.5% 0.5% 0.3% [libx264 @ 0x1e85800] ref B L0: 88.1% 6.3% 2.2% 0.8% 0.6% 0.5% 0.4% 0.2% 0.2% 0.2% 0.1% 0.1% 0.1% 0.1% 0.1% [libx264 @ 0x1e85800] ref B L1: 94.9% 5.1% [libx264 @ 0x1e85800] kb/s:2052.83 with 1 pass encoding.
Am 28.03.2017 um 15:07 schrieb negin tebyani:
you where requested to copy&paste that into your response mail - not more and not less
ok, here is the output:
ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
besides that 2.8.x is *terrible* outdated when we have 3.1 und 3.2 over many months - any reason why cut out the command line itself which makes the context to the outputs?
sorry, I forgot to paste the command: ffmpeg -i arsenalVScristalPalas.mp4 -movflags faststart -c:v libx264 -x264opts 'keyint=300:min-keyint=25:8x8dct:sliced-threads=0' -qblur 0.5 -deblock 1:1 -flags +loop -b:v 2048k -maxrate 2048k -bufsize 5000k -vf "scale=-1280:720:flags=spline+full_chroma_inp+full_chroma_int+accurate_rnd+bitexact" -qcomp 0.60 -qblur 0.5 -acodec copy -b:a 128k -coder 1 -me_range 6 -sc_threshold 42 -bf 10 -qmin 0 -qmax 40 -qblur 0.5 -trellis 2 -mbtree 1 -preset veryslow -ss 00:01:00 -t 00:01:00 quantizer2.mp4 ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609 configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv libavutil 54. 31.100 / 54. 31.100 libavcodec 56. 60.100 / 56. 60.100 libavformat 56. 40.101 / 56. 40.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 40.101 / 5. 40.101 libavresample 2. 1. 0 / 2. 1. 0 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 2.101 / 1. 2.101 libpostproc 53. 3.100 / 53. 3.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'arsenalVScristalPalas.mp4': Metadata: major_brand : avc1 minor_version : 0 compatible_brands: avc1mp42 creation_time : 2017-01-03 09:36:38 Duration: 00:11:01.24, start: 0.000000, bitrate: 4407 kb/s Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 3998 kb/s, 50 fps, 50 tbr, 50 tbn, 100 tbc (default) Metadata: creation_time : 2017-01-03 09:36:38 handler_name : Video Media Handler encoder : AVC Coding Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 384 kb/s (default) Metadata: creation_time : 2017-01-03 09:36:38 handler_name : Sound Media Handler File 'quantizer2.mp4' already exists. Overwrite ? [y/N] y [libx264 @ 0xedb800] using SAR=1/1 [libx264 @ 0xedb800] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2 [libx264 @ 0xedb800] profile High, level 5.0 [libx264 @ 0xedb800] 264 - core 148 r2643 5c65704 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=16 deblock=1:1:1 analyse=0x3:0x133 me=umh subme=10 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=6 chroma_me=1 trellis=2 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=10 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=300 keyint_min=25 scenecut=42 intra_refresh=0 rc_lookahead=60 rc=cbr mbtree=1 bitrate=2048 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=40 qpstep=4 vbv_maxrate=2048 vbv_bufsize=5000 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00 [mp4 @ 0xe98ba0] Codec for stream 1 does not use global headers but container format requires global headers Output #0, mp4, to 'quantizer2.mp4': Metadata: major_brand : avc1 minor_version : 0 compatible_brands: avc1mp42 encoder : Lavf56.40.101 Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=0-40, 2048 kb/s, 50 fps, 12800 tbn, 50 tbc (default) Metadata: creation_time : 2017-01-03 09:36:38 handler_name : Video Media Handler encoder : Lavc56.60.100 libx264 Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 384 kb/s (default) Metadata: creation_time : 2017-01-03 09:36:38 handler_name : Sound Media Handler Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help [mp4 @ 0xe98ba0] Starting second pass: moving the moov atom to the beginning of the file frame= 3000 fps= 16 q=-1.0 Lsize= 17922kB time=00:01:00.00 bitrate=2447.0kbits/s video:15041kB audio:2812kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.385285% [libx264 @ 0xedb800] frame I:11 Avg QP:22.20 size: 51404 [libx264 @ 0xedb800] frame P:709 Avg QP:27.18 size: 12762 [libx264 @ 0xedb800] frame B:2280 Avg QP:33.45 size: 2539 [libx264 @ 0xedb800] consecutive B-frames: 1.7% 5.8% 19.6% 6.7% 4.0% 62.2% 0.0% 0.0% 0.0% 0.0% 0.0% [libx264 @ 0xedb800] mb I I16..4: 22.2% 53.2% 24.6% [libx264 @ 0xedb800] mb P I16..4: 10.7% 11.6% 1.1% P16..4: 35.7% 6.6% 5.2% 0.2% 0.1% skip:28.7% [libx264 @ 0xedb800] mb B I16..4: 0.7% 0.8% 0.1% B16..8: 31.3% 2.4% 0.4% direct: 0.8% skip:63.4% L0:43.4% L1:52.7% BI: 3.9% [libx264 @ 0xedb800] 8x8 transform intra:49.9% inter:65.4% [libx264 @ 0xedb800] direct mvs spatial:99.8% temporal:0.2% [libx264 @ 0xedb800] coded y,uvDC,uvAC intra: 23.1% 27.7% 5.6% inter: 4.1% 4.7% 0.5% [libx264 @ 0xedb800] i16 v,h,dc,p: 18% 37% 19% 26% [libx264 @ 0xedb800] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 21% 24% 5% 6% 6% 8% 6% 9% [libx264 @ 0xedb800] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 17% 17% 6% 9% 9% 9% 7% 9% [libx264 @ 0xedb800] i8c dc,h,v,p: 61% 22% 12% 5% [libx264 @ 0xedb800] Weighted P-Frames: Y:0.1% UV:0.1% [libx264 @ 0xedb800] ref P L0: 63.8% 9.5% 12.1% 4.0% 2.3% 1.8% 1.4% 0.9% 0.7% 0.8% 0.5% 0.5% 0.5% 0.4% 0.4% 0.3% [libx264 @ 0xedb800] ref B L0: 88.3% 6.3% 2.2% 0.8% 0.6% 0.5% 0.4% 0.2% 0.2% 0.1% 0.1% 0.1% 0.1% 0.1% 0.1% [libx264 @ 0xedb800] ref B L1: 94.9% 5.1% [libx264 @ 0xedb800] kb/s:2053.53
besides that 2.8.x is *terrible* outdated when we have 3.1 und 3.2 over many months - any reason why cut out the command line itself which makes the context to the outputs?
I found that source file have many compression artifacts... i put some nasty filter and tune options a bit. Not good yet, but is a bit better? ffmpeg -y -i in.mp4 -vf pp=va/ha,uspp=7 -an -c:v libx264 -preset veryslow -b:v 2M -minrate 2M -maxrate 2M -bufsize 4M -refs 6 -me_range 64 -qcomp 0.6 -nr 40 -flags +loop -deblock 2:2 -pass 1 /dev/null ffmpeg -y -i in.mp4 -vf pp=va/ha,uspp=7 -c:a aac -b:a 128k -c:v libx264 -preset veryslow -b:v 2M -minrate 2M -maxrate 2M -bufsize 4M -refs 6 -me_range 64 -qcomp 0.6 -nr 40 -flags +loop -deblock 2:2 -pass 2 out.mp4 W dniu 2017-03-28 o 14:15, negin tebyani pisze:
I don'n know how to reach for ffmpeg output console, but here is a section of the master video:
https://ufile.io/6c57f1 _______________________________________________
I found that source file have many compression artifacts... i put some
nasty filter and tune options a bit. Not good yet, but is a bit better?
thank you, I tried you command but the quality is still lower than the other one..
Ok, more denoising and small tuning: ffmpeg -y -i in.mp4 -vf pp=va/ha,uspp=7,hqdn3d=4:3:4:4 -an -c:v libx264 -preset veryslow -profile high -b:v 2M -refs 8 -me_range 64 -qcomp 0.7 -fast-pskip 0 -nr 400 -deblock 2:2 -pass 1 /dev/null ffmpeg -y -i in.mp4 -vf pp=va/ha,uspp=7,hqdn3d=4:3:4:4 -c:a aac -b:a 128k -c:v libx264 -preset veryslow -profile high -b:v 2M -refs 8 -me_range 64 -qcomp 0.7 -fast-pskip 0 -nr 400 -deblock 2:2 -pass 2 out.mp4 Could you reencode that better quality sample to include initial intro from source you provided? Btw. I hope you will update your ffmpeg W dniu 2017-03-28 o 15:57, negin tebyani pisze:
I found that source file have many compression artifacts... i put some
nasty filter and tune options a bit. Not good yet, but is a bit better?
Could you reencode that better quality sample to include initial intro from source you provided?
reencode it with my own setting?
You uploaded for comparision good quality sample, how you obtain that sample? Could you provide that sample with intro part? I asking for intro becasue intro part will show me most what quality should i strive. Did you try with noise reduction? ffmpeg -y -i in.mp4 -vf pp=va/ha,hqdn3d=4:3:4:4 -an -c:v libx264 -preset veryslow -profile high -b:v 2M -refs 8 -me_range 64 -qcomp 0.7 -fast-pskip 0 -deblock 2:2 -pass 1 /dev/null ffmpeg -y -i in.mp4 -vf pp=va/ha,hqdn3d=4:3:4:4 -c:a aac -b:a 128k -c:v libx264 -preset veryslow -profile high -b:v 2M -refs 8 -me_range 64 -qcomp 0.7 -fast-pskip 0 -deblock 2:2 -pass 2 out.mp4 W dniu 2017-03-29 o 08:26, negin tebyani pisze:
Could you reencode that better quality sample to include initial intro from source you provided?
reencode it with my own setting?
negin tebyani wrote:
Well ignoring requests for ffmpeg console output and a section of the master that the provided samples were made from means that less people will even try to help you.
I don'n know how to reach for ffmpeg output console, but here is a section of the master video:
OK, so after converting good, bad and master to ffv1 and getting them start at the same frame, testing is easy = make test encode from "new" master, then a script can almost instantly make appear 4 stacked .pngs of any frame I want. They are all crap in different ways, depending on what frame is chosen but I guess the aim it just to get a look more like the good than bad. I am using newer ffmpeg/libx264 than you, and of course this test is not perfect eg. I convert to .png (with flags) which may look better/worse than whatever player you use. Also as I cut to match frames the starting point is different - but given all that the thing that gets me closer to your good sample is simply adding -tune psnr ..... -c:v libx264 -b:v 2048k -maxrate 2048k -bufsize 5000k -tune psnr -preset veryslow ...... Maybe other options will get closer - you would really have to post a screen/player shot of what you consider "bad", one with the clock on screen so I can easily find the frame and compare.
negin tebyani wrote:
this is the source video mediainfo:
That's not ffmpeg console output, but anyway ..
Bit rate mode : Constant Bit rate : 4 000 Kbps
So it's not a much of a master but (I guess) some re-encoded web stream made from a broadcast stream, which you are encoding for a third time. Was the "good" sample coded from this? Maybe whoever made that one had a better master. In this case, I guess the original broadcast, which was likely higher and variable bitrate.
and yes, I need to use constant bitrate. do I need to use 2 pass with constant bitrate?
Probably not - others may/have given their opinion. AIUI 2 pass is better for variable bitrate when targeting some file size.
Was the "good" sample coded from this?
yes it was encoded from this video.
_______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
So you set own x264opts then you use preset slow what rewrite x264opts.. If you reencode h264 with downsacale try with minimal settings like: ffmpeg -y -i in.mp4 -vf pp=va/ha,scale=1280:720:flags=spline+full_chroma_inp+full_chroma_int+accurate_rnd+bitexact,setsar=1 -an -c:v libx264 -preset veryslow -b:v 2048k -pass 1 /dev/null ffmpeg -y -i in.mp4 -vf pp=va/ha,scale=1280:720:flags=spline+full_chroma_inp+full_chroma_int+accurate_rnd+bitexact,setsar=1 -c:a aac -b:a 128k -c:v libx264 -preset veryslow -b:v 2048k -pass 2 out.mp4 Btw. i found that sometimes better is using crf than constant bitrate (use something like -crf 22 instead with single pass) you could unsharp=7:7:0.5:7:7:0.5 before scale and if you compile ffmpeg try with -fno-fast-math W dniu 2017-03-27 o 14:21, negin tebyani pisze:
I have encoded my videos using ffmpeg and H264, and this is my ffmpeg command (2 pass encoding):
ffmpeg -y -i Edited\ Clips/arsenalVScristalPalas.mp4 -movflags faststart -c:v libx264 -x264opts 'keyint=300:min-keyint=25:8x8dct:sliced-threads=0:subq=6' -deblock 0:0 -flags +loop -preset slow -tune zerolatency -b:v 2048k -maxrate 2048k -bufsize 3000k -vf "scale=-1280:720" -pass 1 -acodec libmp3lame -b:a 128k -coder 1 -me_range 16 -sc_threshold 42 -bf 10 -qmin 0 -qmax 51 -trellis 2
I used this command but the quality is still the same. does deblock has something to do with this? the second video that I want to reach has smoother frames, mine seems to have a lot of noise. On Mon, Mar 27, 2017 at 8:22 PM, chronek <chronek@interia.eu> wrote:
So you set own x264opts then you use preset slow what rewrite x264opts..
If you reencode h264 with downsacale try with minimal settings like:
ffmpeg -y -i in.mp4 -vf pp=va/ha,scale=1280:720:flags= spline+full_chroma_inp+full_chroma_int+accurate_rnd+bitexact,setsar=1 -an -c:v libx264 -preset veryslow -b:v 2048k -pass 1 /dev/null
ffmpeg -y -i in.mp4 -vf pp=va/ha,scale=1280:720:flags= spline+full_chroma_inp+full_chroma_int+accurate_rnd+bitexact,setsar=1 -c:a aac -b:a 128k -c:v libx264 -preset veryslow -b:v 2048k -pass 2 out.mp4
Btw. i found that sometimes better is using crf than constant bitrate (use something like -crf 22 instead with single pass) you could unsharp=7:7:0.5:7:7:0.5 before scale and if you compile ffmpeg try with -fno-fast-math
W dniu 2017-03-27 o 14:21, negin tebyani pisze:
I have encoded my videos using ffmpeg and H264, and this is my ffmpeg command (2 pass encoding):
ffmpeg -y -i Edited\ Clips/arsenalVScristalPalas.mp4 -movflags faststart -c:v libx264 -x264opts 'keyint=300:min-keyint=25:8x8dct:sliced-threads=0:subq=6' -deblock 0:0 -flags +loop -preset slow -tune zerolatency -b:v 2048k -maxrate 2048k -bufsize 3000k -vf "scale=-1280:720" -pass 1 -acodec libmp3lame -b:a 128k -coder 1 -me_range 16 -sc_threshold 42 -bf 10 -qmin 0 -qmax 51 -trellis 2
_______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
participants (4)
-
Andy Furniss -
chronek -
negin tebyani -
Reindl Harald