Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
10th January 2014, 13:12 | #2401 | Link |
...?
Join Date: Nov 2005
Location: Florida
Posts: 1,445
|
As a note, I believe that the Blu-ray specs allow for 23.976 in all regions. For that matter, I think the same is also true of 25, but I'm not as sure on that (and I have no discs that it might occur on to verify it, either).
Personally, in that situation, I'd override it and make it convert to PAL. Less of a framerate difference and such, and no quibbling over whether you have to account for a denominator of 1001 or 1000 when trying to do a chapter conversion (also, '30fps' is often used as a shorthand for anything with a numerator of 30000, just like '24fps' is sometimes for 24000 numerators - because 30000/1000 isn't compliant with the DVD spec, the shorthand is probably what you're seeing there). Last edited by qyot27; 10th January 2014 at 13:17. |
16th January 2014, 20:39 | #2402 | Link | ||
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,101
|
ffmpeg vbr encodes in AVStoDVD
Here's a somewhat delayed Xmas present for Fishman0919...
I made a small wrapper for ffmpeg.exe which enables 1-pass and also 2-pass VBR encodes using ffmpeg. The 2-pass command line is taken from this post: http://forum.doom9.org/showthread.ph...80#post1651880 Here is the readme: Quote:
I have tested it quite a bit with ffmpeg version 2.1.1, on my Windows XP machine it is very stable. I do not know however if renaming ffmpeg.exe in a folder under "program files" will work under Win7 or Win8. If it doesn't, you probably know the usual workarounds (Take Ownership or install AVStoDVD outside of program files). The script itself only writes into the specified output folder which should not be a problem. The provided "ffmpeg.exe.vbr" is just a compiled batch file which only calls ff_vbr.bat. Not too elegant, but "ffmpeg.exe" is hard coded into the AVStoDVD executable, and I really did not want to patch the executable. There are a couple of things I noticed while I made this thing, maybe one of you guys has some answers: I noticed that AVStoDVD sets a buffer size of 2000k by default. According to the DVD specs this is a little high, it should be 1835k according to Hank315. Is there a special reason for this? In 2-pass mode using Fishmans parameters, ffmpeg issues a warning: Quote:
When I was comparing 1-pass VBR mode to good old QuEnc I noticed that ffmpeg has a tendency to undersize quite a bit, sometimes by almost 20%. This was for an already low bitrate of 3900k. While QuEnc 1-pass and HCenc 1-pass both had no problems, ffmpeg only reached a bitrate of a little over 3000k. I then tried to specify a minimum quantizer of 1, but it did not help very much. Are there any parameters I can use to avoid this undersizing without compromising speed? Whatever, please test my little tool and let me know what should be improved.... Cheers manolito Last edited by manolito; 18th January 2014 at 16:51. |
||
17th January 2014, 02:03 | #2403 | Link | |||||
FishmanMod Android Dev
Join Date: Apr 2004
Location: Somewhere else, maybe Arizona Bay
Posts: 1,143
|
Thank you kind sir.... I'll give this a try tonight
Quote:
Quote:
Let ffmpeg go down to 0.01 quantizer Quote:
EDIT: Quote:
Quote:
__________________
"Cinderella story, out of nowhere, former greenskeeper, now about to become the Masters champion. It looks like a mirac- it's in the hole!" Last edited by Fishman0919; 17th January 2014 at 06:19. |
|||||
17th January 2014, 10:55 | #2404 | Link |
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,101
|
Thanks Fishman for the tips, time for some more testing...
Here: http://i43.tinypic.com/24v7l1v.jpg The hq variable is initialized to 0 first, then if the "-trellis" parameter is detected in the commandline issued by AVStoDVD it is changed to 1. Code:
IF %1==-trellis SET hq=1 ..... IF %bitrate% LSS 3500 IF %hq%==1 GOTO 2pass IF !%hq%==!1 Cheers manolito Last edited by manolito; 17th January 2014 at 13:00. |
17th January 2014, 14:21 | #2405 | Link |
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,101
|
Yes, the -lmin and -mblmin parameters really did the trick. No more undersizing in 1-pass VBR mode.
The ffmpeg defaults for both values are 236, so I figured that 0.01 or 1 could be a little agressive. So I did some tests with a 5min chunk of a critical source. I set the bitrate to 4000k, and without the -lmin and -mblmin parameters the encode came out at 2898k. With values of 0.01 and 1 I did get 4000k, but in darker scenes the bitrate was much higher than with HCenc 1-pass. After playing around a little bit I found that the sweet spot for both -lmin and -mblmin values lies at 170 for me. I already modified the batch file and uploaded it, this is the link: //EDIT// Link removed Cheers manolito Last edited by manolito; 18th January 2014 at 16:50. |
18th January 2014, 05:58 | #2406 | Link | ||
FishmanMod Android Dev
Join Date: Apr 2004
Location: Somewhere else, maybe Arizona Bay
Posts: 1,143
|
Quote:
Sweet spot 170?... 1.70, .170 EDIT: Quote:
The bitrate is probably higher then HC in darker scenes because ffmpeg uses the Mpeg Standard maxtic by default and isn't using AQM... trying to retain more detail. In my testing I found that FFMpeg is OK at best in 1 pass encoding.... unless you turn all the setting to the max and bring the encoding to a crawl. With AVStoDVD v2.7.2... I get no option... http://i467.photobucket.com/albums/r...ps3e58bb85.jpg
__________________
"Cinderella story, out of nowhere, former greenskeeper, now about to become the Masters champion. It looks like a mirac- it's in the hole!" Last edited by Fishman0919; 18th January 2014 at 07:13. |
||
18th January 2014, 09:04 | #2407 | Link | |||
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,101
|
Quote:
Hi Fishman, from the ffmpeg 2.2.1 help: Quote:
BTW what the hell is the "Lagrange Factor"? I thought that I already knew a little bit about MPEG2 encoding, but obviously I was wrong. Quote:
You are looking at the wrong place... This option is not under "Preferences", it is under "View/Edit Title Settings" for each loaded source file. Cheers manolito |
|||
18th January 2014, 13:58 | #2408 | Link | ||
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,101
|
Quote:
OK, I think I found the explanation for these odd values. Quote:
Here is a small conversion table: Code:
Q Lambda _________________________________________________ Default 2 236 lmin 0.01 1.18 mblmin 1 118 My sweet spot 1.44 170 Cheers manolito |
||
18th January 2014, 16:49 | #2409 | Link |
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,101
|
Alright, another (and hopefully final) version of my tool...
//EDIT// Link removed For the quick 1-pass VBR mode I changed -lmin to 175 and left -mblmin at its default value of 236. Works well on my test files. I also took the liberty to convert the 2-pass parameters from the old q units to lambda units. Now it looks like: -lmin 1.18 -mblmin 118 Cheers manolito Last edited by manolito; 20th January 2014 at 14:10. |
18th January 2014, 21:25 | #2410 | Link | |
FishmanMod Android Dev
Join Date: Apr 2004
Location: Somewhere else, maybe Arizona Bay
Posts: 1,143
|
Quote:
LINK EDIT: A few test runs and all seems to be working fine... thank you for your work
__________________
"Cinderella story, out of nowhere, former greenskeeper, now about to become the Masters champion. It looks like a mirac- it's in the hole!" Last edited by Fishman0919; 19th January 2014 at 03:57. |
|
19th January 2014, 07:20 | #2411 | Link |
FishmanMod Android Dev
Join Date: Apr 2004
Location: Somewhere else, maybe Arizona Bay
Posts: 1,143
|
I did a couple of tests on 2 pass encodings with -lmin 1.18 -mblmin 118
The Hobbit: An Unexpected Journey (BluRay) ffmpeg -lmin 1.18 -mblmin 118 - 4.24g ffmpeg -lmin 0.01 -mblmin 1 - 4.33g HC - 4.32g Saving Private Ryan (BluRay) ffmpeg -lmin 1.18 -mblmin 118 - 4.26g ffmpeg -lmin 0.01 -mblmin 1 - 4.32g HC - 4.32g -lmin 1.18 -mblmin 118 seems to have a hard time with dark movies... I'll play with the setting to find a point where it works for 2 pass encodings. I also added the Standard Matrix to the command line... works better with encodings below 3500k. Will do some testing to see if QuEnc's QLB matrix will work better. Mpeg Standard Matrix (Default) Code:
-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,29,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,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" Code:
-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,29,34,38,46,56,69,27,29,35,38,46,56,69,83" -inter_matrix "16,17,18,19,20,21,22,23,17,18,19,20,21,22,23,24,18,19,20,21,22,23,24,25,19,20,21,22,23,24,26,27,20,21,22,23,25,26,27,28,21,22,23,24,26,27,28,30,22,23,24,26,27,28,30,31,23,24,25,27,28,30,31,33" Code:
-intra_matrix "8,16,19,22,26,27,29,34,16,16,22,24,27,29,34,37,19,22,26,27,29,34,37,39,22,22,26,27,29,34,38,42,22,26,27,29,32,36,40,50,26,27,29,32,36,40,50,61,26,27,29,35,40,50,59,75,27,29,35,40,50,59,75,89" -inter_matrix "16,17,18,19,20,21,22,23,17,18,19,20,21,22,23,25,18,19,20,21,22,23,24,26,19,20,21,22,23,24,26,28,20,21,22,23,25,26,28,29,21,22,23,24,26,28,29,31,22,23,24,26,28,29,31,34,23,24,25,28,29,31,34,38"
__________________
"Cinderella story, out of nowhere, former greenskeeper, now about to become the Masters champion. It looks like a mirac- it's in the hole!" Last edited by Fishman0919; 19th January 2014 at 07:25. |
19th January 2014, 10:47 | #2412 | Link |
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,101
|
Thanks Fishman for your tests. The reason I modified your original values was that I thought you had used them assuming they were "q" units.
For lower bitrate encodes I am a big fan of the MANONO matrices. Maybe you can include them in your tests. Manono1 Code:
-intra_matrix "8,8,8,9,11,13,14,17,8,8,9,11,13,13,14,17,8,8,11,12,13,14,17,94,9,11,13,13,14,17,17,94,11,11,13,13,14,17,94,94,13,13,14,16,17,20,94,94,13,13,14,17,94,94,94,94,13,14,17,94,94,94,94,94" -inter_matrix "12,12,13,14,15,16,22,26,12,13,14,15,16,22,26,32,13,14,15,16,22,26,32,41,14,15,16,22,26,32,41,53,15,16,22,26,32,41,53,94,16,22,26,32,41,53,70,94,22,26,32,41,53,70,94,94,26,32,41,53,94,94,94,94" Manono2 Code:
-intra_matrix "8,12,13,14,15,16,19,22,12,13,14,15,16,19,22,26,13,14,15,16,19,22,26,32,14,15,16,19,22,26,32,41,15,16,19,22,26,32,41,53,16,19,22,26,32,41,53,70,19,22,26,32,41,53,70,94,22,26,32,41,53,70,94,127" -inter_matrix "12,12,13,14,15,16,19,22,12,13,14,15,16,19,22,26,13,14,15,16,19,22,26,32,14,15,16,19,22,26,32,41,15,16,19,22,26,32,41,53,16,19,22,26,32,41,53,70,19,22,26,32,41,53,70,94,22,26,32,41,53,70,94,127" I will leave the testing of the 2-pass parameters to you, because I have a hard time making out small differences on my old CRT tv set. Looking forward to your results... Cheers manolito Last edited by manolito; 19th January 2014 at 11:00. |
19th January 2014, 15:42 | #2413 | Link |
AVStoDVD Dev
Join Date: Apr 2006
Location: Italy
Posts: 1,302
|
manolito, Fishman0919, what about adding the 'ffmpeg_vbr.zip' package to the AddOns stuff on SourceForge? Just tell me when you are confident and satisfy enough. Of course it would be better to have the option available directly in AVStoDVD. Another item in the ToDo list.
Meanwhile 2.7.3 release is finally out. Change log: - Some bugs fixed - Added 'Preferred DirectShow Codecs Setup' section - Added SetACL 2.0.3.0 (LGPL by Helge Klein) to AVStoDVD package - Improved framerate conversion section of AviSynth script generation routine - Updated A2DSource.avsi to properly handle non-mod4 width sources (thanks to manolito) - FFmpeg updated to 2.1 (git-9244a68) Bye |
20th January 2014, 04:28 | #2415 | Link | |
FishmanMod Android Dev
Join Date: Apr 2004
Location: Somewhere else, maybe Arizona Bay
Posts: 1,143
|
Quote:
I did a few more test and found that -lmin 0.75 -mblmin 50 seem to work very well on my test movies... bitrates hitting the target. Dark scene still look good without bitrates peaking to high. I also noticed that moving grass and still walls look better... -lmin 1.18 -mblmin 118 may have looked somewhat better on these but seemed to fail in the dark areas. I'm running a couple more movies right now but -lmin 0.75 -mblmin 50 seems pretty good for 2 pass encodings.
__________________
"Cinderella story, out of nowhere, former greenskeeper, now about to become the Masters champion. It looks like a mirac- it's in the hole!" |
|
20th January 2014, 08:41 | #2416 | Link |
FishmanMod Android Dev
Join Date: Apr 2004
Location: Somewhere else, maybe Arizona Bay
Posts: 1,143
|
I think the settings for FFMpeg are are pretty good now for 2 pass encoding. Quality is good, speed is good and it's hitting the target bitrate for bright and dark movies.
I stayed with the Standard Matrix because of compatibility with some DVD players and it just seemed to work well with FFMpeg below 3500k. I think I dialed in the setting pretty good on my test with "Man of Steel" BluRay encoded at 3200k. A bitrate view of HC026_beta_16-06-2011, CCE-Basic 2.70 01.16 and ffmpeg-2.1.1 http://i467.photobucket.com/albums/r...psc1a7dd22.jpg Here are my 2 pass settings... Code:
@ECHO on _ffmpeg.exe -i %in% -aspect %aspect% -dc %dc% -g 12 -maxrate 7500k -q:v 2 -b_strategy 2 -brd_scale 2 -bf 2 -profile:v 4 -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,29,34,38,46,56,69,27,29,35,38,46,56,69,83" -inter_matrix "16,17,18,19,20,21,22,23,17,18,19,20,21,22,23,24,18,19,20,21,22,23,24,25,19,20,21,22,23,24,26,27,20,21,22,23,25,26,27,28,21,22,23,24,26,27,28,30,22,23,24,26,27,28,30,31,23,24,25,27,28,30,31,33" -pass 1 -passlogfile "%out_path%ffmpeg" -an -f mpeg2video %il% "%out_name%_pass1.m2v" _ffmpeg.exe -i %in% -aspect %aspect% -dc %dc% -g 12 -lmin 0.75 -mblmin 50 -qmin 1 -qmax 31 -maxrate 7500k -b:v %bitrate%k -bf 2 -pre_dia_size 5 -dia_size 5 -qcomp 0.7 -qblur 0 -preme 2 -me_method dia -sc_threshold 0 -sc_factor 4 -bidir_refine 4 -profile:v 4 -mbd rd -mbcmp satd -precmp satd -cmp satd -subcmp satd -skipcmp satd -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,29,34,38,46,56,69,27,29,35,38,46,56,69,83" -inter_matrix "16,17,18,19,20,21,22,23,17,18,19,20,21,22,23,24,18,19,20,21,22,23,24,25,19,20,21,22,23,24,26,27,20,21,22,23,25,26,27,28,21,22,23,24,26,27,28,30,22,23,24,26,27,28,30,31,23,24,25,27,28,30,31,33" -pass 2 -passlogfile "%out_path%ffmpeg" -an -f mpeg2video %il% %out%
__________________
"Cinderella story, out of nowhere, former greenskeeper, now about to become the Masters champion. It looks like a mirac- it's in the hole!" Last edited by Fishman0919; 20th January 2014 at 08:54. |
20th January 2014, 11:31 | #2417 | Link | |
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,101
|
Thanks a lot Fishman. Those bitrate views look excellent to me. I think that I will also add the standard matrix to the 1-pass VBR mode. AFAIK the MPEG Standard matrix with all non-intra coefficients set to 16 was never a good choice for DVD encodes, at least this is what I read about all the common MPEG2 encoders.
Maybe even the high bitrate CBR mode would profit from using the standard matrix. I will add it in my next upload. Quote:
It looks like Fishman has finalized the 2-pass parameters, so this part is probably final. I will add the standard matrix to the 1-pass VBR mode, and maybe the standard matrix is also a better choice for the CBR mode. I will need your advice on this. Finally I probably should polish the documentation a little bit and convert it to PDF. Also did you notice my question about the buffer size of 2000k in CBR mode? Any special reason for this slightly higher size? And of course thanks for the new version, I will install it right away and run a few tests. Also letting you know that I have been using LAV filters (0.60 and 0.60.1) for some time now without any issues. I cannot test the correct channel assignment though, the LAV mixer is disabled by default, and I kept it that way. Cheers manolito |
|
20th January 2014, 14:09 | #2418 | Link |
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,101
|
Here we go...
//EDIT// Link removed I added Fishman's new parameters to the 2-pass section, 1-pass VBR also uses the standard matrix, and for the default 1-pass CBR mode I also added the standard matrix, but left it deactivated for now. If you want to try the standard matrix in 1-pass CBR mode, open the batch file with an editor, go to the label ":dont_touch" and delete the "REM" in front of the corresponding line. Save the file and have fun... Cheers manolito Last edited by manolito; 22nd January 2014 at 17:02. |
21st January 2014, 04:33 | #2419 | Link | |
FishmanMod Android Dev
Join Date: Apr 2004
Location: Somewhere else, maybe Arizona Bay
Posts: 1,143
|
Quote:
__________________
"Cinderella story, out of nowhere, former greenskeeper, now about to become the Masters champion. It looks like a mirac- it's in the hole!" |
|
22nd January 2014, 12:58 | #2420 | Link |
Registered User
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,101
|
New findings:
It seems that the error when using DGindex was not my fault. The hidden ffmpeg call for NUL output has these parameters: Code:
-i "I:\AVSInfo.avs" -f rawvideo -y NUL Next I removed my VBR tool completely and tried to use DGindex on a 10 minutes long MPEG2 file, and again I got the timeout error. Conclusion: Even if my computer is old and slow, this timeout error should not happen. Using ffmpeg for NUL encoding seems to be VERY much slower than the former AVS2AVI method. Using DGindex is completely impossible on my computer. Either the timeout must be removed, or something other than ffmpeg should be used for this (AVSmeter?). So I will leave my VBR tool as it is for the moment, just keep in mind to avoid using DGindex. Cheers manolito Last edited by manolito; 27th January 2014 at 14:54. |
Thread Tools | Search this Thread |
Display Modes | |
|
|