Log in

View Full Version : Resizing video without avs script


PiPPoNe92
18th August 2009, 18:31
Hello, I'm a DVD ripper. I like compress video. So I use x264.exe because it's the best! My problem is this:
I'd resizing video from 1024x576 to 624x352. It's the code:

PASS 1
"x264.exe" --pass 1 --bitrate 430 --stats "C:\Documents and Settings\Corcelli\Desktop\temp\.stats" --tune film --profile baseline --psy-rd 2 --no-fast-pskip --ref 3 --bframes 16 --subme 2 --direct auto --b-adapt 2 --threads 5 --trellis 2 --weightb --analyse none --mixed-refs --merange 64 --ssim --visualize --psnr --deblock -1:-1 --psy-rd 1.0:0.15 --output NUL "C:\Documents and Settings\Corcelli\Desktop\temp\Nuova cartella\VTS_01_1_Source.avs" "XXX.VOB"


PASS 2
"x264.exe" --pass 2 --bitrate 410 --stats "C:\Documents and Settings\Corcelli\Desktop\temp\.stats" --b-pyramid --tune film --profile baseline --psy-rd 2 --no-fast-pskip --bframes 16 --mixed-refs --trellis 2 --ref 16 --subme 10 --direct auto --merange 64 --analyse all --weightb --b-adapt 2 --partitions all --threads 5 --ssim --visualize --psnr --deblock -1:-1 --psy-rd 1.0:0.15 --output "C:\Documents and Settings\Corcelli\Desktop\temp\movie.264" "C:\Documents and Settings\Corcelli\Desktop\temp\Nuova cartella\VTS_01_1_Source.avs" "XXX.VOB"

THE AVS CODE IS:
MPEG2Source("C:\Documents and Settings\Corcelli\Desktop\temp\movie.d2v")
Spline36Resize(624,352)
#filter2start

Then, I wouldn't use a avs script for resizing video so the encode video is faster. In fact resizing avs is slow.
It's possible resizing video without avs script? Thanks for answers :):)

roozhou
18th August 2009, 18:50
Use ffdshow

poisondeathray
18th August 2009, 18:56
Another option is to use a different resizer. spline36 is significantly slower than lanczos for example

PiPPoNe92
18th August 2009, 18:59
no, I wouldn't use ffdshow because x264 is costantly updating..and I'd last version.

nm
18th August 2009, 19:05
I wouldn't use a avs script for resizing video so the encode video is faster. In fact resizing avs is slow.
How did you come to this conclusion? It should be pretty fast compared to your second pass x264 settings.

Do you actually need a specific bitrate? Why not use a single CRF pass and avoid half of that slow AviSynth processing?

nurbs
18th August 2009, 19:07
You guys should take a look at his encoding settings. I don't see how resizing can be the problem speedwise when you are using 16 refs, 16 b-frames with b-adapt 2, trellis 2, subme 10 and a merange of 64.

By the way the command line doesn't make much sense to me.
1) --analyse all is the same as --partitions all
2) --profile baseline doesn't allow b-frames (right?)
3) --tune film is the same as --deblock -1:-1 --psy-rd 1.0:0.15
Furthermore I think --merange is clipped to 32 if you use --me hex, the usefulness of 16 b-frames and reference frames in comparison to the speed loss is debatable and there is a --psy-rd 2 in the command lines for apparently no reason at all (it overrides the film tuning, but is in turn overridden by --psy-rd command that uses the same values as the film tuning).
Also --b-pyramid currently doesn't work with mb-tree and I'm pretty sure you'd have to use it in the first pass as well if id did work.

By the way you should also take a look at the forum rules. One of them states that there is no best.

PiPPoNe92
18th August 2009, 19:11
than, can you post here the best code (maximum quality) of x264 for ripping film? thanks

nm
18th August 2009, 19:15
By the way you should also take a look at the forum rules. One of them states that there is no best.
than, can you post here the best code (maximum quality) of x264 for ripping film? thanks
Eh :)

What is your target device and/or H.264 level?

nurbs
18th August 2009, 19:15
"x264.exe" --pass 1 --bitrate 430 --stats "C:\Documents and Settings\Corcelli\Desktop\temp\.stats" --tune film --threads 5 --preset placebo --slow-firstpass --output NUL "C:\Documents and Settings\Corcelli\Desktop\temp\Nuova cartella\VTS_01_1_Source.avs" "XXX.VOB"
"x264.exe" --pass 2 --bitrate 430 --stats "C:\Documents and Settings\Corcelli\Desktop\temp\.stats" --tune film --threads 5 --preset placebo --slow-firstpass --output NUL "C:\Documents and Settings\Corcelli\Desktop\temp\Nuova cartella\VTS_01_1_Source.avs" "XXX.VOB"
I left the --threads 5 in because maybe you have a good reason to manually specify threads.
Note that this will be even slower than your current settings.

edit:
Does --profile baseline actually force baseline profile? In that case he would lose b-frames, CABAC, Trellis and Subme 10.
Also maybe --tune grain would give better quality if there is a lot of grain you want to keep. Anyway I wouldn't consider the settings usable.

PiPPoNe92
18th August 2009, 19:16
i think 4

PiPPoNe92
18th August 2009, 19:17
nurbs, subme only 7 (default)?? not 10?

PiPPoNe92
18th August 2009, 19:21
with placebo option takes 5 hours :eek: !!!!

wyti
18th August 2009, 19:23
--preset placebo automatically set subme to 10 with a lot of others insane options (trellis 2, b-adapt 2, --me tesa...)
There are what you can call the best options compresion wise, but maybe (or almost surely) aren't the best settings for you. If you're complaining about speed lost by a resizer, i don't think you will like the uge speed lost made by using thoses settings.

IT's up to you, but i'll recommend you tu use the --preset settings instead of modifing options one by one if you don't knw what you are doing.

Chengbin
18th August 2009, 19:23
than, can you post here the best code (maximum quality) of x264 for ripping film? thanks

Please read the forum rules. Asking for the "best" is against the rules.


Does --profile baseline actually force baseline profile?

Yes.

PiPPoNe92
18th August 2009, 19:27
I set veryslow, can you say me options which are activated with veryslow option?

nurbs
18th August 2009, 19:28
@PiPPoNe92:
Look here: http://forum.doom9.org/showthread.php?t=148149
Couple of things are missing, you should also look at the x264 changelog.

Thanks for the info, Chengbin.

wyti
18th August 2009, 19:38
very slow isn't in this post. It may be usefull to edit it up to date.

very slow is this ;
--me umh --subme 10 --merange 24 --ref 16 --b-adapt 2 --direct auto --trellis 2 --bframe 8 --rc-lookahead 80

roozhou
18th August 2009, 19:52
no, I wouldn't use ffdshow because x264 is costantly updating..and I'd last version.

I told you to use ffdshow's resizer but not ffdshow's crappy vfw encoder.

PiPPoNe92
18th August 2009, 19:52
my avs is:

MPEG2Source("C:\Documents and Settings\Corcelli\Desktop\temp\movie.d2v")
Spline36Resize(624,352)
#filter2start

Do you have a good avs with filter which improve quality for x264?

@roozhou
I told you to use ffdshow's resizer but not ffdshow's crappy vfw encoder.

how can I do?

roozhou
18th August 2009, 20:00
1) Load your vob with directshowsource and enable ffdshow's mpeg2 decoder.
2) Launch ffdshow video decoder configuration
3) Check "Resize & Aspect" and set your target size in "new size". You can also change resizer in "resize setting" tab.

nurbs
18th August 2009, 20:06
I seriously doubt that the encodes are slow because of the resizing. The encodes are slow because of the slow x264 encoding settings.

edit:
Another thing. Since he manually sets the number of threads, does he also have to set --thread-input manually? That could also cause some slowdown (although not as bad as the x264 settings).

nm
18th August 2009, 20:33
Another thing. Since he manually sets the number of threads, does he also have to set --thread-input manually? That could also cause some slowdown (although not as bad as the x264 settings).
No, threaded input is enabled automatically when the number of threads is set to 0 (auto) or more than 1.

PiPPoNe92
18th August 2009, 22:42
are there avs filters to improve video quality?

Guest
18th August 2009, 23:25
You're going OT in your own thread!

Start a new thread for a new topic. Better yet, in this case, use the available resources to learn about AVS filters.

Audionut
18th August 2009, 23:54
I set veryslow, can you say me options which are activated with veryslow option?

http://mewiki.project357.com/wiki/X264_Settings

Forteen88
19th August 2009, 08:57
PASS 1
"x264.exe" --pass 1 --bitrate 430 --stats "C:\Documents and Settings\Corcelli\Desktop\temp\.stats" --tune film --profile baseline --psy-rd 2 --no-fast-pskip --ref 3 --bframes 16 --subme 2 --direct auto --b-adapt 2 --threads 5 --trellis 2 --weightb --analyse none --mixed-refs --merange 64 --ssim --visualize --psnr --deblock -1:-1 --psy-rd 1.0:0.15 --output NUL "C:\Documents and Settings\Corcelli\Desktop\temp\Nuova cartella\VTS_01_1_Source.avs" "XXX.VOB"Two psy-rd in pass 1..

PiPPoNe92
19th August 2009, 15:21
thanks for answers..
After your recommendations I have made these codes:

"x264.exe" --pass 1 --bitrate 410 --stats ".stats" --tune film --cqmfile "M4G_High_Detail_V3.1.cfg" --profile high --preset slower --level 1.3 --psy-rd 2 --me hex --no-fast-pskip --ref 3 --subme 2 --direct auto --b-adapt 2 --threads auto --trellis 2 --weightb --analyse none --mixed-refs --merange 32 --output NUL "VTS_01_1_Source.avs" "XXX.VOB"
pause

(time encoding 30 min)

"x264.exe" --pass 2 --bitrate 410 --stats ".stats" --tune film --cqmfile "M4G_High_Detail_V3.1.cfg" --me hex --profile high --preset slower --level 1.3 --psy-rd 2 --no-fast-pskip --mixed-refs --trellis 2 --ref 8 --subme 10 --direct auto --merange 64 --analyse all --weightb --b-adapt 2 --threads auto --output "movie.264" "VTS_01_1_Source.avs" "XXX.VOB"
pause

(time encoding 100 min)

TOTAL TIME ENCODING IS 130 MIN.

Are right the codes?

nurbs
19th August 2009, 17:40
No, they aren't.

I won't go into detail on first pass, but AFAIK most of the options you set won't be used because you neglected to set --slow-firstpass. Even if they were used they don't make sense to me (--psy-rd in first pass; --psy-rd 2 in general; --subme 2 and --trellis 2; ect.)

Second pass is filled with redundancy.
--preset slower sets --me umh, --ref 8, --b-adapt 2, --direct auto, --partitions all, --trellis 2 among others, so setting them manually isn't needed.
You override --me umh with --me hex and then set --merange 64, but --me hex has a maximum range of 16 (the default) so that doesn't do anything.
You set --psy-rd 2 which generally isn't a good idea, especially since that also sets psy trellis to 2 which is way to high.
--weightb, --mixed-refs and --threads auto are on by default, so this is also not needed.
You set --level 1.3 but --ref 8 so unless your video resolution is smaller than 320*240 you will break the level limit. Also you don't set VBV so you don't know if the bitrate will stay within the level limits anyway.
You also use a CQM file which you shouldn't do unless you really know what you're doing and from everything else I'm pretty sure that you don't.

kemuri-_9
19th August 2009, 17:46
all of that was correct from a quick look over except

You set --psy-rd 2 which generally isn't a good idea, especially since that also sets psy trellis to 2 which is way to high.

--psy-rd x is equivalent to --psy-rd x:0, not --psy-rd x:x

nurbs
19th August 2009, 17:57
Was that changed? I could swear that it used the first value for both parameters if nothing was explicitly set for the second one, at least before the psy stuff was committed. Then again I'm to lazy to look at the source code to make sure.

@PiPPoNe92:
You should really take a look at the link Audionut gave in post #25. It explains a lot.

kemuri-_9
19th August 2009, 18:04
Was that changed? I could swear that it used the first value for both parameters if nothing was explicitly set for the second one, at least before the psy stuff was committed. Then again I'm to lazy to look at the source code to make sure.

the patch exhibited that --psy-rd x equated to --psy-rd x:x,
when it was commited, it changed to become --psy-rd x:0 instead

nurbs
19th August 2009, 18:07
I see. :thanks:

PiPPoNe92
19th August 2009, 19:23
"x264.exe" --pass 2 --bitrate 410 --stats ".stats" --tune film --cqmfile "M4G LRM V4.cfg" --me umh --profile high --preset slower --level 2.2 --no-fast-pskip --mixed-refs --trellis 2 --ref 8 --subme 10 --direct auto --merange 64 --analyse all --weightb --b-adapt 2 --threads auto --output "movie.264" "VTS_01_1_Source.avs" "XXX.VOB"
pause

ok, done. Time encoding (only 2nd pass) is 160 min :eek: but quality is........SUPER EXCELLENT!!! (102 min of movie in only 350 mb with audio!!!) :D

P.S. i have a quadcore intel 2,5 ghz

ajp_anton
19th August 2009, 19:58
What do you need "--merange 64" for? L2.2 and bitrate 410 can't be very high resolution (forgot if you mentioned a resolution earlier), so "--merange" 24 is probably more than good enough.

Why use "--preset slower" if you're going to set all the settings manually anyway? Or why write all the settings when you're already using a preset?

Leeloo Minaļ
19th August 2009, 20:21
Clearly, PiPPoNe92, if you don't understand all the settings, take only presets !

Your command is almost equivalent to the preset "veryslow", so make it far simpler :

"x264.exe" --pass 2 --bitrate 410 --stats ".stats" --tune film --cqmfile "M4G LRM V4.cfg" --profile high --preset veryslow --threads auto --output "movie.264" "VTS_01_1_Source.avs" "XXX.VOB"

I don't know what --cqmfile is intended for, so i will not say about it.

wyti
19th August 2009, 20:48
thread auto is on by default now.

And cqmfile can help ONLY if you really know what you are doing (those 2 words are very importants)
Using a cqm with --tune film almost always produce worse results than no cqm at all, so i would sugest you not using cqmfile if you don't have tested both without and with and you really see a gain (note also that even if you have gain on some source, it may not be the same for every source)

Same for level !!!
you keep changing your level :eek:
level and profile are here to ensure a compatibility with external device (hardware player, mp3 player, blueray player...) if you don't need to be able to playback your video elsewhere than your PC you don't need level, and if you need to respect a specific level it can't be changed when we say something about it, we don't write the specs of your device :p. and if you don't know what level to use, give us a link to the player you want your encode to be playable on, and maybe we can help you setting the right level / profile / vbv,

So i sugest you tu use a very simpler command line like

"x264.exe" --pass 1 --bitrate 410 --stats ".stats" --tune film --preset veryslow --output "movie.264" "VTS_01_1_Source.avs" "XXX.VOB"
"x264.exe" --pass 2 --bitrate 410 --stats ".stats" --tune film --preset veryslow --output "movie.264" "VTS_01_1_Source.avs" "XXX.VOB"
and only add level / profile when you KNOW what you will need.
if speed dont suit your needs change only preset !
others options are here to users that like more tweaking in their settings, but using hand written isn't better at all (even worse) if you don't know what you do, so don't use them, you will have a really better result when not using them.

using hand written settings don't make you good, it only destroy your quality / speed...

Guest
19th August 2009, 21:34
It's possible resizing video without avs script? My NV tools can do that now by doing the resizing on the GPU.

popper
19th August 2009, 22:31
Hello, I'm a DVD ripper. I like compress video. So I use x264.exe because it's the best! My problem is this:
I'd resizing video from 1024x576 to 624x352. It's the code:

PASS 1



PASS 2


THE AVS CODE IS:


Then, I wouldn't use a avs script for resizing video so the encode video is faster. In fact resizing avs is slow.
It's possible resizing video without avs script? Thanks for answers :):)

you have been shown how to resize with ffdshow's resizer as per this thread, now all you need do is read this thread
http://www.avsforum.com/avs-vb/showthread.php?t=972503
x264 Encoding Options for Hardware Compatibility & DXVA

and stop using ref frames greater than required, just because you can use higher values in the encoder
does not mean that you should.

ref=3 is fine for generic real life film and Tv content

H@L3.1 and H@L4.1 with ref=3 IS the recomended base for generic HW playback of SD/HD,
using higher settings just because their there gets you nothing but pain in the long term.

infact you should really just give Valnar's settings a go and compare to your so called highest quality your seeing from your DVD rips above, theres NO point in tweaking your setting when you havent even tryed a generic base case

--pass 1 --crf 22 (26 through 21) --ref 3 --level 3.1 (or 4.1) --bframes 3 and now --mbtree for your 624x352

and see for yourself that these provide you near as good as your old DVD masters will allow, for a lot less wasted time..

at least thats my opinion , and if you intend playback/Streaming on a mass of Hardware, then you really DO need to have a --level included in the line with UPTO the max bitrate your encode uses, if you only need upto level3.1 settings theres No need what so ever to use and set Level4.1 there and Never use Levels above that unless you have a very good reason to (2k/4k master achiveing etc), not just because you Can.

using higher is a waste and pritty much garantees it (H@L4.1 720p/1080p) wont play on anything but your PC at some point no matter what container you use.

use at the most --pass 1 --crf 22 (26 through 21) --ref 3 --level 3.1 (or 4.1) --bframes 3 and now --mbtree is generally ALL you as an end user need to use.

anything more given the masters you have access to just slows you down only needing to change the bitrate as you go to lower as you want to do (624x352) or higher, and only then, if --crf cant find the right ballance for the given dvd masters quality.


as ExDeus said back then, before the --mbtree , and 2 days ago the 'Lookahead VBV' arrived http://forum.doom9.org/showthread.php?t=148964 so even lower Max settings could be used now.
"
x264 Encoding Options for Hardware Compatibility & DXVA
The Bottom Line
Everybody should be encoding HD content (1080p, 720p) to Profile High @ Level 4.1. For smooth playback, "--level 4.1" should be used to mark the file as compatible when encoding. The best MeGUI profile for x264 is the DXVA-HD-HQ profile.

Everybody should be encoding SD content (576p, 480p, or less) to Profile High @ Level 3.1 For smooth playback, "--level 3.1" should be used to mark the file as compatible when encoding. The best MeGUI profile for x264 is the DXVA-SD-HQ profile."

PiPPoNe92
19th August 2009, 23:07
it's right??

PASS 1
"x264.exe" --pass 1 --bitrate 420 --stats ".stats" --tune film --mbtree --cqmfile "M4G LRM V4.cfg" --preset veryslow --output NUL "VTS_01_1_Source.avs" "XXX.VOB"
pause

time encoding 70 min

PASS 2
"x264.exe" --pass 2 --bitrate 420 --stats ".stats" --tune film --cqmfile "M4G LRM V4.cfg" --preset veryslow --output "movie.264" "VTS_01_1_Source.avs" "XXX.VOB"
pause

time encoding 70 min

total time encoding 140 min

P.S. preset set veryslow which are options (me, merange, trellis, subme, ecc..)??

kemuri-_9
19th August 2009, 23:41
P.S. preset set veryslow which are options (me, merange, trellis, subme, ecc..)??

read what people say and you shall be enlightened:
http://mewiki.project357.com/wiki/X264_Settings

PiPPoNe92
19th August 2009, 23:45
ok thanks kemuri-_9!

LoRd_MuldeR
19th August 2009, 23:45
...or look directly at the sources. This part should be understandable even without deep knowledge of the C language ;)

http://git.videolan.org/gitweb.cgi?p=x264.git;a=commitdiff;h=a1ed468f67476fbbe49e1fbfe1a567be0c052d44

PiPPoNe92
20th August 2009, 10:00
ok lord....but... which is the difference between --level 2.2 --level 3 ??

J_Darnley
20th August 2009, 10:02
http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Levels

PiPPoNe92
20th August 2009, 10:07
no i already see it, i don't understood

J_Darnley
20th August 2009, 10:13
Higher framerate allowed, higher max bitrate and larger CPB (VBV limits), larger DPB (more refs).
[EDIT] Sorry, I misread, the DPB is the same.

PiPPoNe92
20th August 2009, 10:20
ok, well.