Log in

View Full Version : WMCmd.vbs WME9 script update released - 10/11/07


Pages : 1 2 3 [4] 5 6 7

jeffy
3rd August 2007, 13:42
You can always mux VC1 and MP2 into MKV...
Please, tell me how and how do I get a raw VC-1 if I use WMCmd.vbs?
:thanks:

Sharktooth
3rd August 2007, 16:23
http://forum.doom9.org/showthread.php?t=127392

benwaggoner
3rd August 2007, 18:40
Is there really any difference between 1-pass CBR and 2-pass VBR WMA when the source has a constant bitrate?
Sure. VBR encoding will spend bits proportional to the complexity of the audio. Even if the source is CBR, fewer bits will be needed to transcode easy bits (especially silence!).

Heck, there's probably 0 padding all over your source if it's soundtrack content, because it wasn't able to use all the bits in some places.

And of course, the higher the bitrate of your lossy source, the better a lossy transcode will be from it.

zambelli
7th August 2007, 11:17
Please, tell me how and how do I get a raw VC-1 if I use WMCmd.vbs?
:thanks:
You can use asf2vc1 to extract VC-1 ES out of ASF(WMV):

http://www.ftyps.com/unrelated/asf2vc1/

jeffy
7th August 2007, 18:24
Thank you for your replies, benwaggoner, Sharktooth and zambelli, they were all really helpful!

aqualung99
10th August 2007, 00:51
Does anyone know if encoding using WMCmd.vbs whilst simultaneously encoding via the WMEnc.exe gui causes any wierdness?
I've been doing it for a while and I don't notice anything completely odd but in looking at WMCmb.vbs it looks like it changes/deletes some registry settings and I wonder how WMEnc.exe deals with that?

Thanks in advance!

*Note 1: If you're wondering why on earth I would do this, it's because WMCmd.vbs does not use 100% of both of my CPU cores (and I have a lot of encoding to do.)
*Note 2: Assume I am doing simple 1-pass stuff with WMEnc.exe -- CBR or VBR Quality. I can't get two-pass to work with WMEnc.exe anyway...:)

zambelli
10th August 2007, 10:21
Does anyone know if encoding using WMCmd.vbs whilst simultaneously encoding via the WMEnc.exe gui causes any wierdness?
It theoretically shouldn't.
I've been doing it for a while and I don't notice anything completely odd but in looking at WMCmb.vbs it looks like it changes/deletes some registry settings and I wonder how WMEnc.exe deals with that?
Because WmCmd.vbs sets registry keys at the beginning of its session and removes them at the end - any encoding session that you start in WMEnc.exe between those points will end up using the same registry settings.

*Note 1: If you're wondering why on earth I would do this, it's because WMCmd.vbs does not use 100% of both of my CPU cores (and I have a lot of encoding to do.)
Maybe we should work on that problem instead? :) How many cores do you have? Which version of WMFormat do you have installed?
*Note 2: Assume I am doing simple 1-pass stuff with WMEnc.exe -- CBR or VBR Quality. I can't get two-pass to work with WMEnc.exe anyway...:)
Hmm, that's not good either. :) What's wrong with 2-pass in WME9?

But instead of dealing with WME9 GUI at all, here's a better idea: why don't you just run two instances of WMCmd.vbs simultaneously?

aqualung99
10th August 2007, 18:43
Maybe we should work on that problem instead? :) How many cores do you have? Which version of WMFormat do you have installed?



I have a Core 2 X6800 (2 cores.) Also note that when doing CBR using WMCmd.vbs, both cores are utilized 100% (well, 90+% at all times). But when doing 2-pass peak VBR, neither pass utilizes both cores at 100% (I get about 75% total chip use during 2nd pass.) I can give you my 2-pass command-line arguments if it will help.
I don't see a file called WMFormat on my machine. But my version of wmvencod.dll is 11.0.5721.5145 if that helps...



Hmm, that's not good either. :) What's wrong with 2-pass in WME9?



Maybe I just don't know what I'm doing, but it finishes the first pass and then just stops as if its done (but of course bytes encoded=0.)



But instead of dealing with WME9 GUI at all, here's a better idea: why don't you just run two instances of WMCmd.vbs simultaneously?

Two reasons: First, I need the GUI because it lets me do audio-only encoding. If I try that using WMCmd.vbs (use -a_input and -audioonly, but not specify -input) it just quits with an error. But the GUI let's me do it no problem.
Second, I have a diverse set of files to encode -- with some I want very good quality, with some I don't care that much. It's easier to use the GUI when changing my encoding settings frequently (though I guess I could just put together a small group of batch files covering my various settings...)

zambelli
11th August 2007, 02:22
I have a Core 2 X6800 (2 cores.) Also note that when doing CBR using WMCmd.vbs, both cores are utilized 100% (well, 90+% at all times). But when doing 2-pass peak VBR, neither pass utilizes both cores at 100% (I get about 75% total chip use during 2nd pass.) I can give you my 2-pass command-line arguments if it will help.
I don't see a file called WMFormat on my machine. But my version of wmvencod.dll is 11.0.5721.5145 if that helps...
Yeah, the version number is good. That's interesting that you're getting different CPU util in 2-pass vs 1-pass. Can you share your command-lines?

Maybe I just don't know what I'm doing, but it finishes the first pass and then just stops as if its done (but of course bytes encoded=0.)
What is your source format?

Two reasons: First, I need the GUI because it lets me do audio-only encoding. If I try that using WMCmd.vbs (use -a_input and -audioonly, but not specify -input) it just quits with an error. But the GUI let's me do it no problem.
Are you encoding from 5.1 sources by any chance?

Second, I have a diverse set of files to encode -- with some I want very good quality, with some I don't care that much. It's easier to use the GUI when changing my encoding settings frequently (though I guess I could just put together a small group of batch files covering my various settings...)
Actually, I would argue that command-line is easier when you've got that many files to process. You might even be able to do simple batch scripting to automate the process for yourself.

aqualung99
11th August 2007, 02:42
Yeah, the version number is good. That's interesting that you're getting different CPU util in 2-pass vs 1-pass. Can you share your command-lines?

Sure (although don't laugh if some of my settings are dumb):

cscript.exe "C:\Program Files\Windows Media Components\Encoder\wmcmd.vbs" -input "VideoOnly.avs" -videoonly -output "output.wmv" -v_codec wvc1 -v_dquantoption 2 -v_percopt 2 -v_mode 4 -v_bitrate 16384000 -v_keydist 5 -v_preset better -v_buffer 60000 -v_peakbuffer 60000 -v_denoise 1


What is your source format?

This varies a lot. Everything from VC1 to MPEG4-ASP to MPEG2. In the case above, it was VC1.

Are you encoding from 5.1 sources by any chance?

In the case above, yes. But I find anytime I have a slightly funky audio format, the only guaranteed path to success is to demux video & audio and treat them separately (even with stereo sources.) WMCmd.vbs & WMEnc.exe are both extremely picky about audio, and often can't "figure out" how to connect-up the decompressed audio.


Actually, I would argue that command-line is easier when you've got that many files to process. You might even be able to do simple batch scripting to automate the process for yourself.

Well, for me it's pretty subjective. I suppose I could separate my videos into folders based on how important they are to me, and batch-convert entire folders with different settings...maybe I'll give that a try :)

zambelli
13th August 2007, 00:16
Sure (although don't laugh if some of my settings are dumb):

cscript.exe "C:\Program Files\Windows Media Components\Encoder\wmcmd.vbs" -input "VideoOnly.avs" -videoonly -output "output.wmv" -v_codec wvc1 -v_dquantoption 2 -v_percopt 2 -v_mode 4 -v_bitrate 16384000 -v_keydist 5 -v_preset better -v_buffer 60000 -v_peakbuffer 60000 -v_denoise 1
Those seem pretty reasonable. I'm guessing you're encoding 1080p in this case, where 16.384 Mbps bitrate would make sense. Since you're already using a very large buffer (60 seconds) but a low peak bitrate (default is 1.5x and you haven't specified a peak), I would recommend you use "v_mode 3" instead and just leave out buffer settings entirely. Mode 3 will do 2-pass but it won't limit the peak and it'll just calculate the appropriate buffer based on reached peaks when it's done.

Anyway, this doesn't entirely solve the mystery of why your CPU usage is low in 2nd pass. What kind of CPU usage are you seeing in 2nd pass?

Are you doing any preprocessing in the Avisynth script? What kind of CPU usage do you get when you try to just play it back in VirtualDub or something?
In the case above, yes. But I find anytime I have a slightly funky audio format, the only guaranteed path to success is to demux video & audio and treat them separately (even with stereo sources.) WMCmd.vbs & WMEnc.exe are both extremely picky about audio, and often can't "figure out" how to connect-up the decompressed audio.
Yes, this is true, WME9 is very picky about input audio formats as far as non-stereo sources are concerned. There's an elaborate thread about it (http://forum.doom9.org/showthread.php?t=125067) if you want to know the whole story.

The "best practices" recommendation is to rip the multi-channel audio to mono WAVs, and then combine them into multi-channel AVI using the Microsoft multichannel WAV combiner (http://www.microsoft.com/windows/windowsmedia/forpros/encoder/utilities.aspx).
Then you can feed that to WME9 or WMCmd.vbs (-a_input) separately from the video. The whole process can be automated easily with a little batch file magic.

leoenc
18th August 2007, 14:13
Hi

I can't seem to get WMCmd.vbs to work with avs input.
It immediately exits to the command prompt.
I verified my avs in VirtualDub, tried other avs scripts, reinstalled AVIsynth 2.57, removed all switches- nothing helped.
When feeding it with AVI it works.
I did notice that none of my avs scripts play with WMP11 or MPC.
Also minimizing both scripts didn't help:

cscript.exe wmcmd.vbs -input test.avs -output test.wmv

DGDecode_mpeg2source("E:\test.d2v")

When adding ConvertToRGB32() it does play in WMP11 (my sources are YUV12), but still doesn't work with WMCmd.vbs.

Any ideas?

buzzqw
18th August 2007, 14:43
launch it from dos ... it will trow some messages... also.. try this http://forum.doom9.org/showthread.php?t=128182

BHH

aqualung99
19th August 2007, 06:02
Those seem pretty reasonable. I'm guessing you're encoding 1080p in this case, where 16.384 Mbps bitrate would make sense. Since you're already using a very large buffer (60 seconds) but a low peak bitrate (default is 1.5x and you haven't specified a peak), I would recommend you use "v_mode 3" instead and just leave out buffer settings entirely. Mode 3 will do 2-pass but it won't limit the peak and it'll just calculate the appropriate buffer based on reached peaks when it's done.


Thanks for the tips -- they are very much appreciated. I'm still pretty new to all this, and my mode 4 encodes didn't turn out so well (when playing on XBox 360 streamed from a PC) so I will give your recommendations a try.


Anyway, this doesn't entirely solve the mystery of why your CPU usage is low in 2nd pass. What kind of CPU usage are you seeing in 2nd pass?


As stated earlier, I get ~75% total chip usage during 2nd pass. And again, encoding with CBR gives 100% (or, like, 98%) usage.


Are you doing any preprocessing in the Avisynth script?


Nope. The .AVS just contains one "Directshowsource" line, which points to a graph containing a file, a demuxer, and a video decompressor.


What kind of CPU usage do you get when you try to just play it back in VirtualDub or something?


Unfortunately I can't answer this right now as I am currently doing an encode. Let me see if I can get back to you on this one.
Really, if I'm the only person in the world who's seeing this problem, I'd say just forget about it. Could be something wonky with my system.


The "best practices" recommendation is to rip the multi-channel audio to mono WAVs, and then combine them into multi-channel AVI using the Microsoft multichannel WAV combiner (http://www.microsoft.com/windows/windowsmedia/forpros/encoder/utilities.aspx).
Then you can feed that to WME9 or WMCmd.vbs (-a_input) separately from the video. The whole process can be automated easily with a little batch file magic.

Which brings me to another point (hopefully I'm not being redundant!) Although I have the multi-channel AVI (built using WavAviMux) I never introduce it to my stream during my main encode. The reason being that if I try that, (and I think other people have reported this as well) WMCmd.vbs will crash after some very long period of time (like 12 or 16 hours or something.) I'm pretty sure it was someone on this forum that directed me to mux the audio after the video encode was complete (which fixed the problem....I use wmstreamedt to get that job done.) So, you know, just throwing that out there :)
Also related to that, it would be super cool if WMCmd (or WMEnc) had like POVRay-style ability to continue an interrupted encode. Some encodes I've tried with 1080p source and 2-pass agressive motion compensation can take a very, very long time :) And a lot can happen to one's machine during that amount of time (like the cat coming in and brushing up against the power switch......doh!)

As always thanks for your time and comments!

leoenc
19th August 2007, 07:11
launch it from dos ... it will trow some messages... also.. try this http://forum.doom9.org/showthread.php?t=128182

BHH

It just shows:
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Anyone?

aqualung99
19th August 2007, 07:11
And now for something completely different. I have some HD-DVD movies that were in the theatres in the '80s, that I want to backup to WVC1. I want my backup to be "superior" to the HD-DVD quality (hang with me a second ;) )
The video quality of these HD-DVD movies (as an example, I own "American Werewolf in London", but there are others I own showing the same problem) in my mind leaves a lot to be desired. Some parts are clear and crisp, but many parts have lots of (what I call) "dithering." Newer movies I've bought don't seem to have this problem, and I'm not experienced enough at this stuff to know whether or not all these little dots are:
a) Degredation of source film that is 20 years old.
b) "film grain" that some people seem to think is important, but is unsightly to my newbie eyes.
c) Poor encoding by the HD-DVD authors who encoded the movies.

Regardless, I would like to "fix" it if at all possible. In that vein, I wonder if someone could tell me either:
a) Whether using an option like "-v_denoise 5" in WMCmd would smooth-out all these little dots, or
b) Describe the denoise algo (or point me to a description of an algo that is very similar) so I can determine for myself if it will help.
I will investigate these myself but was hoping somebody could get me started in the right direction.

P.S. I will post a frame or two showing exactly what I'm talking about, if someone can confirm that it's legal for me to do so...

buzzqw
19th August 2007, 09:04
@leoenc

even when using the wmv tester for wmv7 ?

if so i suggest to reinstall WMEncoder http://www.microsoft.com/downloads/details.aspx?FamilyID=5691ba02-e496-465a-bba9-b2f1182cdf24

and then the wmp11 or wmdist11

look here for some help http://automkv.wiki-site.com/index.php/Installation#WVC1

BHH

leoenc
19th August 2007, 09:21
buzzqw

Yes - the tester doesn't work even with wmv7.
I also tried reinstalling the WMV Encoder and wmp11, but it didn't help.
After doing some codec cleanup and installing ffdshow, I am able to play avs scripts now in wmp and mpc.
However WMCmd.vbs still won't work with avs, so I'm really lost now..

aqualung99
19th August 2007, 09:27
buzzqw

Yes - the tester doesn't work even with wmv7.
I also tried reinstalling the WMV Encoder and wmp11, but it didn't help.
After doing some codec cleanup and installing ffdshow, I am able to play avs scripts now in wmp and mpc.
However WMCmd.vbs still won't work with avs, so I'm really lost now..

I'm no expert, but did you make sure and update to the latest version of WMCmd.vbs? (http://www.citizeninsomniac.com/WMV/#WMCmd)

buzzqw
19th August 2007, 09:33
@aqualung99

the tester already include the latest wmvcmd.vbs

@leoenc

are you using Vista ? if so remember to apply the fix http://support.microsoft.com/default.aspx/kb/929182

BHH

leoenc
19th August 2007, 09:41
Using the latest May 21, 2007 WMCmd.vbs on XP.

buzzqw
19th August 2007, 09:49
i can only suggest to reistall wmencoder 9 then reboot
reinstall wmdist11 and reboot

then retry encoding


BHH

leoenc
19th August 2007, 18:14
ye tried that- uninstalled, rebooted, installed, rebooted...nothing works.
WMCmd.vbs just doesn't like avs inputs on my machine :(

buzzqw
19th August 2007, 19:08
uninstall avisynth 2.57
delete the c:\program files\avisynth folder, look for avisynth.dll in c:\windows\system32 and if present delete it
reinstalling avisynth 2.57 :)

BHH

zambelli
20th August 2007, 02:36
ye tried that- uninstalled, rebooted, installed, rebooted...nothing works.
WMCmd.vbs just doesn't like avs inputs on my machine :(
You said yourself though that your .avs scripts won't play in WMP or MPC either - so I doubt that the problem is in WMCmd. What's more likely is that the codec handling your YV12 or YUY2 decoding is not working properly.

zambelli
20th August 2007, 02:42
Nope. The .AVS just contains one "Directshowsource" line, which points to a graph containing a file, a demuxer, and a video decompressor.
Do you get the same CPU usage (~75%) when encoding directly from uncompressed AVI?
Which brings me to another point (hopefully I'm not being redundant!) Although I have the multi-channel AVI (built using WavAviMux) I never introduce it to my stream during my main encode. The reason being that if I try that, (and I think other people have reported this as well) WMCmd.vbs will crash after some very long period of time (like 12 or 16 hours or something.)
Thanks, I'll take note of that.
Also related to that, it would be super cool if WMCmd (or WMEnc) had like POVRay-style ability to continue an interrupted encode. Some encodes I've tried with 1080p source and 2-pass agressive motion compensation can take a very, very long time :)
Well, unfortunately I have no control over the codec implementation. The codec is designed to do 2-pass encoding in a single session and there's nothing that could be changed in the higher-level APIs to make that behavior different. An "interruptable" implementation would probably require some significant rewrites in the codec.

Regardless, I would like to "fix" it if at all possible. In that vein, I wonder if someone could tell me either:
a) Whether using an option like "-v_denoise 5" in WMCmd would smooth-out all these little dots, or
b) Describe the denoise algo (or point me to a description of an algo that is very similar) so I can determine for myself if it will help.
The codec's denoiser is pretty simple I'd generally only recommend it when no superior substitute is available. But in this case, I think you're better off using one of Avisynth's numerous denoise filters such as UnDot, FFT3DFilter, etc. The Avisynth Usage forum can offer lots of help there.

leoenc
20th August 2007, 07:44
You said yourself though that your .avs scripts won't play in WMP or MPC either - so I doubt that the problem is in WMCmd. What's more likely is that the codec handling your YV12 or YUY2 decoding is not working properly.

Yes but then I wrote I did some codec cleanup (also lowered the merit of suspected codecs). Since then the avs played fine in wmp or mpc.

leoenc
20th August 2007, 07:47
uninstall avisynth 2.57
delete the c:\program files\avisynth folder, look for avisynth.dll in c:\windows\system32 and if present delete it
reinstalling avisynth 2.57 :)

BHH

What do you know? it worked! :)
Although I did that before, it seems the right sequence is (at least in my case): reinstall WME and then reinstall AVIsynth (making sure to completely cleanup after each uninstall).

buzzqw- :thanks:

aqualung99
20th August 2007, 08:15
Do you get the same CPU usage (~75%) when encoding directly from uncompressed AVI?


While reading through some things, I think my graph may be wrong. I think I may have been feeding the decompressed source to the encoder too slowly (though it's still interesting that CBR still used 100% of the chip -- is CBR generally slower?)
Let me do a few more tests and if there's still a problem with 2-pass VBR I'll let you know (can't do it now, in the middle of an encode as usual ;) )


Well, unfortunately I have no control over the codec implementation. The codec is designed to do 2-pass encoding in a single session and there's nothing that could be changed in the higher-level APIs to make that behavior different. An "interruptable" implementation would probably require some significant rewrites in the codec.


While I'm disappointed, I certainly understand. Frankly I'm not sure if any of the other codecs out there can do it either. But as an average-Joe-consumer it's sure a nice feature -- especially when working with 1080p content...

The codec's denoiser is pretty simple I'd generally only recommend it when no superior substitute is available. But in this case, I think you're better off using one of Avisynth's numerous denoise filters such as UnDot, FFT3DFilter, etc. The Avisynth Usage forum can offer lots of help there.

Good advice as usual. I will most definitely look into those filters. Thanks again!

FoxRacR17
26th August 2007, 17:53
I have a question, i'm using this command line:
cmd /k cscript.exe "C:\Program Files\Windows Media Components\Encoder\wmcmd.vbs" -input "E:\video.avs" -output "E:\final video.wmv" -v_codec WVC1 -videoonly -v_mode 0 -v_preset better -v_bitrate 7700000 -v_keydist 30 -v_buffer 60000 -v_quality 75

It takes about 16-18 hours to encode which sounds normal, and i tell it to use a bit rate of about 7-8mb/s which should make the output video file around 8gigs large according to the wmv bitrate calculator. However, i have encoded both batman begins and v for vendetta and both of the video files came out just under 4 gigs! anyone know why? The video looks just fine, but i dont understand why they are so small. Under properties they say that they are 7-8mb/s, and they stream just fine to my 360, but i'm just worried that i'm doing something wrong.

zambelli
26th August 2007, 21:21
cmd /k cscript.exe "C:\Program Files\Windows Media Components\Encoder\wmcmd.vbs" -input "E:\video.avs" -output "E:\final video.wmv" -v_codec WVC1 -videoonly -v_mode 0 -v_preset better -v_bitrate 7700000 -v_keydist 30 -v_buffer 60000 -v_quality 75
It takes about 16-18 hours to encode which sounds normal, and i tell it to use a bit rate of about 7-8mb/s which should make the output video file around 8gigs large according to the wmv bitrate calculator. However, i have encoded both batman begins and v for vendetta and both of the video files came out just under 4 gigs! anyone know why?
Most people who have reported this issue seem to be encoding from EVO sources. Can you try dumping the .avs output to an uncompressed or losslessly compressed AVI (perhaps 15-20 minutes of it) for a test? Make sure there are no duplicate frames in the AVI, and then try encoding it to WMV with the same settings used above. Let me know if you run into the same bitrate issue.

Another thing to try would be to raise v_quality above 90. That ought to introduce more QP=1 frames into the encode.

FoxRacR17
26th August 2007, 23:41
Thanks for the reply Zambelli, that actually is what i was doing, serving a rebuilt EVO file that only had the video stream in it. I'll try it with a uncompressed avi file and see what happens. The weird thing is that when i right click on the finished video file and look at the properties, it says that the video bitrate is the 7.7mb/s that i set it to in the command line. However, at the end of the encode the results or whatever said the average bitrate was something like 4-5mb/s

Also, when i was first experimenting i tried to encode batman begins with a raw .vc1 file thru a .avs file and the same thing happened.

zambelli
27th August 2007, 01:24
The weird thing is that when i right click on the finished video file and look at the properties, it says that the video bitrate is the 7.7mb/s that i set it to in the command line. However, at the end of the encode the results or whatever said the average bitrate was something like 4-5mb/s
That's somewhat normal - the bitrate being reported is the intended constant bitrate. Even if the average bitrate turned out lower, there's still the possibility of the bitrate going as high as what was intended, and that's important for the decoder buffer to know.

Also, when i was first experimenting i tried to encode batman begins with a raw .vc1 file thru a .avs file and the same thing happened.
I'd love to get to the bottom of this issue. I suspect it might have something to do with frames not being delivered at a constant 23.976 fps framerate from the EVO, resulting in either duplicate frames or dropped frames.

FoxRacR17
28th August 2007, 04:20
Ok, well i just did a quick encode of a 3 minute sample of an uncompressed avi and the results were the same. The file size was around 95mb and the bitrate was like 4.5mb/s.

zambelli
28th August 2007, 05:04
Ok, well i just did a quick encode of a 3 minute sample of an uncompressed avi and the results were the same. The file size was around 95mb and the bitrate was like 4.5mb/s.
Thanks for trying that. Would you be able to upload the WMV file somewhere so I can take a look at it?

ACrowley
28th August 2007, 10:02
Ok, well i just did a quick encode of a 3 minute sample of an uncompressed avi and the results were the same. The file size was around 95mb and the bitrate was like 4.5mb/s.

It was discussed here before.

I and other Encoders had the same Problems with 1 pass CBR Mode and by far to small Files /to low Bitrate

Its caused by v_quality Values under 100

Use -v_Quality 100 in CBR Mode and you will get exactly your calculated Outputsize/Bitrate :)

I never had any dropped Frames with Quality 100 in CBR Mode

FoxRacR17
29th August 2007, 03:30
Ok, up uploaded a sample for you zambelli. You can get it here:
http://www.megaupload.com/?d=ZSVQRBND

Thanks for the info ACrowley, I have been reading most, if not all, of your posts on how to convert hd-dvd to wmv-hd and you have been a great help! I will try a sample real quick with v_quality 100 instread. Also, i have a question for you: I am encoding my movies to stream to my 360, should i use 1pass cbr at around 8-9mb/s, or should i got for peak VBR with a base of 8 and a max peak of 9mb/s?

And finally in the avs file i am using spline36resize(1280,720) to make my 720p file, should i continue with this or should i add -v_width and -v_height in the batch file? Thanks for the help guys.

ACrowley
29th August 2007, 14:46
Ill switched to 2pass VBR Peak for a while...The Result is better ,cleary

Xbox360 can handle VBR Peakbitrate ~12Mbps fine.

For example 720p 8Mbps 2pass VBR 12Mbps Peak

Problem is still 1080p, because for 1080p you need higher Bitrate. 10Mbps VBR is the minimum. Peak would be ~15Mbps.
But 360 cant handle 1080p with these Peak Rates.

But its fine in CBR Mode. So use 1pass CBR with 60ooo Buffer for 1080p and for 720p 2pass VBR Peak 12Mbps

I never add any -v_width high. Full Resizing is done by avs Script :)

Dont use 1280x720 when its 2,35:1. Crop it and the Make your Resize to 1280x544

Guideline :

1920 x 784 - 796 = 1280 x 528 (2.42:1)
1920 x 796 - 808 = 1280 x 536 (2.38:1)
1920 x 808 - 832 = 1280 x 544 (2.35:1)

FoxRacR17
30th August 2007, 02:26
Thanks for the info ACrowley. Ill try a test encode here real quick and hopefully i wont have this problem.

Also, i never really understood this aspect ratio to pixel ratio thing so could you explain a little more on how to crop and why to use different pixel widths and heights? Or maybe there is a guide somewhere?

Also, what should the buffer and peakbuffer be for the 2pass VBR peak bitrate encode be?

Thanks again for your help

FoxRacR17
31st August 2007, 03:18
I'm having some problems trying to do a peak vbr encode. The command line that i am using is:

cmd /k cscript.exe "C:\Program Files\Windows Media Components\Encoder\wmcmd.vbs" -input "E:\video.avs" -output "E:\final video.wmv" -v_codec WVC1 -videoonly -v_mode 4 -v_preset better -v_bitrate 8000000 -V_peakbitrate 12000000 -v_keydist 30 -v_peakbuffer 60000

however the final video is always messed up, its like it is skipping forward and backward ever second......its hard to explain.

Also i then tried a cbr command line like this:

cmd /k cscript.exe "C:\Program Files\Windows Media Components\Encoder\wmcmd.vbs" -input "E:\video.avs" -output "E:\final video.wmv" -v_codec WVC1 -videoonly -v_mode 0 -v_bitrate 8000000 -v_preset better -v_buffer 60000 -v_quality 100

and the final bitrate was much closer to the 8mb/s, it was 7.7mb/s. Is that what it should be if i set it to 8mb/s in the command line?

zambelli
31st August 2007, 07:35
however the final video is always messed up, its like it is skipping forward and backward ever second......its hard to explain.
Also i then tried a cbr command line like this
Can you try using 2-pass CBR (v_mode 1) just for test to see if the skipping issue repros? It might be something to do with seeking to the beginning of the .avs after the 1st pass.

and the final bitrate was much closer to the 8mb/s, it was 7.7mb/s. Is that what it should be if i set it to 8mb/s in the command line?
Well ideally it should be 8 Mbps. How long is the source? Is it 1080p24?

zambelli
31st August 2007, 08:18
Ok, up uploaded a sample for you zambelli. You can get it here:
http://www.megaupload.com/?d=ZSVQRBND
Thanks! I took a look at the video and can confirm ACrowley's theory that this is actually due to v_quality being set below 100. You see, your video already has (nearly) all of its frames encoded at QP=2.0. The only way to go down to QP=1.5 and 1.0 in CBR mode is to set v_quality above 90. So if you set v_quality 100, you ought to see bitrates closer to target. If even then your final bitrate ends up being lower than target - don't worry, that's normal. WMV9 encoder doesn't pad bits in CBR mode so if the frame sizes simply end up lower than expected, it doesn't do anything to pad them to meet a target bitrate. Which actually isn't a bad thing at all. :)

pass cbr at around 8-9mb/s, or should i got for peak VBR with a base of 8 and a max peak of 9mb/s?
You can probably go above 9 mbps peaks anyway. I think bitrates above 15 Mbps have been confirmed to work fine on the 360.

And finally in the avs file i am using spline36resize(1280,720) to make my 720p file, should i continue with this or should i add -v_width and -v_height in the batch file? Thanks for the help guys.
Doing a spline resize is enough, you don't need to tell encoder about the size, it will just inherit it from the .avs source.

BTW, that encode looks very good. I was surprised to see all QP=2.0 at that low of a bitrate. Did you do any preprocessing to make it more compressable?

FoxRacR17
31st August 2007, 14:31
Well ideally it should be 8 Mbps. How long is the source? Is it 1080p24?

I was just using that HDIntro.evo file that always plays at the beginning of hd dvds, its 2:02 seconds long. It only does it when i'm going through the .avs file. When i made an .avi out of it and tried a 2 pass peak vbr it worked fine.


Thanks! I took a look at the video and can confirm ACrowley's theory that this is actually due to v_quality being set below 100. You see, your video already has (nearly) all of its frames encoded at QP=2.0. The only way to go down to QP=1.5 and 1.0 in CBR mode is to set v_quality above 90. So if you set v_quality 100, you ought to see bitrates closer to target. If even then your final bitrate ends up being lower than target - don't worry, that's normal. WMV9 encoder doesn't pad bits in CBR mode so if the frame sizes simply end up lower than expected, it doesn't do anything to pad them to meet a target bitrate. Which actually isn't a bad thing at all.


So is that why my batman begins encode turned out at under 5 gigs but still looked acceptable? And your welcome for the sample also :)


BTW, that encode looks very good. I was surprised to see all QP=2.0 at that low of a bitrate. Did you do any preprocessing to make it more compressable?


I'm new to this type of encoding so i do not think i did any preprocessing. All i did was make a .grf with haali media splitter->wmvideo decoder dmo, then made a .avs, and then loaded that into virtualdub and just saved it as an .avi, then encoded it with your script utility.



Can you try using 2-pass CBR (v_mode 1) just for test to see if the skipping issue repros? It might be something to do with seeking to the beginning of the .avs after the 1st pass.


I'll try that when i get home, but for now i'm off to school.

Thanks again for your help! :)

FoxRacR17
1st September 2007, 01:15
Well i just did a two pass cbr encode, didnt change anything except v_mode 0 to v_mode 1 and it turned out just fine. No skipping or anything, the only thing though is that the average bitrate at the end said it was 7.8mb/s when i set the command line to encode to 8.5mb/s. Any idea why I am still not getting the outcome bitrate that i set it to and why the video skips when i try to do a 2pass peak vbr encode?

sportcenter
1st September 2007, 04:00
Well i just did a two pass cbr encode, didnt change anything except v_mode 0 to v_mode 1 and it turned out just fine. No skipping or anything, the only thing though is that the average bitrate at the end said it was 7.8mb/s when i set the command line to encode to 8.5mb/s. Any idea why I am still not getting the outcome bitrate that i set it to and why the video skips when i try to do a 2pass peak vbr encode?

add v_quality 100 to your vbs script

sportcenter
1st September 2007, 04:06
You can probably go above 9 mbps peaks anyway. I think bitrates above 15 Mbps have been confirmed to work fine on the 360.



CBR bitrates yes....but only on 720p...most problems occur when streaming but you can play any sized .wmv off a usb hard drive after:

1) Update your SPTD driver:

http://www.duplexsecure.com/en/downloads

2) then use mac driver

3) format the hdd as HFS+

4) the hdd will appear as "portable device" in the media tab on the xbox 360

Rash
1st September 2007, 07:37
Thank you Zambelli! This new vbs is really nice. :D

I have just one question. I have encoded a 5.1 channel file using Windows Media Audio 10 at 384kbps, VBR based (-a_mode 3). Why do I get a ~ 963kbps encoded file?

PS D:\Home\Rash\Development\Eng test> cscript "C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs" -a_codec WMA
9PRO -a_mode 3 -a_setting 384_48_6_24 -input 'eng_test(1).wav' -output eng_test.wma
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft (R) Windows Media Encoder Command Line Script Utility
Copyright (C) Microsoft Corporation. All rights reserved.


======== Begin Pass1 ========
Read: 206.2s (99.8%) Elapsed: 00:00:32 Left: 00:00:00 [6.45x]

======== Begin Pass2 ========
Encoded: 197.2s (95.4%) Elapsed: 00:00:32 Left: 00:00:02 [6.16x]

======== Encoding Completed ========

Audio :
Codec: Windows Media Audio 10 Professional
Expected bit rate: 384000 bps
Average bit rate: 963624 bps
Expected sample rate: 2929
Average sample rate: 7351
Dropped byte count: 0 bytes
Dropped sample rate: 0
Total bytes: 24903680 bytes

Overall:
Encoding time: 68 seconds
Average bit rate: 963624 bps
File size: 24956779 bytes
File duration: 206.955 seconds

Thank you.

zambelli
1st September 2007, 10:23
I have just one question. I have encoded a 5.1 channel file using Windows Media Audio 10 at 384kbps, VBR based (-a_mode 3). Why do I get a ~ 963kbps encoded file?
Whoa, that is bizarre. What happens when you use -a_mode 1 or 4?

zambelli
1st September 2007, 10:25
CBR bitrates yes....but only on 720p...most problems occur when streaming but you can play any sized .wmv off a usb hard drive after:
What about playback from DVD-R?

FoxRacR17
1st September 2007, 21:11
Dont use 1280x720 when its 2,35:1. Crop it and the Make your Resize to 1280x544

Guideline :

1920 x 784 - 796 = 1280 x 528 (2.42:1)
1920 x 796 - 808 = 1280 x 536 (2.38:1)
1920 x 808 - 832 = 1280 x 544 (2.35:1)

Could someone please elaborate on this? I'm having a hard time understanding why i have to crop the image and cant use straight 1280x720. If i crop the image wont i be loosing part of the picture while i'm watching the movie?

I'm going to be encoding batman begins and v for vendetta which both are 2.40:1 according to the back of the box. What cropping would i use in avisynth and what resolution? And how do i figure this out on my own? Thanks guys.