VideoHelp Forum
+ Reply to Thread
Results 1 to 1 of 1
Thread
  1. Mr. Computer Geek dannyboy48888's Avatar
    Join Date
    May 2007
    Location
    Texas, USA
    Search Comp PM
    I'm sure from time to time we all have wondered "I bet this video would look better if only I can do more Passes." Well see's how the only info on more than 2-pass encoding results were related to CCE I decided to test this with FFMPEG. Pass 1 is a quick pass to get a idea of the bitrate. Pass 2 & 3 refines it. After this it's pretty much pointless as FFMPEG does a pretty good job with the stats it collects. Why didn't I just use the same flags for pass 1 as pass 2 and skip pass 3 all together? Well for some reason using MBD and Trellis etc in pass 1 does lower the bit rate ~5-10% , but the bitrate given causes macro-blocking in the following passes. Doing a plain run gives a good bitrate and headroom for FFMPEG to optimize the frame layout. Considering pass 1 is 4x faster (200fps vs 45fps) vs pass 2 onward in single thread mode it really doesn't add too much time. Attached is graphs, bitrate allocation, and screenshots showing the differences. Yes source is hard TFF interlaced and encoded as such. All tests done on Debian 12 with ffmpeg 5.1.3 stable. Considering its 480p video at 1650k I'd say ffmpeg overall isn't bad. It does default using linear quantization so it does saturate at relatively lower bitrates. Because of this is does act as noise filter, but looks good to me on my 55" tv at 8 ft away and the contrast not turned up to crazy levels. If you want more transparancy/grain retention you need to look at enabling non-linear quantization or moving to HCenc etc that can scale more bitrate wise. By all means feel free to give feedback. Just a normal guy trying to answer a rabbit hole I'm sure we all looked down lol. This is no way intended to be the gospel and I'm sure other sources may give different results.

    Pass 1 (get idea of ideal bitrate)

    ffmpeg -i /home/witzel/Desktop/video/Queen_Of_The_Damed-2002/Queen_Of_The_Damed-2002-avs2raw.mkv -vf setfield=tff -f dvd -muxrate 10080k -packetsize 2048 -c:v mpeg2video -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008 -aspect 16/9 -dc 10 -g 18 -bf 2 -intra_matrix 8,16,19,22,26,27,29,34,16,16,22,24,27,29,34,37,19, 22,26,27,29,34,34,38,22,22,26,27,29,34,37,40,22,26 ,27,29,32,35,40,48,26,27,29,32,35,40,48,58,26,27,2 9,34,38,46,56,69,27,29,35,38,46,56,69,83 -inter_matrix 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16 ,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,1 6,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16 -flags +ilme+ildct -alternate_scan 1 -top 1 -passlogfile /home/witzel/Desktop/video/Queen_Of_The_Damed-2002/Queen_Of_The_Damed-2002-avs2raw.mkv.passlog -threads 1 -q:v 3 -an -pass 1 /home/witzel/Desktop/video/Queen_Of_The_Damed-2002/Queen_Of_The_Damed-2002-avs2raw.mkv-pass1.m2v

    Pass 2-9 (delete prior pass before starting new one to save space)

    rm /home/witzel/Desktop/video/Queen_Of_The_Damed-2002/Queen_Of_The_Damed-2002-avs2raw.mkv-pass1.m2v
    #
    ffmpeg -i /home/witzel/Desktop/video/Queen_Of_The_Damed-2002/Queen_Of_The_Damed-2002-avs2raw.mkv -vf setfield=tff -f dvd -muxrate 10080k -packetsize 2048 -c:v mpeg2video -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008 -aspect 16/9 -dc 10 -g 18 -bf 2 -mbd rd -trellis 2 -cmp 2 -subcmp 2 -intra_matrix 8,16,19,22,26,27,29,34,16,16,22,24,27,29,34,37,19, 22,26,27,29,34,34,38,22,22,26,27,29,34,37,40,22,26 ,27,29,32,35,40,48,26,27,29,32,35,40,48,58,26,27,2 9,34,38,46,56,69,27,29,35,38,46,56,69,83 -inter_matrix 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16 ,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,1 6,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16 -flags +ilme+ildct -alternate_scan 1 -top 1 -passlogfile /home/witzel/Desktop/video/Queen_Of_The_Damed-2002/Queen_Of_The_Damed-2002-avs2raw.mkv.passlog -threads 1 -b:v 1613k -an -pass 3 /home/witzel/Desktop/video/Queen_Of_The_Damed-2002/Queen_Of_The_Damed-2002-avs2raw.mkv-pass2.m2v
    #
    rm /home/witzel/Desktop/video/Queen_Of_The_Damed-2002/Queen_Of_The_Damed-2002-avs2raw.mkv-pass2.m2v
    #
    ffmpeg -i /home/witzel/Desktop/video/Queen_Of_The_Damed-2002/Queen_Of_The_Damed-2002-avs2raw.mkv -vf setfield=tff -f dvd -muxrate 10080k -packetsize 2048 -c:v mpeg2video -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008 -aspect 16/9 -dc 10 -g 18 -bf 2 -mbd rd -trellis 2 -cmp 2 -subcmp 2 -intra_matrix 8,16,19,22,26,27,29,34,16,16,22,24,27,29,34,37,19, 22,26,27,29,34,34,38,22,22,26,27,29,34,37,40,22,26 ,27,29,32,35,40,48,26,27,29,32,35,40,48,58,26,27,2 9,34,38,46,56,69,27,29,35,38,46,56,69,83 -inter_matrix 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16 ,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,1 6,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 16,16,16,16,16,16,16,16,16,16,16,16,16,16 -flags +ilme+ildct -alternate_scan 1 -top 1 -passlogfile /home/witzel/Desktop/video/Queen_Of_The_Damed-2002/Queen_Of_The_Damed-2002-avs2raw.mkv.passlog -threads 1 -b:v 1613k -an -pass 3 /home/witzel/Desktop/video/Queen_Of_The_Damed-2002/Queen_Of_The_Damed-2002-avs2raw.mkv-pass3.m2v
    #
    rm /home/witzel/Desktop/video/Queen_Of_The_Damed-2002/Queen_Of_The_Damed-2002-avs2raw.mkv-pass3.m2v
    #(repeated until pass 9, dont put rm for last pass)
    Image Attached Thumbnails Click image for larger version

Name:	bitrateview.jpg
Views:	16
Size:	151.4 KB
ID:	74830  

    Click image for larger version

Name:	graph-2-9.jpg
Views:	16
Size:	202.2 KB
ID:	74831  

    Click image for larger version

Name:	graph-3-9.jpg
Views:	17
Size:	230.5 KB
ID:	74832  

    Click image for larger version

Name:	scene0-orig.png
Views:	11
Size:	320.2 KB
ID:	74833  

    Click image for larger version

Name:	scene0-pass2.png
Views:	11
Size:	277.2 KB
ID:	74834  

    Click image for larger version

Name:	scene0-pass3.png
Views:	12
Size:	292.7 KB
ID:	74835  

    Click image for larger version

Name:	scene0-pass9.png
Views:	11
Size:	295.2 KB
ID:	74836  

    Click image for larger version

Name:	scene1-orig.png
Views:	10
Size:	290.4 KB
ID:	74837  

    Click image for larger version

Name:	scene1-pass2.png
Views:	12
Size:	254.8 KB
ID:	74838  

    Click image for larger version

Name:	scene1-pass3.png
Views:	12
Size:	257.9 KB
ID:	74839  

    Click image for larger version

Name:	scene1-pass9.png
Views:	13
Size:	258.4 KB
ID:	74840  

    Click image for larger version

Name:	scene2-orig.png
Views:	11
Size:	300.8 KB
ID:	74841  

    Click image for larger version

Name:	scene2-pass2.png
Views:	12
Size:	276.7 KB
ID:	74842  

    Click image for larger version

Name:	scene2-pass3.png
Views:	12
Size:	298.2 KB
ID:	74843  

    Click image for larger version

Name:	scene2-pass9.png
Views:	11
Size:	296.8 KB
ID:	74844  

    Click image for larger version

Name:	scene3-orig.png
Views:	9
Size:	257.4 KB
ID:	74845  

    Click image for larger version

Name:	scene3-pass2.png
Views:	10
Size:	197.2 KB
ID:	74846  

    Click image for larger version

Name:	scene3-pass3.png
Views:	9
Size:	197.4 KB
ID:	74847  

    Click image for larger version

Name:	scene3-pass9.png
Views:	12
Size:	198.4 KB
ID:	74848  

    if all else fails read the manual
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!