PDA

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


Pages : [1] 2

zambelli
23rd March 2007, 08:15
I'm starting a new thread devoted to WMCmd.vbs script updates (as the old one was more about the WVC1 beta codec package).


WMCmd.vbs
Windows Media Encoder Command Line Script Utility

Disclaimer: Although I do work for Microsoft, please understand that this is not an official Microsoft update. WME9 is considered a legacy product so it's unlikely there will be any official WMCmd.vbs updates coming from Microsoft in the future.



The latest version was released on October 11, 2007. You can download it here:

http://www.citizeninsomniac.com/WMV/#WMCmd

What is it?
Windows Media Encoder 9 Series (http://www.microsoft.com/downloads/details.aspx?FamilyID=5691ba02-e496-465a-bba9-b2f1182cdf24) is best known as a standalone encoder application, but it actually shipped with an entire encoder SDK that allowed 3rd parties to develop their own WM encoder interfaces. A proof-of-concept command-line utility written in VBScript and based entirely on the encoder SDK was included with WME9. That is WMCmd.vbs. When run from the command-line with cscript.exe, this utility provides all the power and (most of the) features of WME9 to the advanced user who prefers the speed and robustness of a command-line encoder.

Why an update?
The original script was released with WME9 in 2002. No subsequent updates to WME9 (such as the x64 release) updated the script, but as updates to the codecs were released through new WMP and WM Format releases, it became obvious that changes to the old script were necessary to get the most out of the new codecs.

What's new?
The updated WMCmd.vbs added support for WVC1 (WMV9 Advanced Profile) encoding, WMA10 Professional encoding, advanced WMV9 settings, AviSynth input, better progress reporting, additional metadata support, revised documentation, video quality presets, etc. The full changelog is posted here and here (http://www.citizeninsomniac.com/WMV/readme.txt).


Requirements: Windows Media Encoder 9 Series (http://www.microsoft.com/downloads/details.aspx?FamilyID=5691ba02-e496-465a-bba9-b2f1182cdf24) or its SDK
Windows Vista users should also download and install hotfix KB929182 (http://support.microsoft.com/default.aspx/kb/929182) before using WMCmd.vbs.
Although WME9/WMCmd.vbs will work with both WM Format 9 (WMP9) and WM Format 9.5 (WMP10) codecs, it is recommended that you update to the latest WM Format 11 codecs (http://www.citizeninsomniac.com/WMV/#Codecs), currently available for download in XP and included in Vista. Advanced video encoding settings will only work with v11 codecs.


Full command-line help: http://www.citizeninsomniac.com/WMV/WMCmd.txt (also available when you run "cscript.exe wmcmd.vbs" without any arguments)


Changelog:

10-11-2007:
-----------
Added -v_qp option as an alternative to -v_quality for 1-pass VBR encoding (which is in fact a fixed QP encoding mode). Whereas -v_quality uses an abstract 0 to 100 scale, -v_qp maps directly to quantizer parameter values in the 1.0 to 31.0 range (in 0.5 increments).
Encoder registry settings are now removed immediately after the encoder session is started because the codec only reads them once at the beginning of the encode so there's no reason for them to hang around until the end of the encoding session. This ought to improve parallel encoding jobs interoperability too.
The script no longer indiscriminately destroys existing encoder registry settings. At the beginning of each encoding session it saves the existing registry settings and then restores them at the end. This improves usability in cases where one set of advanced encoder settings is set externally (manually or via PowerToy) while another is used from the command-line.
Deprecated -v_percopt in favor of new -v_adz option because valid range for -v_percopt didn't make much sense. -v_percopt will continue to work as before but it is no longer documented. -v_adz value range now matches that of "Perceptual Option" (Adaptive Dead-Zone) in WMV9 PowerToy. If both -v_percopt and -v_adz are specified, -v_percopt values will override -v_adz values.
Redefined and fully documented -v_preset quality presets. They should now better reflect their speed and quality rankings.
Made -v_compopt 1 into an Advanced Profile exclusive option because some of its components were exclusive to Advanced Profile. It's best to be on the safe side.


5-21-2007:
----------
Added -log option for redirecting all text output to a file.
Updated some descriptions for advanced video settings.
Added a FAQ section to this release document.

4-14-2007:
----------
IMPORTANT CHANGE: Remapped -v_mslevel (Motion Search Level) values to correctly reflect the codec implementation. 0 is now the default luma search and 3 and 4 are adaptive chroma modes.
Added an -a_input option that allows specifying an alternative audio source to the one present in the main -input source. This makes it possible to use separate video and audio source files from the command-line, as it's always been possible in the WME9 GUI.
Updated the documentation, expanded sections on dquant and perceptual optimization options. Very useful options for preserving fine detail.
Fixed a bug where simultaneous encoding jobs would get simultaneously killed as soon as one encoding job finished.


3-22-2007:
----------
Added a -v_preset option that introduces 5 intuitive video quality presets:
Fast, Good, Better, Best and Insane. Unlike the -v_compopt 1 preset that is defined within the codec, -v_preset values are defined in the script and can be easily changed and refined in future versions.
Added -v_complexity as an alias for -v_performance expressed on a 0-5 scale.
Fixed bug that sometimes caused the script to hang or overwrite certain parameters when an external configuration file (-config) was loaded.
Improved the unknown source duration workaround by having the script automatically add the new file extension (like Avisynth .avs) to the list of formats WMP is allowed to play. No more security dialogs on first launch!
Added profile compliance checking for advanced WMV9 settings - will not set certain registry keys if Simple or Main profiles are selected.
Added code to check if WMEncoder object is initialized correctly before proceeding with encode.
Removed the -help? option which launched WME9 CHM help file from cmd line.
Removed old Complex Profile (CP) support entirely - translates to AP now.
Changed Lookahead maximum value to 30.
Updated the documentation, corrected some vague and erroneous descriptions.

8-25-2006:
----------
Fixed a bug in configuration saving (-s_config) and loading (-config) functions that prevented command-line parameters containing quotation marks from being processed correctly.
Added code to check whether specified video profile (-v_profile) is supported by the video codec used (-v_codec). For example, can't use SP or MP with WVC1.

5-19-2006:
----------
Added support for WVC1 encoding (WMV9 Advanced Profile video codec).
Added support for WMA10 Professional low-bitrate encoding and changed WMA codec identifiers to be version-agnostic (i.e. WMASTD instead of WMA9STD)
Added command-line parameters for advanced video settings otherwise exposed only through the registry. For details, see: http://www.microsoft.com/windows/windowsmedia/howto/articles/codecadvancedsettings.aspx
Added support for Avisynth (.avs) script sources and worked around a related duration bug in the source plugin.
Rewrote the encoding progress screen so that it estimates encoding time, ETA and encoding speed.
Added command-line parameters for music centric metadata such as album, track number, release year, genre, etc.
Added metadata summary to the output screen.
Added documentation for the new advanced video settings to the inline help.
Reorganized inline help documentation and grouped settings in a more intuitive way.
Fixed bug where encoder script would sometimes hang at the end of encoding process.
Improved error handling for bad source files.

zambelli
23rd March 2007, 08:19
Copying here from an old post:

Yep, the encoder script now supports .avs inputs. The truth of the matter is that it always did. You see, WME9 has a concept of source plugins which allows it to treat file inputs, screen captures and device captures in a very similar fashion. It uses its own AVI source plugin to read AVI files, and that plugin cannot retrieve the duration property from AVS scripts - for one reason or another. So the AVS workaround was to retrieve the duration using some other method. Wmcmd being VBScript based, it wasn't possible to use DirectShow or VfW, so I used the next best thing: WMP ActiveX control. If for some reason the duration can't be retrieved again (i.e. XP with absolutely no WMP present), you'll still be able to encode - you just won't have the pretty progress bar to tell you how long you need to take the lunch break for. :)

zambelli
23rd March 2007, 08:47
The most interesting addition to the 3-22-2007 release might be the new -v_preset parameter, so let me elaborate on it a bit...

Dealing with WMV9 encoding at home and at work, I would often get asked about "best" encoding parameters for various scenarios. As I was updating the script with other things recently, it occurred to me that some of these "best encoding practices" could be added as presets to the encoder script, allowing people to easily improve WMV quality (or encoding speed) without worrying too much about all the various parameters. Consider it an attempt at a one-size-fits-all quality solution, similar to the --preset switch in LAME MP3 encoder, for example.

The closest we had to this up until now was the -v_compopt 1 switch, but that one was actually implemented inside the codec. The new presets are implemented entirely in the script which means we can tweak and refine them as we come up with better encoding settings.

The current presets are as follows:

fast - Up to 1.5x faster than default with an acceptable quality tradeoff. The preset sets:
Complexity = 2 (-v_performance 40)
Lookahead = 30 (-v_lookahead 30)
Loopfilter = On (-v_loopfilter 1)
Overlap Filter = On (-v_overlap 1)
Motion Search Level = Auto w/ Integer Chroma (-v_mslevel 0)
good - Similar speed as default but with more accurate motion search. This one is probably safe to use when otherwise you'd use no advanced features. The preset sets:
Complexity = 3 (-v_performance 60)
Lookahead = 30 (-v_lookahead 30)
Loopfilter = On (-v_loopfilter 1)
Motion Search Level = Auto w/ Integer Chroma (-v_mslevel 0)
better - Up to 1.5x slower than default but more efficient in ratecontrol. The big boost here are B-frames, along with expanded MV range and adaptive chroma search. The preset sets:
Complexity = 3 (-v_performance 60)
Lookahead = 30 (-v_lookahead 30)
Loopfilter = On (-v_loopfilter 1)
Motion Search Level = Auto w/ Integer Chroma (-v_mslevel 0)
Motion Search Range = Auto (-v_msrange 0)
Motion Vector Cost = Dynamic (-v_mvcost 1)
B-frames = 1 (-v_bframedist 1)

best - Up to 5x slower than default but with noticeably better quality. This will probably be "best enough" for most folks. One complexity level higher than "better", with MB-adaptive motion matching. The preset sets:
Complexity = 4 (-v_performance 80)
Lookahead = 30 (-v_lookahead 30)
Loopfilter = On (-v_loopfilter 1)
Motion Search Level = Integer Chroma (-v_mslevel 3)
Motion Search Range = Auto (-v_msrange 0)
Motion Vector Cost = Dynamic (-v_mvcost 1)
B-frames = 1 (-v_bframedist 1)
Motion Match Method = Auto (-v_mmatch 0)

insane - Insanely slow but if time is not a concern... It will provide the highest quality in most cases. True chroma search, Hadamard motion matching... It's painfully slow, so beware. The preset sets:
Complexity = 4 (-v_performance 80)
Lookahead = 30 (-v_lookahead 30)
Loopfilter = On (-v_loopfilter 1)
Motion Search Level = True Chroma (-v_mslevel 4)
Motion Search Range = Auto (-v_msrange 0)
Motion Vector Cost = Dynamic (-v_mvcost 1)
B-frames = 1 (-v_bframedist 1)
Motion Match Method = Hadamard (-v_mmatch 2)


Setting additional parameters will override any values set by the preset. Using video presets with -v_compopt 1 is not recommended.


These initial presets are based on just my own ideas of tradeoffs between speed and quality. If you have better ideas for presets, please share them.

tchaikovsky
23rd March 2007, 15:43
Nice work !

lazyn00b
23rd March 2007, 21:12
Thanks a lot, Zambelli, the presets look really good. Based on my modest experience tweaking these settings, it looks like your "better" preset is going to be the sweet spot for my purposes (compressing recorded HDTV at a reasonable speed).

zambelli
23rd March 2007, 22:05
Thanks a lot, Zambelli, the presets look really good. Based on my modest experience tweaking these settings, it looks like your "better" preset is going to be the sweet spot for my purposes (compressing recorded HDTV at a reasonable speed).
Thanks, glad it's working out for you. What kind of slowdown are you seeing with "better" compared to "good" or default? The numbers I posted were done fairly quickly, based on some encodes I did on my Athlon64 3500+, so I'd love to get more feedback about performance ratios in general.

buzzqw
24th March 2007, 22:47
thanks Zambelli!

in next update AutoMKV will include 5 new profile, based on these preset and with wvc1 as codec

Also thanks for the new vbs! a lot more stable and reliable !

BHH

jubilex
26th March 2007, 04:34
I'm still a bit unclear on the v_performance setting. By your presets, it looks like setting this higher will improve quality, but in my frame-by-frame comparisons, I've seen no improvement in quality whatsoever -- v_performance 0 looks every bit as good as v_performance 80. The only difference I've seen is that the higher setting will produce a smaller file, and will take *dramatically* longer to encode.

zambelli
26th March 2007, 07:34
I'm still a bit unclear on the v_performance setting. By your presets, it looks like setting this higher will improve quality, but in my frame-by-frame comparisons, I've seen no improvement in quality whatsoever -- v_performance 0 looks every bit as good as v_performance 80. The only difference I've seen is that the higher setting will produce a smaller file, and will take *dramatically* longer to encode.
Sounds like you're encoding in 1-pass VBR mode. In that mode higher complexity/performance will only decrease the size of the encoded file because the quality is fixed (hence the name "Quality VBR"). In every other mode the bitrate will stay the same but the quality will improve due to better motion estimation algorithms used.

Also, encoding times change dramatically between 0 and 80. You can go literally from faster-than-realtime encoding to wake-me-up-when-it's-done encoding.

buzzqw
5th April 2007, 08:43
@Zambelli

can you please look here
http://forum.doom9.org/showthread.php?p=979619#post979619 ? thanks!

feel free to reply here or on automkv thread

thanks again

BHH

ACrowley
5th April 2007, 10:33
thank you

I have one question :
Normally I use ProCoder to encode WVC1.
And i set the WM9 AP Settings with your WMV9 PowerToy.

But i cant find the Complexity Option in the Editor ?
The Option in ProCoder is at Auto and i cant change it.
I think when i set it manually via Registry for WMV9 AP, ProCoder must use Complexity=3 ?
But ProCoder takes more time to encode with the same WMV9 Ap Settings .

And the Lookahead Option ..i can ony select 16 and not 30 in your editor ? 30 not supported at the moment in PowerToy?

EDIT :
2nd Question is now clear.

Ill encode HDDVD/BlueRay to WWVC1 with 1pass CBR 720p 8Mbps 60000Buffer and "better Preset.
Commandline:

cscript.exe c:\windows\wmcmd.vbs -input g:\videoinput.avs -output g:\videooutput.wmv -v_codec WVC1 -videoonly -v_mode 0 -v_preset better -v_bitrate 8000000 -v_keydist 3 -v_buffer 600000 -v_quality 100 -s_config own.weu

zambelli
6th April 2007, 06:19
I have one question :
Normally I use ProCoder to encode WVC1.
And i set the WM9 AP Settings with your WMV9 PowerToy.

But i cant find the Complexity Option in the Editor ?
The complexity can't be set via the registry - it needs to be set by the encoder application.

The Option in ProCoder is at Auto and i cant change it.
I think when i set it manually via Registry for WMV9 AP, ProCoder must use Complexity=3 ?
But ProCoder takes more time to encode with the same WMV9 Ap Settings .
The default complexity is 3, but if ProCoder is taking longer - perhaps it's not using the default complexity. You could try encoding something in ProCoder, measuring the time it takes to encode, and then try encoding the same source in wmcmd.vbs with various complexities - and see which complexity takes the same amount of encoding time. Don't use any advanced settings for that test though.

And the Lookahead Option ..i can ony select 16 and not 30 in your editor ? 30 not supported at the moment in PowerToy?
Well, I changed the range in the script, but the Lookahead distance maximum is in fact hardcoded to 16 - so I'll probably be changing that back in the next script release. I got a little ahead of myself on that one.

cscript.exe c:\windows\wmcmd.vbs -input g:\videoinput.avs -output g:\videooutput.wmv -v_codec WVC1 -videoonly -v_mode 0 -v_preset better -v_bitrate 8000000 -v_keydist 30 -v_buffer 600000 -v_quality 100 -s_config own.weu
If using CBR mode, you generally don't want to use quality 100. That'll force the encoder to drop frames when the bitrate gets too low to maintain high image quality. If the encoder reports dropped frames or a framecount significantly smaller than the source framecount, change quality to 50 or lower. Otherwise, you can leave it for this encode.

ACrowley
6th April 2007, 07:23
If using CBR mode, you generally don't want to use quality 100. That'll force the encoder to drop frames when the bitrate gets too low to maintain high image quality. If the encoder reports dropped frames or a framecount significantly smaller than the source framecount, change quality to 50 or lower. Otherwise, you can leave it for this encode.


Mh... i never had Problems with dropped Frames from 1pass CBR encodes and quality 100. Not with SoftwarePlayers or Xbox360.
Xbox360 Playback is the main reason for my encodes
When i set it down to 50 isnt the Quality lower ?

And the encode is definitely faster with wmcmd.vbs copared with ProCoder..for the first look.
This encode now with wmcmd.vbs and the same WMV9 AP Settings took around 20h.
Its a 1080p HDDVD/VC1 164minutes 2.35:1 AR.
I encode to 1280x528( cropped) 8mbps WVC1 and the commandline from above.
With ProCoder a similar encode (same avs script,WVC1 Settings) took minimum 24h to encode !

However, i will use wmcmd.vbs in the future, so i have safely full control over all WMV9 AP Settings

A question about ProCoder:
What is the encoder doing in CBR 1pass encodes ?
I mean the File writing beginns until the Process Bar is in the Middle around 50%..other WMV encoders in 1pass CBR Mode starts to write directly at the beginning
Is it a kind of caching or analyzing whether ist 1pass ?

killerhex
8th April 2007, 00:36
hey how do i create presets for this encoder

buzzqw
8th April 2007, 10:20
for truly preset integrated in wmcmd.vbs (like these one ceated by Zambelli, fast, insane,better,good...) you must edit the wmcmd.vbs and add some line of code (not much... )

BHH

zambelli
8th April 2007, 10:52
for truly preset integrated in wmcmd.vbs (like these one ceated by Zambelli, fast, insane,better,good...) you must edit the wmcmd.vbs and add some line of code (not much... )
And if anyone has feedback about existing presets or suggestion for how to tweak them - I'm all ears.

Sagittaire
8th April 2007, 11:35
And if anyone has feedback about existing presets or suggestion for how to tweak them - I'm all ears.

Possible to active adaptative bframe ... ???

ACrowley
8th April 2007, 16:08
First i thought it was my mistake, but its true

From my current encode to WVC1 720p 9Mbps 1pass CBR :

cscript.exe C:\windows\wmcmd.vbs -input d:\test.avs -output d:\test100.wmv -v_codec WVC1 -videoonly -v_mode 0 -v_bitrate 9000000 -v_preset better -v_keydist 30 -v_buffer 60000 -v_quality 100


The End Filesize is calculated to 7.5gb, but with Quality 80 its only 5,2 GB ?!


Test Sample encodes on H264 1080p Source:

These are the Statistics fter wmcmd.vbs encoding :
1 : v_quality 80 :

Video :
Codec: Windows Media Video 9 Advanced Profile
Expected bit rate: 9000000 bps
Average bit rate: 5912122 bps
Expected fps: 25
Dropped frame count: 0
Total coded frames: 535
Average sample rate: 25
Dropped bytes: 0 bytes
Total bytes: 15847906 bytes

Overall:
Encoding time: 171 seconds
Average bit rate: 5912122 bps
File size: 15933546 bytes
File duration: 21,393 seconds


2. v_quality 100

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

Video :
Codec: Windows Media Video 9 Advanced Profile
Expected bit rate: 9000000 bps
Average bit rate: 8986305 bps
Expected fps: 25
Dropped frame count: 0
Total coded frames: 535
Average sample rate: 18,848
Dropped bytes: 0 bytes
Total bytes: 24957774 bytes

Overall:
Encoding time: 177 seconds
Average bit rate: 8986305 bps
File size: 25077546 bytes
File duration: 21,393 seconds



So you can see with quality 80 the Output Filesite is smaller Q 80 is only 15MB, Q 100 is 23.9
The Average Bitrate with Q 80 is only at 5.9Mps
With Quality 100 its more efficient ?! with 8.9mbps

No dropped Frames with Q 100...i never had any dropped Frames in the past

So, whats up here ? Why controlls Quality Targetsize / Bitrate in 1pass CBR Mode ?

Mh...maybe ill switch to 2pass VBR

Clown shoes
8th April 2007, 18:33
I am very interested in encoding for maximum quality so the insane profile looks great. Would I gain anything from changing -v_performance to 100 and motion search level to luma and chroma? I have a dual quad core system, so hopefully that will cut the increased encoding time a little.

There seems to be very few people now using a two pass vbr system. Is there any reason for this bar encoding time? I want to encode my HD material to HQ files that will work on my Xbox360, getting as much out of the source as possible. Surely 2 pass VBR is the way to go?

My cmd line is as follows;

cscript.exe C:\Windows\wmcmd.vbs -input C:\test.avs -output C:\test.wmv -v_codec WVC1 -videoonly -v_mode 4 -v_bitrate 8000000 -v_peakbitrate 15000000 -v_preset insane -v_keydist 15 -v_buffer 60000

Clown shoes
8th April 2007, 22:33
I'm having problems encoding my audio with WMCmd.vbs I'm using an avisynth script Nicac3Source("C:\WMV encoding\Test\SAMPLE PID 081 T01 3_2ch 448Kbps DELAY 199ms.ac3", DRC=1) and my cmd line is cscript.exe C:\Windows\wmcmd.vbs -input C:\audio test.avs -output C:\audio.wma -a_codec WMAPRO -a_mode 0 -a_setting 440_48_6_24 -audioonly when I run my .bat it closes immediately. Any obvious mistakes I'm making?

zambelli
8th April 2007, 22:44
First i thought it was my mistake, but its true

cscript.exe C:\windows\wmcmd.vbs -input d:\test.avs -output d:\test100.wmv -v_codec WVC1 -videoonly -v_mode 0 -v_bitrate 9000000 -v_preset better -v_keydist 30 -v_buffer 60000 -v_quality 100

So, whats up here ? Why controlls Quality Targetsize / Bitrate in 1pass CBR Mode ?

The v_quality is not the problem here. The problem is that you are encoding a 22 second source using a 60 second buffer. The ratecontrol can't possibly be accurate if it doesn't even get a chance to fill the buffer. The filesize you are getting is completely inproportionate to the bitrate - that should've been a clue right there. If you're using CBR, you must never set the buffer longer than the source itself - or else the ratecontrol will never have a chance to be correct.

zambelli
8th April 2007, 23:02
I am very interested in encoding for maximum quality so the insane profile looks great. Would I gain anything from changing -v_performance to 100 and motion search level to luma and chroma? I have a dual quad core system, so hopefully that will cut the increased encoding time a little.
-v_performance 100 will be much slower, but the quality increase will be so miniscule (if at all) it is really not worth it. Trust me. Motion Search in "insane" is already set to include full chroma at all times.
"Insane" is pretty much as good as it gets in motion estimation. Room for additional improvements exist in tweaking the v_bdeltaqp value (try 1 or 2 for start), v_dquantoption (2 if anything) and v_percopt (2 or 3 might work). The latter 2 options are likely to introduce some smoothing in certain areas in exchange for preserving finer detail in others. They are "perceptual optimizations". The video might look worse in an A/B comparison to the source, but it might actually be more visually pleasing when no reference is available. They're aren't "one size fits all" settings, though.

There seems to be very few people now using a two pass vbr system. Is there any reason for this bar encoding time? I want to encode my HD material to HQ files that will work on my Xbox360, getting as much out of the source as possible. Surely 2 pass VBR is the way to go?
Most Xbox users have reported that the current WMV decoder can't handle bitrates above a certain level - so that's why most people are using CBR for Xbox encoding. The good news is that there will possibly be a new WMV decoder in the next Xbox dashboard update that will be capable of handling high bitrates as good as the HD-DVD VC-1 decoder currently can.

cscript.exe C:\Windows\wmcmd.vbs -input C:\test.avs -output C:\test.wmv -v_codec WVC1 -videoonly -v_mode 4 -v_bitrate 8000000 -v_peakbitrate 15000000 -v_preset insane -v_keydist 15 -v_buffer 60000
You might be able to run that on the Xbox. Search the forums a little, see what other users have reported as practical high bitrates currently smoothly handled by the Xbox. BTW, the v_buffer setting won't do anything in that cmd line - it's the v_peakbuffer setting that matters in peak-constrained VBR mode. It is 5 sec by default.

I'm having problems encoding my audio with WMCmd.vbs I'm using an avisynth script Nicac3Source("C:\WMV encoding\Test\SAMPLE PID 081 T01 3_2ch 448Kbps DELAY 199ms.ac3", DRC=1) and my cmd line is cscript.exe C:\Windows\wmcmd.vbs -input C:\audio test.avs -output C:\audio.wma -a_codec WMAPRO -a_mode 0 -a_setting 440_48_6_24 -audioonly when I run my .bat it closes immediately.
Can you verify that the .avs plays back in GraphEdit or MPC? When played in MPC, what kind of info is the "Pin Info" tab showing under Play-->Filters-->Audio Switcher-->Properties? For stereo audio you might see something like this:

AM_MEDIA_TYPE:
majortype: MEDIATYPE_Audio {73647561-0000-0010-8000-00AA00389B71}
subtype: MEDIASUBTYPE_PCM {00000001-0000-0010-8000-00AA00389B71}
formattype: FORMAT_WaveFormatEx {05589F81-C356-11CE-BF01-00AA0055595A}
bFixedSizeSamples: 1
bTemporalCompression: 0
lSampleSize: 1
cbFormat: 18

WAVEFORMATEX:
wFormatTag: 0x0001
nChannels: 2
nSamplesPerSec: 48000
nAvgBytesPerSec: 192000
nBlockAlign: 4
wBitsPerSample: 16
cbSize: 0 (extra bytes)

That pin info indicates what kind of audio format the Avisynth script is outputting and may help me troubleshoot the issue. I agree that multichannel audio input is somewhat of a sore spot in Wmcmd.vbs right now. I'll look into the option of adding separate audio inputs from the command line (currently -input expects audio and video muxed) and perhaps support for multi mono WAV inputs, if nothing else works.

Clown shoes
8th April 2007, 23:39
The .avs is being opened in Graphedit with ac3filter and displays all the channels correctly. The MPC pin info is as follows;

AM_MEDIA_TYPE:
majortype: MEDIATYPE_Audio {73647561-0000-0010-8000-00AA00389B71}
subtype: MEDIASUBTYPE_PCM {00000001-0000-0010-8000-00AA00389B71}
formattype: FORMAT_WaveFormatEx {05589F81-C356-11CE-BF01-00AA0055595A}
bFixedSizeSamples: 1
bTemporalCompression: 0
lSampleSize: 1
cbFormat: 40

WAVEFORMATEX:
wFormatTag: 0xfffe
nChannels: 6
nSamplesPerSec: 48000
nAvgBytesPerSec: 576000
nBlockAlign: 12
wBitsPerSample: 16
cbSize: 22 (extra bytes)

WAVEFORMATEXTENSIBLE:
wValidBitsPerSample: 16
dwChannelMask: 0x0000003f
SubFormat: {00000001-0000-0010-8000-00AA00389B71}

pbFormat:
0000: fe ff 06 00 80 bb 00 00 00 ca 08 00 0c 00 10 00 þÿ..€»...Ê......
0010: 16 00 10 00 3f 00 00 00 01 00 00 00 00 00 10 00 ....?...........
0020: 80 00 00 aa 00 38 9b 71 €..ª.8›q


What other options would I have to seperately encode audio to .wma? Windows media encoder throws an error when I try using it.

zambelli
9th April 2007, 00:18
What other options would I have to seperately encode audio to .wma? Windows media encoder throws an error when I try using it.
If you decode the AC3 to 6 mono WAV files using BeSweet, WME9 will take the 6 mono inputs and let you encode to multichannel WMA Pro.

Clown shoes
9th April 2007, 00:21
OK, I've worked out the problem. There was a space in the name of my .avs that was tripping up the command line. Once I took that out, it worked perfectly. I did notice one thing however. During my tests I tried encoding the raw .ac3, which was accepted without issue, but there was a small boosting of the levels which caused them to clip slightly. The .avs didn't have that problem.

zambelli
9th April 2007, 02:05
OK, I've worked out the problem. There was a space in the name of my .avs that was tripping up the command line. Once I took that out, it worked perfectly. I did notice one thing however. During my tests I tried encoding the raw .ac3, which was accepted without issue, but there was a small boosting of the levels which caused them to clip slightly. The .avs didn't have that problem.
When encoding from .ac3, AC3Filter or whatever other AC3 DShow decoder you have handles the decoding. When you use .avs, you're explicitly using Nic's AC3 plugin for decoding.

Clown shoes
9th April 2007, 02:52
Thanks Zambelli,

The reason I mention the audio issue is because it only becomes apparent once the .wma has been produced and only then when the source was the .ac3. The levels when the source is decoded normaly are fine and also when Nic's filter is used. It's just strange that .ac3 to .wma via WMCmd.vbs is the only workflow where I see this boosting of the levels.

I have read through the thread you refered to from last year regarding VC1 on the xbox360 and it appears my settings are well within safe limits. Halim even said that at 24fps, a bitrate of 20000kbps might be possible. if I wanted to produce 1080p files that would play back smoothly on the 360, do you think my settings of 8000kbps average and 15000kbps peak would be too high? There was also mention of the bitrate limitations being fixed in the next dashboard update. Is there any news on a ball park release date? Sorry I know that's not your your department, but I know you know some of the guys that do work more in that area :)

ACrowley
9th April 2007, 08:17
The v_quality is not the problem here. The problem is that you are encoding a 22 second source using a 60 second buffer. The ratecontrol can't possibly be accurate if it doesn't even get a chance to fill the buffer. The filesize you are getting is completely inproportionate to the bitrate - that should've been a clue right there. If you're using CBR, you must never set the buffer longer than the source itself - or else the ratecontrol will never have a chance to be correct.

ok..but V_quality is surly the Problem here

Same Results with all Buffer sizes 2,3,5,default on the sample
Also the Full 156min Movie is only 5.2 Gb and not 7.5 GB (without Audio).
Q 100 always give me exactly the calculated Targetsize

Same Problem on Full Movie

Quality 80:

Expected bit rate: 9000000 bps
Average bit rate: 5912122 bps

Q 100

Expected bit rate: 9000000 bps
Average bit rate: 8986305 bps


I think i will stick with Q100...cause i had never dropped Frame or somewhat

zambelli
9th April 2007, 10:45
Same Problem on Full Movie
Quality 80:
Expected bit rate: 9000000 bps
Average bit rate: 5912122 bps
Q 100
Expected bit rate: 9000000 bps
Average bit rate: 8986305 bps
:confused: But these are the same exact bitrate numbers you quoted earlier for a 23 second source. You're saying the bitrates turned out exactly the same for a 23 second source and 156 minute source? That doesn't sound right.

ACrowley
9th April 2007, 11:57
Yes ?

Same Source ,same commandline ,same CBR Bitrate

Gives me the same Results, the Log is from the Sample ,yes, but the Full encode shows the same.
I dont have the Log for the Full encode...but believe me its the same Problem

However....with Q80 its over 2Gb to small, thats the Main Point

I can reproduce it with any Source. Everytime the same Problem. So ,its not my mistake or somewaht.

Its simply the Q 80 what makes the Output File smaller with lower average Bitrate as it should be in 1pass CBR

@clownshoes
So far i can say about Peak Bitrate and Xbox360 is that i noticed choppy Playback sometimes.
It was a 9mbps Bitrate with 13.5Mbps Peak and the Video was choppy/freezing
With CBR no Problems.

zambelli
9th April 2007, 19:52
Yes ?
Same Source ,same commandline ,same CBR Bitrate
Gives me the same Results, the Log is from the Sample ,yes, but the Full encode shows the same.
I dont have the Log for the Full encode...but believe me its the same Problem
OK, something is fundementally wrong here. The chances of encoding a 23-second source and 156-minute source and getting the exact same bitrate as result - are almost impossible. That's like scoring the same lottery numbers twice in a row.

However....with Q80 its over 2Gb to small, thats the Main Point
I'm not sure your target bitrate calculation is correct either. A 7.5 GB target would require a bitrate of ~6828 kbps for a 156 minute source. Even if you got 9000 kbps, the size would be more than 7.5 GB.

I can reproduce it with any Source. Everytime the same Problem. So ,its not my mistake or somewaht.
Well, I'm not necessarily saying it's your mistake, but it sounds like there's a bigger problem present than codec ratecontrol just being slightly off.

Its simply the Q 80 what makes the Output File smaller with lower average Bitrate as it should be in 1pass CBR
I think there's something else going on here. How long does it currently take to encode your 156 minute source? What version of WM Format or WMP do you have installed?

Would you be able to upload an encoded 23-second WMV sample somewhere? Quality 80 or 100, doesn't matter.

twan69666
9th April 2007, 20:35
Hey Clownshoes,

The spring dashboard update is rumored to be out May 7th, and will be adding H.264 support along with some better mpeg 4 support. Im still going to tinker with HDDVD backups, but hopefully this update begins to unlock the 360's power

Clown shoes
9th April 2007, 22:52
Yeah, I read that today. Excellent news :)

ACrowley
10th April 2007, 08:13
OK, something is fundementally wrong here. The chances of encoding a 23-second source and 156-minute source and getting the exact same bitrate as result - are almost impossible. That's like scoring the same lottery numbers twice in a row.


I'm not sure your target bitrate calculation is correct either. A 7.5 GB target would require a bitrate of ~6828 kbps for a 156 minute source. Even if you got 9000 kbps, the size would be more than 7.5 GB.


Well, I'm not necessarily saying it's your mistake, but it sounds like there's a bigger problem present than codec ratecontrol just being slightly off.


I think there's something else going on here. How long does it currently take to encode your 156 minute source? What version of WM Format or WMP do you have installed?

Would you be able to upload an encoded 23-second WMV sample somewhere? Quality 80 or 100, doesn't matter.

i only told you the Results form the sample and the Full encode are similar. not the same!
For the Full Movie the encoded CBR Bitrate of 9mbps is only at 5.xMbps and not cloe to 9mbps as lile as with Q 100

Theres is nothing wrong here...believe me
Im encoding for a long time since today, and im not a Idiot or a newbie on this encoding Stuff
I use the latest WM11 Build wirh WVC1 with latest wmcmd.vbs

YOUR Calculator :
1h56min with a 8138MB (DVD9) Target and 640kbps Audio is : 9076.599

ALL encodes are by far to small with Q 80
With 120minutes and 185minutes, 20sec Samples... Wether Bitrate for VBR is calculated. ALL are to small with to low average Bitratel!

Why dont you make a small test by your own ?
Im sure your 1pass CBR encode with Q80 is smaller (with lower effective average Bitrate) and im sure everybody can reproduce it

I dont say the Codec Rate Control is wrong...works perfect (1passs CBR Q100/ 2pass VBR ),but in CBR 1pass the Quality Parameter seems to have this effect

Clown shoes
10th April 2007, 10:21
Yes I can confirm this. I just encoded a 2 hour film with similar settings to Crowley, except I left Q at the default of 75. cscript.exe C:\Windows\WMCmd.vbs -input I:\Serenity.avs -output H:\Serenity.wmv -v_codec WVC1 -videoonly -v_mode 0 -v_preset better -v_bitrate 9000000 -v_buffer 600000 Calculations tell me this should have come in at nearly 8gig, however the file I have is just under 5gig.

zambelli
10th April 2007, 10:48
OK, I'll look into it and run some tests. BTW, Clownshoes, that 600 sec buffer is way too big (unless it was a typo). At 9 Mbps that means a decoder would need to allocate 640MB of memory to play back the video. I'd be very careful about ever allocating more than 60 seconds for the video buffer length.

buzzqw
10th April 2007, 10:56
just for report a humble test with Matrix film
Aimed at 700MB, this is the command line
cscript.exe WMCmd.vbs -input "movie.avs" -output "movie.wmv" -v_codec WVC1 -v_mode 3 -v_bitrate 564000 -s_config "wmv_crb" -v_preset best -v_dquantoption 3 -v_bdeltaqp 1 -a_codec wmapro -a_mode 0 -title "VTS_02_0" -year 2007 -copyright "Done with AutoMKV! 0.80b" -a_setting 128_48_2_24

after 07h:49m:42s have a pleasing 704*304 wmv of 710mb.. just a little more mb then expected... (bitrate computed is correct)

BHH

Clown shoes
10th April 2007, 11:08
I think the issue is only with video mode 0, constant bitrate.

@Zambelli, yes thanks for noticing that. An extra pesky 0 got into my script :)

ACrowley
10th April 2007, 13:31
Sounds like you're encoding in 1-pass VBR mode. In that mode higher complexity/performance will only decrease the size of the encoded file because the quality is fixed (hence the name "Quality VBR"). In every other mode the bitrate will stay the same but the quality will improve due to better motion estimation algorithms used.

Also, encoding times change dramatically between 0 and 80. You can go literally from faster-than-realtime encoding to wake-me-up-when-it's-done encoding.

I dont know what i should tell you more...
I encode in 1pass CBR , -v_codec wvc1 -v_mode 0

Batch :
cmd /k cscript.exe C:\windows\wmcmd.vbs -input g:\Parfuem\Parfuem.avs -output g:\parfuem\parfuem.wmv -v_codec WVC1 -videoonly -v_mode 0 -v_bitrate 7020000 -v_preset better -v_buffer 60000 -v_quality 100


However, i have no dropped Frames .. so i use Q100
Q 100 holds exactly the definied Bitrate ,works perfect ,No Problems

And when the new xbox360 Update is there ,perhaps i encode 2pass VBR Peak

Clownshoes can REPRODUCE IT !!, so ....its 100% not my mistake

Clown shoes
10th April 2007, 13:47
@Crowley

I'm going to try a 2 pass peak encode now. Average 9000kbps peak 12000kbps. That should stay within current acceptable limits for the 360. I can't wait untill the update when we can really test out VC1 capabilities.

cscript.exe C:\Windows\WMCmd.vbs -input I:\Serenity.avs -output H:\Serenity.wmv -v_codec WVC1 -videoonly -v_mode 4 -v_preset best -v_bitrate 9000000 -v_peakbitrate 12000000 -v_buffer 60000

@Zambelli, can you tell me the difference between the performance and complexity settings? and do they have any use in a peak VBR encode?

ACrowley
10th April 2007, 14:12
me to...VC1 becomes Mutithreading with the Update..nice

12Mbps Peak should be close to the max. Peak for the current Decoder
On my U571 HDDVD reencode in 720p WVC1 ~9Mbps and 13.5Mbps Peak it was not smooth

But i am satisfied with 1pass CBR at high Bitrates.
With preset better ,a 60000Buffer ,Q100,and min. 7Mbps for 720p, min. 14Mbps for 1080p ,it delivers very good Quality

After the Update i will encode 2pass VBR Peak.
But 1 Problem is left with the 360 and Peak Bitrate.
So far i know The Update is only for the Dashboard!
For H264 i know it surely, No MediaCenter and H264.

When its for WMV9 AP too, we can only use VC1 High in Dashboard/GameDrive/ MediaConnect

We will see

zambelli
10th April 2007, 20:13
@Zambelli, can you tell me the difference between the performance and complexity settings? and do they have any use in a peak VBR encode?
Yes, performance/complexity is used in every mode. It affects many things, most related to motion estimation precision. 60/3 is the default. You can try 80/4 and 40/2 for slower/faster encoding, but I wouldn't recommend going higher or lower than that.

Clown shoes
10th April 2007, 20:43
What I meant was, complexity is listed under the wmcmd.vbs readme as "Same as v_performance but expressed on a scale from 0 to 5" So do they do exactly the same thing? and if so, why do they both exist?

zambelli
11th April 2007, 05:39
What I meant was, complexity is listed under the wmcmd.vbs readme as "Same as v_performance but expressed on a scale from 0 to 5" So do they do exactly the same thing? and if so, why do they both exist?
Yes, they're exactly the same. Internally the codec complexity levels are mapped on a scale from 0 to 5, so it's always been unnecessarily confusing to have v_performance on a 0 to 100 scale in 20 point increments. It just made more sense to call complexity what it is and express it on its native scale.

zambelli
12th April 2007, 06:06
cscript.exe C:\windows\wmcmd.vbs -input g:\Parfuem\Parfuem.avs -output g:\parfuem\parfuem.wmv -v_codec WVC1 -videoonly -v_mode 0 -v_bitrate 7020000 -v_preset better -v_buffer 60000 -v_quality 100
Well, I tried this on two sources: one a 704x384 24p 3 minute source, and the other a 1280x720 25p 2.5 minute source. I used a target bitrate of 1000kbps and 7000kbps respectively.

I tried quality 100, 80 and 50 and the bitrates came out about the same, within 2% of the target bitrate. So I'm really not sure what's causing the bitrate issues you're seeing. :confused:

Can you try using a smaller bitrate and see if you get similar behavior? How about if you use a higher bitrate?

zambelli
12th April 2007, 12:58
New version of WMCmd.vbs is out. Here's the changelist:

4-12-2007:
----------
IMPORTANT CHANGE: Remapped -v_mslevel (Motion Search Level) values to correctly reflect the codec implementation. 0 is now the default luma search and 3 and 4 are adaptive chroma modes. If you're using WMCmd.vbs in another tool (i.e. AutoMKV), make sure you update your code.
Added an -a_input option that allows specifying an alternative audio source to the one present in the main -input source. This makes it possible to use separate video and audio source files from the command-line, as it's always been possible in the WME9 GUI.
Updated the documentation, expanded sections on dquant and perceptual optimization options. Very useful options for preserving fine detail.
Fixed a bug where simultaneous encoding jobs would get simultaneously killed as soon as one encoding job finished.

NHRaider
12th April 2007, 13:28
noob question...

When I run the script, I get the warning: "Warning: Encoder failed to retrieve duration attribute from source plug-in. Trying alternate method now...".

When I use the calculated frames from EVO in video.avs (below), it doesn't come back with the calculated time, percentage complete, etc. It will encode the movie but the script looks like it doesn't complete and never closes and provide the stats for encoding. Also, the movie doesn't allow fast forward etc. (Note: the output file will not have a duration in Explore when I look at the directory)

If I don't specify framecount in the video.avs it will find a duration and give me the % completion, etc. However, the video stops at 50 minutes during playback but the audio will continue. (Note: the output file will have a duration in Explore when I look at the directory and will be the correct duration time 1:39)


How can I run the script to get the fastforward feature and also get duration information so I know progress on the encoding??


*********************************************

For the video.avs:
Directshowsource("video_only.GRF", fps=23.976, audio=false, seekzero=false, seek=true).trim(0,140000)

Generate.bat:
cscript.exe "c:\program files\windows media components\encoder\wmcmd.vbs" -input "audioandvideo.avs" -output "output.wmv" -v_codec wmv9 -v_mode 0 -v_bitrate 8000000 -v_keydist 30 -v_buffer 600000 -v_quality 75 -a_codec WMAPRO -a_mode 0 -a_setting 384_48_6_16

ACrowley
12th April 2007, 15:52
seems to be normal when you encode via Directshowsoucre ,that wmcmd use a alternative Method to load the Source..
Dont know what it means, but i have thge same Mesaage without Problems.

Your seeking Problem:
You can seek the output after the encode is finished cause the wmv index is complete. Then you have your duration and full seeking.
When you want to fix a aborted output , run it through WMStreameditor

I made a lot of HDDVD VC1 encodes with Directshowsource and SonicVideoDecoder.
WMcmd shows me the correct Source duration in seconds and after encoding the Stats have the correct Framecount with encoded frames and the Output is perfect

For example :

C:\Programme\Windows Media-Komponenten\Encoder>cmd /k cscript.exe C:\windows\wmc
md.vbs -input g:\Parfuem\Parfuem.avs -output g:\parfuem\parfuem.wmv -v_codec WVC
1 -videoonly -v_mode 0 -v_bitrate 7020000 -v_preset better -v_buffer 60000 -v_qu
ality 100
Microsoft (R) Windows Script Host, Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. Alle Rechte vorbehalten.

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


Warning: Encoder failed to retrieve duration attribute from source plug-in.
Trying alternate method now......
Source duration retrieved: 8853,943 seconds.

Encoded: 8853,6s (100%) Elapsed: 17:14:02 Left: 00:00:02 [0,14x]

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

Video :
Codec: Windows Media Video 9 Advanced Profile
Expected bit rate: 7020000 bps
Average bit rate: 6719201 bps
Expected fps: 23,976
Dropped frame count: 0
Total coded frames: 212282
Average sample rate: 23,952
Dropped bytes: 0 bytes
Total bytes: 7436396454 bytes

Overall:
Encoding time: 62053 seconds
Average bit rate: 6719201 bps
File size: 7470570538 bytes
File duration: 8853,934 seconds

C:\Programme\Windows Media-Komponenten\Encoder>

zambelli
12th April 2007, 19:47
When I run the script, I get the warning: "Warning: Encoder failed to retrieve duration attribute from source plug-in. Trying alternate method now...".
Yeah, that's normal when using .avs as sources.

If I don't specify framecount in the video.avs it will find a duration and give me the % completion, etc. However, the video stops at 50 minutes during playback but the audio will continue. (Note: the output file will have a duration in Explore when I look at the directory and will be the correct duration time 1:39)
How can I run the script to get the fastforward feature and also get duration information so I know progress on the encoding??
Are you encoding the video and audio separately? If you're muxing them together in the .avs file, can you verify they are the same length?
WMcmd is just relying on DirectShow and WMP to report the correct lengh of the .avs source. If you can get it to play back in WMP - it will report the correct length in Wmcmd too.

buzzqw
12th April 2007, 20:18
just to report that the update version will crash cscript.exe using -a_input (on win 2003 server) BUT is ok on winxp pro...

on win2k3 without using the -a_input but feeding wmcmd.vbs with avs that dubbed audio and video is working

One more: seems that -v_percopt isn't use in your preset (at last looking inside wmvcmd.vbs), why ?

BHH

buzzqw
12th April 2007, 22:36
dosbox running cscript wmcmd.vbs remain open after end encoding :confused: , usually it close itself... (again with new update, without using -a_input)

BHH

NHRaider
13th April 2007, 01:05
Yeah, that's normal when using .avs as sources.


Are you encoding the video and audio separately? If you're muxing them together in the .avs file, can you verify they are the same length?
WMcmd is just relying on DirectShow and WMP to report the correct lengh of the .avs source. If you can get it to play back in WMP - it will report the correct length in Wmcmd too.

Audio:
Directshowsource("audio_only.GRF", audio=true, video=false)
Video:
Directshowsource("video_only.GRF", fps=23.976, audio=false, seekzero=false, seek=true).trim(0,140000)
Audioandvideo Input File to script:
video = import("video_only.avs")
audio = import("audio_only.avs")
AudioDub(video,audio)


When I open the AudioandVideo.avs, VirtualDub it says video duration is 1:34:35 and the audio duration is 1:37:13.

The problem I have is that when I don't specify framecount or .trim the video, then it shows all the information about the duration, progress of encoding then final statistics, BUT the video seems to stop encoding around 50 minutes.

When I do use .trim in video, after it mentions the "cant' find duration", it doesn't detail any durations, etc... And when I play back, it doesn't show duration or allow Fast Forward...

Is there something wrong with how I need to specify the framecount in video.avs?

NHRaider
13th April 2007, 01:09
seems to be normal when you encode via Directshowsoucre ,that wmcmd use a alternative Method to load the Source..
Dont know what it means, but i have thge same Mesaage without Problems.

Your seeking Problem:
You can seek the output after the encode is finished cause the wmv index is complete. Then you have your duration and full seeking.
When you want to fix a aborted output , run it through WMStreameditor

I made a lot of HDDVD VC1 encodes with Directshowsource and SonicVideoDecoder.
WMcmd shows me the correct Source duration in seconds and after encoding the Stats have the correct Framecount with encoded frames and the Output is perfect

For example :

C:\Programme\Windows Media-Komponenten\Encoder>cmd /k cscript.exe C:\windows\wmc
md.vbs -input g:\Parfuem\Parfuem.avs -output g:\parfuem\parfuem.wmv -v_codec WVC
1 -videoonly -v_mode 0 -v_bitrate 7020000 -v_preset better -v_buffer 60000 -v_qu
ality 100
Microsoft (R) Windows Script Host, Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. Alle Rechte vorbehalten.

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


Warning: Encoder failed to retrieve duration attribute from source plug-in.
Trying alternate method now......
Source duration retrieved: 8853,943 seconds.

Encoded: 8853,6s (100%) Elapsed: 17:14:02 Left: 00:00:02 [0,14x]

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

Video :
Codec: Windows Media Video 9 Advanced Profile
Expected bit rate: 7020000 bps
Average bit rate: 6719201 bps
Expected fps: 23,976
Dropped frame count: 0
Total coded frames: 212282
Average sample rate: 23,952
Dropped bytes: 0 bytes
Total bytes: 7436396454 bytes

Overall:
Encoding time: 62053 seconds
Average bit rate: 6719201 bps
File size: 7470570538 bytes
File duration: 8853,934 seconds

C:\Programme\Windows Media-Komponenten\Encoder>

Can you show me your video.avs so I can see how you represent the framecount? I don't get anything below "Trying alternate method now......" if I use .trim or framecount.

And the bigger problem is not being able so fast forward.

zambelli
13th April 2007, 01:36
just to report that the update version will crash cscript.exe using -a_input (on win 2003 server) BUT is ok on winxp pro...
Hmm, that's really strange. Same source? Same codecs used?

One more: seems that -v_percopt isn't use in your preset (at last looking inside wmvcmd.vbs), why ?
Because it's a perceptual optimization setting. It introduces a tradeoff in quality between certain areas. It's very subjective. It might work well on some content and poorly on others. I don't plan on using v_percopt or v_dquantoption in any of the presets. That should be up to the user to experiment with and add as necessary.

dosbox running cscript wmcmd.vbs remain open after end encoding , usually it close itself... (again with new update, without using -a_input)
Damn, I was hoping that wouldn't happen. What is your exact command line?

buzzqw
13th April 2007, 08:24
Hmm, that's really strange. Same source? Same codecs used?

exactly same source and same command line (but without using -a_input is ok on both)

Damn, I was hoping that wouldn't happen. What is your exact command line?

this is one
cscript.exe "C:\Programmi\PureBasic4\AutoMKV\exe\encoder\WMCmd.vbs" -input "C:\Programmi\PureBasic4\AutoMKV\test\temp\movie.avs" -output "C:\Programmi\PureBasic4\AutoMKV\test\temp\movie.wmv" -v_codec WMV7 -v_mode 3 -v_bitrate 531403 -s_config "C:\Programmi\PureBasic4\AutoMKV\test\temp\wmv_crb" -v_bframedist 1 -v_dquantoption 2 -v_lookahead 0 -v_mbmodecost 0 -v_mmatch 0 -v_msrange 0 -v_mvcoding 1 -v_mvcost 0 -v_bdeltaqp 1 -a_codec WMASTD -a_mode 0 -title "_aaa" -year 2007 -copyright "Done with AutoMKV! 0.80d" -a_setting 96_44_2

and

cscript.exe "C:\Programmi\PureBasic4\AutoMKV\exe\encoder\WMCmd.vbs" -input "C:\Programmi\PureBasic4\AutoMKV\test\temp\movie.avs" -output "C:\Programmi\PureBasic4\AutoMKV\test\temp\movie.wmv" -v_codec WVC1 -v_mode 3 -v_bitrate 437653 -s_config "C:\Programmi\PureBasic4\AutoMKV\test\temp\wmv_crb" -v_preset fast -v_bframedist 1 -v_dquantoption 3 -v_bdeltaqp 1 -a_codec wmapro -a_mode 0 -title "_aaa" -year 2007 -copyright "Done with AutoMKV! 0.80d" -a_setting 192_48_2_16

something gotta strange on my pcs, on winxp those script hang... and on win2003srv not hang!

i have installed same softwares (WMEncoder9.exe + wmfdist11.exe+wmp11) on both machine...
can i give more information for resolve ?

thanks!

BHH

NHRaider
13th April 2007, 13:12
seems to be normal when you encode via Directshowsoucre ,that wmcmd use a alternative Method to load the Source..
Dont know what it means, but i have thge same Mesaage without Problems.

Your seeking Problem:
You can seek the output after the encode is finished cause the wmv index is complete. Then you have your duration and full seeking.
When you want to fix a aborted output , run it through WMStreameditor



It's not what I anticipated but it works. When I use Sonic Video Decoder it says the movie is only 50 minutes and stops there. But it does show duration and the statistics post encode.

When I use Intervideo Video Decoder, it says the movie is 1:37, but it does NOT show any duration or statistics and the cmd window sort of stays open and does nothing. I have to check to see if the file has stopped growing to know it's competed. Then there is no Fast Forward!

So, I tried your WMStreameditor and it seems to work to put he duration back on the file..

Not sure why sonic thinks the movie is 1/2 as long as it should be...

ACrowley
13th April 2007, 14:02
DirectShowSource("G:\Bourne\Bourne.grf",fps=23.976,framecount=155992,seekzero=false,seek=true,audio=false)

On SonicCinemasterVideoDecoder 4.2 i never had any Problems

The avs shows correct runtime, all other apps, players or somewhat too

Have you demuxed the VC1 from evo properly ? I think you know, the encoding directly from evo is a Mistake ?

What graph are you using ?

The other Way would be to mux the Evo in mkv and use it for encoding.
So you need no Framecount etc..

NHRaider
13th April 2007, 14:19
DirectShowSource("G:\Bourne\Bourne.grf",fps=23.976,framecount=155992,seekzero=false,seek=true,audio=false)

On SonicCinemasterVideoDecoder 4.2 i never had any Problems

The avs shows correct runtime, all other apps, players or somewhat too

Have you demuxed the VC1 from evo properly ? I think you know, the encoding directly from evo is a Mistake ?

What graph are you using ?

The other Way would be to mux the Evo in mkv and use it for encoding.
So you need no Framecount etc..


Not sure what the problem is but SonicCinemasterVideoDecoder 4.2 seems to stop video at 50minutes.

I have demuxed to .vc1 and dts files and am using GraphEdit on those files.

I'm using MS DirectShow SDK Filter Graph Edit.
VC1 Source -> Sonic HD Demux -> Sonic Cinemaster Video Decoder 4.2 -> Null Render (on CC out)

When I run the batch file, I also get a bunch of warnings like:
ContextException thrown by BaseCertificate::GetField [.\BaseCertificate.cpp:903] with context
Field
SAR_FeatureValue
not found in certificate
C:\Program Files\Common Files\Roxio Shared\Certificates8\cp42ppg.rxc

NHRaider
13th April 2007, 14:24
DirectShowSource("G:\Bourne\Bourne.grf",fps=23.976,framecount=155992,seekzero=false,seek=true,audio=false)




How much buffer are you adding on framecount to the calculated frames from EVO demux?

buzzqw
13th April 2007, 14:39
@Zambelli

hi have substituted the function TerminateEncoderProcess() of new build (12/04/2007) with one of old build (22/03/2007 and the script close successfull :)

i will postpone my update to automkv till this issue ins't cleared, or you will allow me to change wmcmd.vbs

BHH

ACrowley
13th April 2007, 15:10
How much buffer are you adding on framecount to the calculated frames from EVO demux?

Buffer ? What for a Buffer ? latest version of Evodemux calculates the Frames 99,9% correct ,or waht do you mean ?
I use exactly the "calculated Framecount" from latest Evodemux

For encoding i use -v_buffer 60000

But i think i know what is your Error !

Use :
Filesource(async)-SoncHDDemuxer-SonicCinemasterVideoDecoder

Not VC1 Source Filter! I dont think it will work properly, with Filesource you have no Problems
No Wonder why you have wrong values .

zambelli
13th April 2007, 18:17
hi have substituted the function TerminateEncoderProcess() of new build (12/04/2007) with one of old build (22/03/2007 and the script close successfull :)

i will postpone my update to automkv till this issue ins't cleared, or you will allow me to change wmcmd.vbs
Hi Buzzqw,

Yeah, that function is the culprit, but I need to figure out what's making it not match the process command-line correctly. It matches the process on my machine correctly, so this must be some weird OS issue it's running into.

In the meantime, feel free to use your modified WMCmd.vbs version with the new AutoMKV release. I'll try to figure out what's causing the hang in the meantime.

Could you also provide the a_input command-line that's making your cscript crash, along with a description of what kind of audio is being sourced (i.e. stereo, 44100 Hz, etc)? Thanks.

buzzqw
13th April 2007, 19:02
cscript.exe "C:\Programmi\PureBasic4\AutoMKV\exe\encoder\WMCmd.vbs" -input "C:\Programmi\PureBasic4\AutoMKV\test\temp\movie.avs" -output "C:\Programmi\PureBasic4\AutoMKV\test\temp\movie.wmv" -v_codec WVC1 -v_mode 3 -v_bitrate 437653 -s_config "C:\Programmi\PureBasic4\AutoMKV\test\temp\wmv_crb" -v_preset fast -v_bframedist 1 -v_dquantoption 3 -v_percopt 1 -v_bdeltaqp 1 -a_input "C:\Programmi\PureBasic4\AutoMKV\test\temp\audio.wav" -a_codec wmapro -a_mode 0 -title "_aaa" -year 2007 -copyright "Done with AutoMKV! 0.80d" -a_setting 192_48_2_16

and this is the audio.wav (4.5mb) http://www.64k.it/andres/data/a/audio.wav

just one info: if i create an avs like this (say audio.avs)
directshowsource("audio.wav")

and feed the wmcmd.vbs, substituting the -a_input "C:\Programmi\PureBasic4\AutoMKV\test\temp\audio.wav"
with -a_input "C:\Programmi\PureBasic4\AutoMKV\test\temp\audio.avs"

the cscript don't crash... could be some setting in ffdshow ? (i use this to decode almost all audio format, besides WMA files...)

one more thing, don't run directly the cscript from dos box... but i build a .bat file and then launch this bat file. Anyway both launching from dos box (by copying the command line) and launch the bat the cscript doesn't close

BHH

zambelli
14th April 2007, 05:05
and this is the audio.wav (4.5mb) http://www.64k.it/andres/data/a/audio.wav

just one info: if i create an avs like this (say audio.avs)
directshowsource("audio.wav")

the cscript don't crash... could be some setting in ffdshow ? (i use this to decode almost all audio format, besides WMA files...)
Thank you for the sample - it explained a lot. That WAV is using IEEE Float precision. If you play it back in MPC, you'll see this in the file properties: IEEE Float 48000Hz stereo 3072Kbps. I'm guessing WME9 tries to process it directly (and fails), whereas DirectShowSource uses Ffdshow to decode and convert it to 16-bit integer PCM.

one more thing, don't run directly the cscript from dos box... but i build a .bat file and then launch this bat file. Anyway both launching from dos box (by copying the command line) and launch the bat the cscript doesn't close

But it closes fine when invoked from a command window?

Are you running Windows in Italian by any chance?

buzzqw
14th April 2007, 09:06
That WAV is using IEEE Float precision
that's true! ... i must "downsample" to 32bit pcm...

But it closes fine when invoked from a command window?

NO. It's doesn't close in command window and not close when launching (from explorer) the bat file

and yes, WinXp Pro Sp2 Italian (but at work... on win2003server SP2 ITALIAN it close ok...)

BHH

zambelli
14th April 2007, 09:34
I've replaced the April 12th build with a new build (dated April 14th) that fixes the bug that was hanging the script at the end of the encode.

http://citizeninsomniac.com/WMV/WMCmd_20070414.zip

buzzqw
14th April 2007, 09:41
I've replaced the April 12th build with a new build (dated April 14th)

:thanks: !

this build fixed my hang problem!!

BHH

NHRaider
14th April 2007, 13:11
Yeah, that's normal when using .avs as sources.


Are you encoding the video and audio separately? If you're muxing them together in the .avs file, can you verify they are the same length?
WMcmd is just relying on DirectShow and WMP to report the correct lengh of the .avs source. If you can get it to play back in WMP - it will report the correct length in Wmcmd too.

After a little experimentation I found the duration issue!

When I use:
Directshowsource("video_only.GRF", fps=23.976, audio=false, framecount = 145000, seekzero=false, seek=true)
* I get 1:37 for the duration from the movie.

When I use:
Directshowsource("video_only.GRF", fps=23.976, audio=false, seekzero=false, seek=true).trim(0,145000)
* I get duration of 50 minutes for the movie.


Unfortunately after 13 hours of encoding it crashed...

Encoded: 5868.6s (97%) Elapsed: 13:40:24 Left: 00:25:02 [0.12x]
Encoder error: 0x8007000E
Error occurred in transcoding: Error Code = 0x8007000E


When I open the audioandvideo.avs in VirtualDub and check the length, the audio length is 1:37.13 and the video length is 1:40.47.

I'm assuming those extra video minutes are the 9000 extra frames I added to directshowfilter over what EVO Demux gave me.

The actual output .wmv is 1:37:49 in length.

NHRaider
14th April 2007, 13:53
Buffer ? What for a Buffer ? latest version of Evodemux calculates the Frames 99,9% correct ,or waht do you mean ?
I use exactly the "calculated Framecount" from latest Evodemux

For encoding i use -v_buffer 60000

But i think i know what is your Error !

Use :
Filesource(async)-SoncHDDemuxer-SonicCinemasterVideoDecoder

Not VC1 Source Filter! I dont think it will work properly, with Filesource you have no Problems
No Wonder why you have wrong values .


Lots of conflicting terms...when I wrote buffer, I really meant "padding" on the numbers or how much extra to add. I was reading earlier in the HD-DVD to WMV thread that you add some frames to eliminate the chance of vidoe getting cut off. If EVO is 99.9% accurate, then I will certainly use that number for framecount.

I tried your method and that was the problem...rendering file vs. filesource (async). It fixed my video problem! I did the same file source (async) on the audio and unbelieveably I have 6 channel DD in the sonic demux filter for the audio using the sonic audio decoder! The last bit of question is the video is 1:48 as expected. However, the audio is 4:31! When I render the audio file, I get the correct 1:48 but only 2 channels. Additional note VirtualDub says it's still 2 channel but the filter says 6...



Also, I do see True HD on the audio...is there a filter that would allow encoding?

Thanks in advance!

jokin
14th April 2007, 15:22
Now all I need to do is figure out how to get audio decoding in more than stereo for dolby digital plus! Sonic audio Decoder 4.2 only gives me 2 channels...

I use this method for the audio.

I do eac3to then tranzcode.

"eac3to <input.ddp> <output.wav>"

then

"tranzcode <output.wav>"

finally in WME I select audio as Multichannel WAV source then click properties of that and put each channel in its correct spot.

For Video I select the video_only.avs I have created that references my GRF.

Finally I select all my compression settings and start the encode.

ACrowley
14th April 2007, 20:46
You cant decode TrueHD to wave at the Moment
Sonic can only do DD+ ,no MLP

Also only SonicDecoder 4.2 is working with correct Channles...i think thats your Problem.
Use SonicCinemasterAudioDecoder 4.2, works perfect

You need Orbitlees modified Source Filter (DTS/AC3/DD+ Source)for the Audio NOT Filesource/asnyc)
Required Filters/Software: DTS/AC3/DD+ Source ,Dump.ax .SonicDecoder 4.2 . EAC3to will autom. the whole process.
Tranzcode 0.40b

1. eac3to to decode DD+ to raw-wave : eac3to.exe g:\audio.ec3 g:\audio.wav
2. Tranzcode.exe to decode the big 24bit waves to 24bit 6 monowaves (a 24bit multichannel wave is to big for the most encoders)
Tranzcode.exe youraudio.wav
3. encode 6mono waves to WMA10 Pro 24Bit 48khz using SonyVegas7 or Steinberg Nuendo/Cubase,that gives perfect Results which are very close to the original Audio.

buzzqw
14th April 2007, 22:26
sorry pal but you are going a little of topic...

is possible to leave to thread to problems/ideas regarding wmcmd.vbs ?

open one new thread for those problem

thanks :)

BHH

NHRaider
15th April 2007, 00:54
sorry pal but you are going a little of topic...

is possible to leave to thread to problems/ideas regarding wmcmd.vbs ?

open one new thread for those problem

thanks :)

BHH

I was on topic on an issue getting this error running the vbs script...

"Unfortunately after 13 hours of encoding it crashed...

Encoded: 5868.6s (97%) Elapsed: 13:40:24 Left: 00:25:02 [0.12x]
Encoder error: 0x8007000E
Error occurred in transcoding: Error Code = 0x8007000E"

buzzqw
15th April 2007, 08:11
Nothing personal NHRaider :)

happy encoding!

BHH

olivierdb
17th April 2007, 12:04
Hello again Zambelli,

I am having problems with your latest version of WMCmd.vbs when used with Sonic Cineplayer Decoder Pack 4.2.

I use the following DirectShow filters to decode my HD content:

audio: DTS/DD+/AC3 source filter>Sonic Audio Decoder
video: File Source(Async)>Sonic HD demuxer>Sonic Video Decoder

I have no problems rendering the HD content with Sonic. However, when I execute the wmcmd.bat file, I get a series of errors of the type:

ContextException thrown by BaseCertificate::GetField [.\BaseCertificate.cpp:903]
with context
Field
SAR_FeatureValue
not found in certificate
C:\Program Files\Common Files\Roxio Shared\Certificates8\cp42ppg.rxc

Would you know what the problem is here and how to fix it?
(NHRaider reported this problem earlier in this thread (http://forum.doom9.org/showthread.php?p=988478#post988478), but I haven't seen any answers!)

NHRaider
17th April 2007, 13:12
Hello again Zambelli,

I am having problems with your latest version of WMCmd.vbs when used with Sonic Cineplayer Decoder Pack 4.2.

I use the following DirectShow filters to decode my HD content:

audio: DTS/DD+/AC3 source filter>Sonic Audio Decoder
video: File Source(Async)>Sonic HD demuxer>Sonic Video Decoder

I have no problems rendering the HD content with Sonic. However, when I execute the wmcmd.bat file, I get a series of errors of the type:

ContextException thrown by BaseCertificate::GetField [.\BaseCertificate.cpp:903]
with context
Field
SAR_FeatureValue
not found in certificate
C:\Program Files\Common Files\Roxio Shared\Certificates8\cp42ppg.rxc

Would you know what the problem is here and how to fix it?
(NHRaider reported this problem earlier in this thread (http://forum.doom9.org/showthread.php?p=988478#post988478), but I haven't seen any answers!)


After some trial and error, these warnings are originating from the Sonic Video Decoder filter. If you use InterVideo Video Decoder, the warnings go away. However, even getting the ContextExceptions above, I still get the output video...so I'm not sure if they are warnings vs. errors. I'm sure someone with more knowledge of the inner-workings can elaborate. Also, I was getting these warnings before and after the .vbs release

jokin
17th April 2007, 14:42
I get the same errors with the VBS. I switched to the GUI so I could use my 6 mono tranzcoded wavs directly. I haven't had any problems with the video so I wouldn't worry about it.

olivierdb
17th April 2007, 17:54
After a whole series of ContextException error messages, I get this final message:

"Prepare to encode failed with error -1072886856 The input media format is invalid."

Therefore no output.wmv is produced. I don't see why I have no issue rendering the video from within graphedit, yet it doesn't work with WMCmd.vbs!

buzzqw
17th April 2007, 18:28
you are not alone.... :( even with normal mpeg2 file (processed via avisynth/dgdecode) cause crash in wmcmd.vbs.. while playing in virtualdub (or xvid/x264) is ok...

i hope that wvcmd.vbs get more stable :)

BHH

NHRaider
17th April 2007, 18:56
After a whole series of ContextException error messages, I get this final message:

"Prepare to encode failed with error -1072886856 The input media format is invalid."

Therefore no output.wmv is produced. I don't see why I have no issue rendering the video from within graphedit, yet it doesn't work with WMCmd.vbs!

Don't feel alone...but I believe by my many attempts at converting the audio to multi-channel, I would get that "Prepare to encode failed with error -1072886856 The input media format is invalid." when I used a wrong -a_setting in the vbs.

Mostly by trying to do something like 640_48_6_24 when there was a conflict with any of those parameters. I bet if you remove the -a_setting input the error goes away...it did for me...when I saw all the warnings I assumed that they were both related to the video filter...

jokin
18th April 2007, 01:15
After a whole series of ContextException error messages, I get this final message:

"Prepare to encode failed with error -1072886856 The input media format is invalid."

Therefore no output.wmv is produced. I don't see why I have no issue rendering the video from within graphedit, yet it doesn't work with WMCmd.vbs!

I also had this error. When my audio setting was:

-a_setting 640_48_6_24

it would crash with the same error.

If I used:

-a_setting 192_48_2_24

or -a_setting 192_48_2_16

It didnt.


I will try to duplicate the error but I remember trying to connect a ddp file to Sonic Cinemaster Audio Decoder 4.2 and graphedit gave an error like use a decoder that supports 5 channels.

I could only get it to work with 192 kbps and 2 channels.

Try changing your script to the

-a_setting 192_48_2_24
or
-a_setting 192_48_2_16
setting.

This is why I do the 6 mono waves directly into the GUI.
I just made a HDDVD profile and it take maybe 30 secs more to load it and change the video bitrate than to edit my script.

ACrowley
18th April 2007, 12:15
I also had this error. When my audio setting was:

This is why I do the 6 mono waves directly into the GUI.
I just made a HDDVD profile and it take maybe 30 secs more to load it and change the video bitrate than to edit my script.

yep , it works with wmencoder.

But you can only use 16 and 24 Bit mono waves in wmencoder

NHRaider
18th April 2007, 19:16
I've been getting this error when encoding via both WME GUI and by using wmcmd.vbs ...

VBS:
"Encoder error: 0x8007000E
Error occurred in transcoding: Error Code = 0x8007000E"

WME:
"Not enough storage is available to complete this operation. (0x8007000E)"

This seems to be an out of memory error. It's consistently happening about 1:38 into encoding across 2 different movies and multiple attempts each.

I have 4GB or RAM so I don't think it's hardware related.

If this is relevant:

Windows XP Media Center Edition Version 2002 Sevice Pack 2. It's a relatively new machine so I'm not sure why 2005 isn't on there.

Dell XPS Intel Core 2 CPU X6800 @2.93GHz, 2.93GHz.

My question is if anyone has seen this particular error and what is the culprit? I'm sure some of the developers have seen this....

Any help would be appreciated.

BTW, I have managed to encode in entirety movies in 2 channel. The multichannel encoding seems to be what is causing these issues...

In the interim, I'll try to used WME to create the WMA 6channel audio and WME on the video avs to see if they can be independently encoded. Then I'll try to mux them with Stream Edit...

These 13 hour cycles are draining...

olivierdb
19th April 2007, 11:12
@Zambelli: It seems that WMCmd.vbs generates the error "Prepare to encode failed with error -1072886856 The input media format is invalid." when using 6 channels instead of 2 in the following script (with 2 channels it works!):

cscript.exe "C:\Program Files\Windows Media Components\Encoder\wmcmd.vbs" -input "C:\Documents and Settings\Olivier\My Documents\My Videos\HD-DVD to WMV HD\AudioAndVideo.avs" -output "C:\Documents and Settings\Olivier\My Documents\My Videos\HD-DVD to WMV HD\output.wmv" -v_bframedist 1 -v_bdeltaqp 1 -v_mslevel 1 -v_codec wvc1 -v_keydist 3 -v_mode 2 -v_quality 96 -v_mmatch 0 -v_msrange 0 -v_performance 20 -v_loopfilter 1 -a_codec wmapro -a_setting 384_48_6_24

Would you have an idea why the 6 channels are not supported?

(FYI - I used DTS/DD+/AC3 source filter>Sonic Cinemaster Audio Decoder 4.2 to decode 5.1 DD+ channels)

zambelli
19th April 2007, 11:38
you are not alone.... :( even with normal mpeg2 file (processed via avisynth/dgdecode) cause crash in wmcmd.vbs.. while playing in virtualdub (or xvid/x264) is ok...
i hope that wvcmd.vbs get more stable :)
Well, those kind of issues are unfortunately out of my hands. I can't fix issues in WME9 DLLs. Things that make cscript.exe crash are typically not errors in the VBScript code but issues in the runtime DLLs.

As for normal MPEG-2 not working... I think you may have a bigger issue there than just WME9/WMCmd. I routinely use MPEG-2 sources via Avisynth/DGDecode and I've NEVER had issues getting them to encode with WMCmd.vbs. Make sure strange filters aren't getting introduced into your DirectShow graphs when playing back .avs files.

zambelli
19th April 2007, 11:41
@Zambelli: It seems that WMCmd.vbs generates the error "Prepare to encode failed with error -1072886856 The input media format is invalid." when using 6 channels instead of 2 in the following script (with 2 channels it works!):

2/6 channels on input or output?

When feeding 6 channels to WME9, it's important to note: which format is being used? Integer precision? Floating point IEEE? 16-bit? 24-bit? 32-bit? Which version of Avisynth is used?

You can find out all this stuff by playing back the .avs in MPC and then checking the AVS audio Pin Out properties.

NHRaider
19th April 2007, 12:48
I've been getting this error when encoding via both WME GUI and by using wmcmd.vbs ...

VBS:
"Encoder error: 0x8007000E
Error occurred in transcoding: Error Code = 0x8007000E"

WME:
"Not enough storage is available to complete this operation. (0x8007000E)"

This seems to be an out of memory error. It's consistently happening about 1:38 into encoding across 2 different movies and multiple attempts each.

I have 4GB or RAM so I don't think it's hardware related.

If this is relevant:

Windows XP Media Center Edition Version 2005.
Dell XPS Intel Core 2 CPU X6800 @2.93GHz, 2.93GHz.

My question is if anyone has seen this particular error and what is the culprit? I'm sure some of the developers have seen this....

Any help would be appreciated.

BTW, I have managed to encode in entirety movies in 2 channel. The multichannel encoding seems to be what is causing these issues...

In the interim, I'll try to used WME to create the WMA 6channel audio and WME on the video avs to see if they can be independently encoded. Then I'll try to mux them with Stream Edit...

These 13 hour cycles are draining...


The memory error seems to be consistent when I'm encoding video (10.8kbps) and multichannel (768kbps 48KHz 6 Channel 24 bit) audio together. When I encode them separately and mux them with Stream Edit, there are no memory issues.

olivierdb
19th April 2007, 18:54
@Zambelli: These are the properties:

Properties from EVO Demux:

Dolby Digital Plus audio stream 0 found!
First PTS = 0000111D (+10ms)
Substream id = C0
Stream 0 is Dolby Digital Plus
frame size = 1024 bytes, number of blocks per frame = 1
Sampling frequency = 48 kHz
Transmission bitrate = 1536 kbit/s
Channel arrangement = L + R + C + Ls + Rs, bsid = 16
LFE channel = present


Properties from MPC:

- Connected to:

CLSID: {79376820-07D0-11CF-A24D-0020AFD79767}
Filter: Default DirectSound Device
Pin: Audio Input pin (rendered)

- Connection media type:

Audio: PCM 48000Hz stereo 1536Kbps

AM_MEDIA_TYPE:
majortype: MEDIATYPE_Audio {73647561-0000-0010-8000-00AA00389B71}
subtype: MEDIASUBTYPE_PCM {00000001-0000-0010-8000-00AA00389B71}
formattype: FORMAT_WaveFormatEx {05589F81-C356-11CE-BF01-00AA0055595A}
bFixedSizeSamples: 1
bTemporalCompression: 0
lSampleSize: 1
cbFormat: 18

WAVEFORMATEX:
wFormatTag: 0x0001
nChannels: 2
nSamplesPerSec: 48000
nAvgBytesPerSec: 192000
nBlockAlign: 4
wBitsPerSample: 16
cbSize: 0 (extra bytes)

pbFormat:
0000: 01 00 02 00 80 bb 00 00 00 ee 02 00 04 00 10 00 ....€»...î......
0010: 00 00 ..

- Enumerated media type 0:

Set as the current media type

Which, I presume, means that the Sonic Audio Decoder only supports 2 channels.

It's strange because:
DTS/DD+/AC3 source filter> Sonic Cinemaster Audio Decoder> AC3 filter
output is 6 channels! Would this mean that some upmixing takes place?

Thanks.

NHRaider
19th April 2007, 19:36
@Zambelli: These are the properties:

Properties from EVO Demux:

Dolby Digital Plus audio stream 0 found!
First PTS = 0000111D (+10ms)
Substream id = C0
Stream 0 is Dolby Digital Plus
frame size = 1024 bytes, number of blocks per frame = 1
Sampling frequency = 48 kHz
Transmission bitrate = 1536 kbit/s
Channel arrangement = L + R + C + Ls + Rs, bsid = 16
LFE channel = present


Properties from MPC:

- Connected to:

CLSID: {79376820-07D0-11CF-A24D-0020AFD79767}
Filter: Default DirectSound Device
Pin: Audio Input pin (rendered)

- Connection media type:

Audio: PCM 48000Hz stereo 1536Kbps

AM_MEDIA_TYPE:
majortype: MEDIATYPE_Audio {73647561-0000-0010-8000-00AA00389B71}
subtype: MEDIASUBTYPE_PCM {00000001-0000-0010-8000-00AA00389B71}
formattype: FORMAT_WaveFormatEx {05589F81-C356-11CE-BF01-00AA0055595A}
bFixedSizeSamples: 1
bTemporalCompression: 0
lSampleSize: 1
cbFormat: 18

WAVEFORMATEX:
wFormatTag: 0x0001
nChannels: 2
nSamplesPerSec: 48000
nAvgBytesPerSec: 192000
nBlockAlign: 4
wBitsPerSample: 16
cbSize: 0 (extra bytes)

pbFormat:
0000: 01 00 02 00 80 bb 00 00 00 ee 02 00 04 00 10 00 ....€»...î......
0010: 00 00 ..

- Enumerated media type 0:

Set as the current media type

Which, I presume, means that the Sonic Audio Decoder only supports 2 channels.

It's strange because:
DTS/DD+/AC3 source filter> Sonic Cinemaster Audio Decoder> AC3 filter
output is 6 channels! Would this mean that some upmixing takes place?

Thanks.


I've been trying to solve this problem for weeks with the multichannel. 2 Channel works like a champ, but multichannel has given me that input format error you state above. Some suggestions I received was making sure that you go to control panel > cineplayer dvd decoder options is set to 6 channels and that your system speaker is set to 6 channels.

Even then there were issues that you have above. I've found that I can go through the process and make the 6 channel audio is to just encode the video only...use the process to convert the audio to 6 mono wav files and encode them into a wma file and use stream edit to mux them.

Works perfectly.

buzzqw
19th April 2007, 20:06
@Zambelli

the problem arise with filter that change fps (from tdecimate to changefps)...

BHH

zambelli
19th April 2007, 23:14
@Zambelli
the problem arise with filter that change fps (from tdecimate to changefps)...
The crashing problem? I've used ConvertFPS and Decimate in my scripts many times, I don't recall seeing such a problem. Do the .avs files play back OK in WMP or GraphEdit?

buzzqw
20th April 2007, 08:26
here the script

#cut out load plugin part
movie = mpeg2source("D:\DVDMAGIC\temp\movie.d2v")
audio = DirectShowSource("D:\DVDMAGIC\temp\audio.wav") #this is a 3.01 Gb IEEE 2ch 2h 35m wav file (the audio of movie , Matrix NTSC version)
function getOrder(clip c) {
order = GetParity(c) ? 1 : 0
Return order }
movie = tfm(movie,d2v="D:\DVDMAGIC\temp\movie.d2v").tdecimate()
cropclip = autocrop(movie,mode=0,wmultof=4,hmultof=4,samples=40,aspect=0,threshold=34,samplestartframe=0)
fixed_aspect = 1.185185
c_width = width(cropclip)
c_height = Round(height(cropclip) / fixed_aspect)
input_par = float(float(c_width)/float(c_height))
input_par = input_par > 1.4 ? input_par : (4.0/3.0)
out_width = 672
out_height = Round(float(out_width) / input_par)
hmod = out_height - (floor(out_height / 16 ) * 16)
out_height = (hmod > 4) ? (out_height + (16 - hmod)) : (out_height - hmod)
new_aspect = (float(out_width) / float(out_height)) / fixed_aspect
autocrop(movie,mode=0,wmultof=4,hmultof=4,samples=40,aspect=new_aspect,threshold=34,samplestartframe=0)
LanczosResize(out_width,out_height)
Hqdn3d(4,3,6,4.5)
ColorMatrix("Rec.709->Rec.601",hints=false,threads=0)
audiodub(audio,last)

the file is perfectly played in mpc and graphedit
http://img401.imageshack.us/img401/930/grapheditmt5.th.png (http://img401.imageshack.us/my.php?image=grapheditmt5.png)

here the log of encoding

D:\DVDMAGIC\temp>movie_wmv.bat

D:\DVDMAGIC\temp>cscript.exe "C:\Programmi\PureBasic4\AutoMKV\exe\encoder\WMCmd.
vbs" -input "D:\DVDMAGIC\temp\movie.avs" -output "D:\DVDMAGIC\temp\movie.wmv" -
v_codec WVC1 -v_mode 3 -v_bitrate 577902 -s_config "D:\DVDMAGIC\temp\wmv_crb" -v
_preset better -v_dquantoption 3 -v_percopt 1 -v_bdeltaqp 1 -a_codec wmapro -a_m
ode 0 -title "VTS_02_0" -year 2007 -copyright "Done with AutoMKV! 0.81b" -a_set
ting 96_48_2_16
Microsoft (R) Windows Script Host Versione 5.6
Copyright (C) Microsoft Corporation 1996-2001. Tutti i diritti riservati.

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

Title: VTS_02_0
Year: 2007
Copyright: Done with AutoMKV! 0.81b

Warning: Encoder failed to retrieve duration attribute from source plug-in.
Trying alternate method now................................

Warning: Encoder failed to retrieve source duration again.
Encode process might not continue or progress report may be inaccurate.


======== Begin Pass1 ========
..............

======== Begin Pass2 ========


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

Audio :
Codec: Windows Media Audio 10 Professional
Expected bit rate: 96000 bps
Average bit rate: 96000 bps
Expected sample rate: 5859
Average sample rate: 0
Dropped byte count: 0 bytes
Dropped sample rate: 0
Total bytes: 0 bytes

Video :
Codec: Windows Media Video 9 Advanced Profile
Expected bit rate: 577902 bps
Average bit rate: 577902 bps
Expected fps: 30
Dropped frame count: 0
Total coded frames: 0
Average sample rate: 0
Dropped bytes: 0 bytes
Total bytes: 0 bytes

Overall:
Encoding time: 77 seconds
Average bit rate: 673902 bps
File size: 5628 bytes
File duration: 0 seconds

D:\DVDMAGIC\temp>

hope that helps!

if i move the movie = tfm(movie,d2v="D:\DVDMAGIC\temp\movie.d2v").tdecimate() after autocrop scring the encoding goes fine (and changing it to
tfm(d2v="D:\DVDMAGIC\temp\movie.d2v").tdecimate() )

D:\DVDMAGIC\temp>movie_wmv.bat

D:\DVDMAGIC\temp>cscript.exe "C:\Programmi\PureBasic4\AutoMKV\exe\encoder\WMCmd.
vbs" -input "D:\DVDMAGIC\temp\movie.avs" -output "D:\DVDMAGIC\temp\movie.wmv" -
v_codec WVC1 -v_mode 3 -v_bitrate 577902 -s_config "D:\DVDMAGIC\temp\wmv_crb" -v
_preset better -v_dquantoption 3 -v_percopt 1 -v_bdeltaqp 1 -a_codec wmapro -a_m
ode 0 -title "VTS_02_0" -year 2007 -copyright "Done with AutoMKV! 0.81b" -a_set
ting 96_48_2_16
Microsoft (R) Windows Script Host Versione 5.6
Copyright (C) Microsoft Corporation 1996-2001. Tutti i diritti riservati.

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

Title: VTS_02_0
Year: 2007
Copyright: Done with AutoMKV! 0.81b

Warning: Encoder failed to retrieve duration attribute from source plug-in.
Trying alternate method now.............
Source duration retrieved: 8469,461 seconds.

======== Begin Pass1 ========
Read: 68,5s (0,8%) Elapsed: 00:01:01 Left: 02:04:43 [1,12x]

hope that help

BHH

zambelli
20th April 2007, 10:11
When you play it back in WMP (not MPC), how long does it take for WMP to start playing the video and show the duration?

buzzqw
20th April 2007, 10:33
using wmp11 on p4 3ghz prescott, 1gb ram, win2003srv

from 9 to 12 seconds

BHH

Icemaan
20th April 2007, 12:38
hello

Long I read about all what can make with Avisynth and Zambelli Script.
Now I have make a first Test for myself.
1.Demux a Testfile Evo into Mpv and Mpa
2.Encode the Mpv via Graphedit and Avisynth to Wmv
3.Mpa via Eac3to into Ac3 and then like the Tut from Zambelli into a 6 Channel Avi.

Now my Question
When I want encode the Audio Avi into WmaPro which Codec i need
and whats a good CommandLine Parameter for this
When i Have make the Wma how i can put the Wmv and the Wma together in one Container

Thanks for your help
Icemaan

zambelli
21st April 2007, 05:03
using wmp11 on p4 3ghz prescott, 1gb ram, win2003srv

from 9 to 12 seconds
Ah. It sounds like Autocrop is waiting for TFM and TDecimate to finish re-arranging frames before it processes the first frames - so hence the long delay in loading.

WMCMd.vbs will wait 30 seconds for WMP OCX to open to AVS, but it will only wait 3 seconds for the playback state to transition from opened to playing (it's at this point where the duration truly becomes available to WMP). I'm guessing that's where it's timing out.

I think it's generally preferable to use the Avisynth script which is faster - so if simply switching those 2 lines works faster - just use that then.

buzzqw
21st April 2007, 09:27
@zambelli

thanks Zambelli!
i'll try to adjust the avs

BHH

leiming2006
22nd April 2007, 05:53
Oh, a new version.
It's actually a good way to encode an awful number of files.
But why can't I get the file successfully?
Thanks.

edit: OK, finally I get it through checking the source code of that html.

zambelli
23rd April 2007, 01:34
Oh, a new version.
It's actually a good way to encode an awful number of files.
But why can't I get the file successfully?
Thanks.

edit: OK, finally I get it through checking the source code of that html.
Sorry, I've been having issues with my web host. I'll be switching providers very soon.

[consumer alert] MySiteSpace (http://www.mysitespace.com)is a horrible web hosting service provider. Security issues abound and the customer support is the worst I've seen in ages (sometimes they don't even reply to trouble tickets). I highly recommend to everybody to stay clear of MySiteSpace. [/consumer alert]

sportcenter
23rd April 2007, 06:31
hello to all (a few familiar users too)...

zambelli am getting into using your method - used to do how crowley used to do his encodes

one problem though, i am getting an error when i begin the .bat file

"Warning: Encoder failed to retrieve duration attribute from source plug-in. Trying alternate method now..."

it then finds another method and begins to encode....but after about 1 minute it gets VERY SLOW and eventually stops

my cmd -

cmd /k cscript.exe J:\wmcmd.vbs -input J:\test.avs -output J:\deer_hunter.wmv -v_codec WVC1 -videoonly -v_mode 0 -v_bitrate 5903000 -v_preset better -v_buffer 60000 -v_quality 100

any ideas?

sportcenter
23rd April 2007, 06:33
[consumer alert] MySiteSpace (http://www.mysitespace.com)is a horrible web hosting service provider. Security issues abound and the customer support is the worst I've seen in ages (sometimes they don't even reply to trouble tickets). I highly recommend to everybody to stay clear of MySiteSpace. [/consumer alert]

thnx for the heads up zambelli

:thanks:

zambelli
23rd April 2007, 10:02
it then finds another method and begins to encode....but after about 1 minute it gets VERY SLOW and eventually stops
Does it encode anything at all? If you abort the encode, is the generated .wmv file playable at all?

Have you tried playing your .avs script through WMP or GraphEdit?

-v_buffer 60000 -v_quality 100
I mentioned this several times now, perhaps not in this thread, but here it goes again:
60 seconds is a huge buffer that imposes just as huge of a memory requirement on the decoder. 6 Mbps * 60 seconds = 36 Mbits = 43 Mbytes. That'd be the amount of memory the decoder would need to allocate just to play back the video at all. That's no problem on a PC, but on any standalone CE device, even the Xbox - there could be problems.

ACrowley
23rd April 2007, 17:10
sportcenter

I have it to ...and it pla<ys no Role

Seemst to be caused by AVS with Directshowsource Input..but its no Problem

ACrowley
23rd April 2007, 17:15
@Sportcenter
I have the Message while Import too to, plays no Role

it encodes fine..i made dozens of enocodes with wmcmd and all had the Message. The "Alternative" Method work fine

And as i say via PN, the Problem with the slow encode etc is because you made something wrong with your VC1 Source
The Source Duration in seconds i totally wrong.
So ofcourse the Encode is slow will work a few hundred hours

Perhaps you you dont use the demuxed VC1 in your graph/avs ?
When you use the evo in your graph, it gives exactly this Problem with wrong Runtime etc.
Please use "only" the demuxed mpv from Evodemux and create this graph
Filesource(async)- SonicHDDemuxer-SonicCinemasterVideoDecoder4.2

@zambelli
Xbox360 has no Problem with a 60000Buffer
Not the Dashboard Player, not the MCE Player

sportcenter
24th April 2007, 06:09
@ ACrowley - that may be the problem, i am using SonicCinemasterVideoDecoder4.1 instead of SonicCinemasterVideoDecoder4.2....i only have the 4.2 for my audio

Thunder.m
24th April 2007, 12:59
Hi, I would like to use this script on system without sound card, but I can't encode sound. In windows media encoder I can encode sound without problems, but with this script it just crashed, I have to use -videoonly option. Is there some way to encode movies without sound card with this script? I tried old script in WME SDK, but it has the same issue.

Configuration: U1 server HP, Windows 2003 Server SE, Intel Xeon 5110

Clown shoes
24th April 2007, 14:12
What is your audio source and what is the script you are using?

Thunder.m
24th April 2007, 15:10
What is your audio source and what is the script you are using?

cscript WMCmd.vbs -input "Z:\rta_rta_exchange\Mix_FINAL\rta_mixzregionu_2007_04_13.mpg" -output "C:\test.wmv" -loadprofile "C:\Documents and Settings\user\My Documents\Video\rta150k.prx"

I am using same profile rta150k.prx for Windows Media Encoder.

ACrowley
24th April 2007, 22:44
@ ACrowley - that may be the problem, i am using SonicCinemasterVideoDecoder4.1 instead of SonicCinemasterVideoDecoder4.2....i only have the 4.2 for my audio

No...4.1 VideoDecoder should work fine too

@ Zambelli

2 Questions about 2pass VBR Peak

1.
I think v_quality parameter plays no Role for 2pass VBR Peak right ?
And i can use defaults for -v_buffer and -v_Peakuffer in 2pass VBR Peak ?

2. When i encode the same Source ,same preset etc ,but with v_mode 4, i can see in WMSnoop that the encode is
Device Conformance Template AP@L2

With CBR Mode v_mode 0 its AP@L3 ??

zambelli
25th April 2007, 09:23
I think v_quality parameter plays no Role for 2pass VBR Peak right ?
And i can use defaults for -v_buffer and -v_Peakuffer in 2pass VBR Peak ?
Correct, v_quality doesn't do anything in 2-pass VBR modes.
In mode 4 (2pass peak VBR) v_buffer is also ignored and v_peakbuffer is used instead. You can probably set it to 10 seconds with good results. The default is 5.

2. When i encode the same Source ,same preset etc ,but with v_mode 4, i can see in WMSnoop that the encode is
Device Conformance Template AP@L2

With CBR Mode v_mode 0 its AP@L3 ??
Yeah, the profile level prediction algorithm is not completely accurate. Because that part of the header is written before the encode is finished, the encoder has to do a best guess of what the level will be before the encode has even started. In most cases it makes a conservative estimate. It's likely the true level is AP@L2 in both cases really.

Thunder.m
25th April 2007, 16:36
What is your audio source and what is the script you are using?

Audio is in mpeg movie, script = WMCmd.vbs

zambelli
21st May 2007, 12:32
I just released a minor update to the script that allows redirecting text output to a log file. See first page for details.

dlefol
23rd May 2007, 13:00
Hello,

First thanks for the program it's really usefull. I've run a few simulations using it and it's interesting to see the results.
I am a little bit astonished with my result using different Lookahead values. I've put all the parameters at their default values except the number of B frame which is set at 1 and the lookahead which varies from 1 to 16 (1,2,4,8 and 16).
I use a 1-pass CBR to encode sequences at bitrates between 100 Kbps and 500 Kbps by increment of 50 Kbps. The input is in CIF format and i used SSIM algo. to measure the quality of the output sequences... and my cruves are nearly exactly the same!!! Is the lookahead efficient only if different options are turned ON ?

Sorry if I am a bit out of topic and thanks for any help

mt247
28th May 2007, 00:28
Hi,
i have a strange problem. It does not matter, what mkv (720p) file i'm trying to convert to wmv on 2 pass encoding, the result is always the same. The filesize of the encoded new file is 5kb and not playable. Here is the log of my encoding attempt:
C:\Users\MTx32>cmd /k cscript.exe c:\windows\wmcmd.vbs -input e:\1.mkv -output e
:\lost1.wmv -v_codec WVC1 -videoonly -v_mode 4 -v_preset insane -v_bitrate 80000
00 -v_keydist 30 -v_buffer 600000 -v_quality 100
Microsoft (R) Windows Script Host, Version 5.7
Copyright (C) Microsoft Corporation 1996-2001. Alle Rechte vorbehalten.

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


======== Begin Pass1 ========
Read: 2434,9s (100%) Elapsed: 05:15:44 Left: 00:00:03 [0,13x]

======== Begin Pass2 ========


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

Video :
Codec: Windows Media Video 9 Advanced Profile
Expected bit rate: 8000000 bps
Average bit rate: 8000000 bps
Expected fps: 25
Dropped frame count: 0
Total coded frames: 0
Average sample rate: 0
Dropped bytes: 0 bytes
Total bytes: 0 bytes

Overall:
Encoding time: 18950 seconds
Average bit rate: 8000000 bps
File size: 5054 bytes
File duration: 0 seconds

C:\Users\MTx32>

Anyone has an idea, what is going wrong here? I'm using vistax32 and the latest k-lite codec (full) pack....

Thx,
Michael

mt247
28th May 2007, 18:33
i changed the settings a bit but got the same result... :-(

Microsoft Windows [Version 6.0.6000]
Copyright (c) 2006 Microsoft Corporation. Alle Rechte vorbehalten.

C:\Users\MTx32>cmd /k cscript.exe c:\windows\wmcmd.vbs -input e:\1.mkv -output
:\lost1.wmv -v_codec WVC1 -videoonly -v_mode 1 -v_preset insane -v_bitrate 8000
00 -v_keydist 30 -v_buffer 600000 -v_quality 100
Microsoft (R) Windows Script Host, Version 5.7
Copyright (C) Microsoft Corporation 1996-2001. Alle Rechte vorbehalten.

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


======== Begin Pass1 ========
Read: 2434,9s (100%) Elapsed: 05:21:38 Left: 00:00:03 [0,13x]

======== Begin Pass2 ========


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

Video :
Codec: Windows Media Video 9 Advanced Profile
Expected bit rate: 8000000 bps
Average bit rate: 8000000 bps
Expected fps: 25
Dropped frame count: 0
Total coded frames: 0
Average sample rate: 0
Dropped bytes: 0 bytes
Total bytes: 0 bytes

Overall:
Encoding time: 19303 seconds
Average bit rate: 8000000 bps
File size: 5054 bytes
File duration: 0 seconds

C:\Users\MTx32>

zambelli
29th May 2007, 12:09
-input e:\1.mkv
MKV is not one of the supported input formats. It's mentioned nowhere in the documentation. I've no idea what the encoder thinks it's reading.
-v_buffer 600000
600 second buffer is HUGE. You don't want that.
Advice: Don't just copy+paste command lines you see in random threads. Read the documentation.
I'm using vistax32 and the latest k-lite codec (full) pack....
Do yourself a favor and uninstall K-Lite. It's a terrible excuse for software.

kevo777
6th June 2007, 22:58
I use WMCmd.vbs on three systems - all WinXP SP2, two are desktops running Pro and third is laptop running Home. All have latest WMP installed. I can *never* get WMCmd.vbs to give me duration or encoding progress besides a screen full of ".......". Yes, I use AVS as source and I'm aware that the AVI source plug-in trips a bit in this scenario.

Some background - My video and audio are "audiodubbed" together in the script. I'm using DGDecode and NicAC3Source. Also, I use ffdshow on all three systems as well. Is there anything I can do in my script or WMP to help WMCmd.vbs acquire duration? :confused:

Yeah, that's normal when using .avs as sources.


Are you encoding the video and audio separately? If you're muxing them together in the .avs file, can you verify they are the same length?
WMcmd is just relying on DirectShow and WMP to report the correct lengh of the .avs source. If you can get it to play back in WMP - it will report the correct length in Wmcmd too.

alphabeta0
7th June 2007, 17:16
Since upgrading to Vista, I keep getting no video, only audio for videos exported by VirtualDub (direct stream copy - no compression for audio and video)


C:\>cscript WMCmd.vbs -input "c:\Users\User1\Desktop\b.avi" -output "c:\Users\User1\Desktop\blah.wmv"
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.


Encoded: 15.5s (77.7%) Elapsed: 00:00:04 Left: 00:00:01 [3.89x]

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

Audio :
Codec: Windows Media Audio 9.2
Expected bit rate: 64040 bps
Average bit rate: 64040 bps
Expected sample rate: 5383
Average sample rate: 5383
Dropped byte count: 0 bytes
Dropped sample rate: 0
Total bytes: 165057 bytes

Video :
Codec: Windows Media Video 9
Expected bit rate: 250000 bps
Average bit rate: 250000 bps
Expected fps: 29.97
Dropped frame count: 0
Total coded frames: 0
Average sample rate: 0
Dropped bytes: 0 bytes
Total bytes: 0 bytes

Overall:
Encoding time: 5 seconds
Average bit rate: 314040 bps
File size: 174017 bytes
File duration: 20.211 seconds


windowsmedia9-kb929182-intl.exe patch applied
It happens with your WMCmd.vbs and the one included in WMEncoder.exe

jubilex
20th June 2007, 02:54
Is there any possibility wmcmd could ever do the first and second passes of a VBR encode separately? After 20 hours of first-passing of an encode, I finally got an hour into the 2nd pass and my computer crashed. There have been other occasions when after the first pass, wmcmd crashes or freezes (audio error sometimes). It would be nice if the first pass could be finished and the data saved (as other encoders allow) before beginning the second pass.

jeffy
3rd July 2007, 09:26
May I please ask, is it possible to shorten the time period the script is waiting for the detection of the duration of the encoded clip?
Is there something in the code I could change?

:thanks:

EDIT: (this is what I mean)
Warning: Encoder failed to retrieve duration attribute from source plug-in.
Trying alternate method now..........

zambelli
6th July 2007, 23:13
Is there any possibility wmcmd could ever do the first and second passes of a VBR encode separately? After 20 hours of first-passing of an encode, I finally got an hour into the 2nd pass and my computer crashed. There have been other occasions when after the first pass, wmcmd crashes or freezes (audio error sometimes). It would be nice if the first pass could be finished and the data saved (as other encoders allow) before beginning the second pass.
Yeah, I feel your pain, but unfortunately 2-pass VBR is implemented on the codec DMO level - so there's nothing that can be changed on the SDK or application level to make it work differently. When WMV9 was being ported to VCM format, I think decoupling 1st and 2nd pass into separate processes was actually quite a signficant work item for the devs.

zambelli
6th July 2007, 23:19
May I please ask, is it possible to shorten the time period the script is waiting for the detection of the duration of the encoded clip?
Is there something in the code I could change?
Is the alternate duration seeking method failing, or do you just want to shorten the time it takes to retrieve the duration? I'm afraid you can't really control the latter because it entirely depends on the time necessary to open the .avs in WMP. If the .avs script is a complex one, it might take 15-20 seconds to just open it.

buzzqw
7th July 2007, 08:00
hi!

i have an italian user that report (using automkv) this error (several times during encoding)

[wmv1 @ 00AB2A40] warning, clipping 1 dct coefficients to -255..255kbits/s

any worry ?

do you need the full command line ?

BHH

zambelli
8th July 2007, 04:16
[wmv1 @ 00AB2A40] warning, clipping 1 dct coefficients to -255..255kbits/s
Whoa, I don't think I've ever seen that. That's being printed to the command prompt?

Why is the user using WMV7 anyway? :)

buzzqw
8th July 2007, 08:35
i have no idea why using wmv7... but automkv offer to encode with it...

and yes, these strings are printed in dos box while encoding

can i assure that encoding is going well ?

BHH

zambelli
9th July 2007, 21:33
i have no idea why using wmv7... but automkv offer to encode with it...
and yes, these strings are printed in dos box while encoding
can i assure that encoding is going well ?
I can only assume that it's OK if it's just a warning, not an error.

lv-jedster
13th July 2007, 03:56
When I use PureVideo as my MPEG-2 decoder, I get different results with the Windows Media Encoder than with the wmcmd script. With the stand-alone application, everything looks great; with the wmcmd script, the video is choppy. (Only benefit of that is smaller file size using QBR!)

It seems that with the stand-alone applications, the PureVideo decoder is outputting UYVY, but when it is invoked from cscript/wmcmd, it does YUY2. I'm guessing -- although I could be wrong -- that if somehow the PureVideo decoder would output UYVY, it would work great from the command line.

I've tried playing with all the options on the PureVideo decoder as well as explicitly telling the script to expect YUY2 and even UYVY to no avail.

Does anyone have any suggestions for me?

Also, am I possibly trying to do something which will have no real benefit? My thinking has been that (a) PureVideo does a great job deinterlacing and (b) it uses hardware acceleration, which might decrease CPU load/speed up encoding time.

Currently, I use FFDSHOW for the Video and PureVideo for the audio (I couldn't get any audio w/o doing this). Am I getting hardware acceleration (I don't think so, but can't be sure...)

My system is Vista32.

Thanks!

zambelli
13th July 2007, 09:24
Also, am I possibly trying to do something which will have no real benefit?
Possibly so. UYVY and YUY2 are effectively the same thing because they're both 4:2:2 formats. There should be no difference between the two.

My thinking has been that (a) PureVideo does a great job deinterlacing and (b) it uses hardware acceleration, which might decrease CPU load/speed up encoding time.
DXVA 1.0 can't be used without a renderer. When you build a decoding graph that goes directly to the encoder, you don't get the benefit of hardware acceleration in decoding.

Does the command-line encoder report dropped frames in its final statistics?

lv-jedster
13th July 2007, 10:12
DXVA 1.0 can't be used without a renderer. When you build a decoding graph that goes directly to the encoder, you don't get the benefit of hardware acceleration in decoding.

So the only benefit would be PQ (assuming that HW deinterlacing looked better and that the decoder fed the graph -- if i'm using that language correctly -- to a post-processor and renderer)?

That thing I can't understand is that when using the stand-alone WM Encoder, everything encodes terrific. However using wmcmd (or the batch encoder) things don't go great.

The reason why i think it's related to the UYVY is not just because i noticed the decoder was reporting different colorspaces -- there is also a release note by nvidia about them adding support for UYVY in order to support wm encoder. it's almost like the decoder correctly feeds wmenc.exe UYVY but when the decoder sees cscript.exe it chokes.

the thing that sucks is that i can't see how to force it into UYVY mode.

Does the command-line encoder report dropped frames in its final statistics?

That's a good question I'll check.

lv-jedster
13th July 2007, 10:37
Does the command-line encoder report dropped frames in its final statistics?

It doesn't report dropped frames, however with using the same 20 seconds of the same file it's clear that the PV is encoding fewer frames.

FFDSHOW

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

Audio :
Codec: Windows Media Audio 10 Professional
Average bit rate: 126940 bps
Expected sample rate: 897
Average sample rate: 889
Dropped byte count: 0 bytes
Dropped sample rate: 0
Total bytes: 285328 bytes

Video :
Codec: Windows Media Video 9 Advanced Profile
Average bit rate: 2239101 bps
Expected fps: 30
Dropped frame count: 0
Total coded frames: 506
Average sample rate: 29.411
Dropped bytes: 0 bytes
Total bytes: 4750345 bytes

Overall:
Encoding time: 21 seconds
Average bit rate: 2366041 bps
File size: 5061514 bytes
File duration: 17.972 seconds


PUREVIDEO

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

Audio :
Codec: Windows Media Audio 10 Professional
Average bit rate: 126940 bps
Expected sample rate: 897
Average sample rate: 889
Dropped byte count: 0 bytes
Dropped sample rate: 0
Total bytes: 285328 bytes

Video :
Codec: Windows Media Video 9 Advanced Profile
Average bit rate: 1576845 bps
Expected fps: 30
Dropped frame count: 0
Total coded frames: 436
Average sample rate: 29.411
Dropped bytes: 0 bytes
Total bytes: 3361789 bytes

Overall:
Encoding time: 18 seconds
Average bit rate: 1703785 bps
File size: 3668122 bytes
File duration: 17.972 seconds

zambelli
13th July 2007, 12:12
FFDSHOW
Total coded frames: 506

PUREVIDEO
Total coded frames: 436
Looks like PureVideo decoder is set to drop frames when it can't decode in realtime. I'm not sure why it's only happening in Wmcmd.vbs (perhaps it knows not to drop frames when wmenc.exe is its parent application) but I'm pretty sure why it's happening. I wouldn't be surprised if there's a registry key that will allow PureVideo decoder to decode all frames at slower than 1.0x speed.

Is this MPEG source telecined by any chance?

lv-jedster
14th July 2007, 02:05
Looks like PureVideo decoder is set to drop frames when it can't decode in realtime. I'm not sure why it's only happening in Wmcmd.vbs (perhaps it knows not to drop frames when wmenc.exe is its parent application) but I'm pretty sure why it's happening. I wouldn't be surprised if there's a registry key that will allow PureVideo decoder to decode all frames at slower than 1.0x speed.

Is this MPEG source telecined by any chance?

- Not sure about telecined (how can one tell?)
- Your 1x proposition seems likely. (a) it encodes at about 1x; (b) the video is smoother on my mildly OC'd E6600 (just 2.9GHz) than on my E4300.

I assume the reason why the decoder gets choked up is because the Encoder is also eating up CPU cycles?

I'll dig around for a registry key but so far I haven't found anything that seems useful, though admittedly I wasn't looking for that particular item.

thanks.

(On a total side note: I just started playing around with the PowerDVD decoder, which unless my eyes deceive me gives the best MPEG2 quality that I've seen on Vista. However the encoder (at least command-line) totally barfs on it. I havne't tried the stand alone.)

lv-jedster
14th July 2007, 03:24
Looks like PureVideo decoder is set to drop frames when it can't decode in realtime.

You are right -- it had nothing to do with colorspace. It was all about the PV decoder dropping frames. Once I set it up to not drop frames (explained below) everything worked perfectly.

In fact, it's better than perfect. The overall encoding time was similar -- smidge faster with the PV decoder than ffdshow.

I tested 3 files, encoding just 30 seconds of each and found the PV decoder did 2 of the 3 1 second faster and the last one the same.

More significantly, the PQ/deinterlacing is better using the PV decoder. And moreover, the filesize is smaller! I'm using QBR, so I suspect the extra interlacing artifacts inserted by ffdshow make the file larger. (Each PV file had a tiny bit more total frames.)

I wouldn't be surprised if there's a registry key that will allow PureVideo decoder to decode all frames at slower than 1.0x speed.

There is. The NVIDIA filters key is located at:

- HKCU\Software\Classes\VirtualStore\MACHINE\SOFTWARE\NVIDIA Corporation\Filters\Video

(EDIT: On XP, it appers to be here: HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\Filters\Video -- or perhaps the above is just a virtual location.)

I added the following:

- PureVideoPropPage (REG_DWORD set to 1)
- EnablePropPage (REG_DWORD set to 1)

(Note to the unitiated: You need to ADD both of the above if you don't see them.)

Adding these exposes a GUI that comes up when you click on the PV tray icon. I found the option to disable dropped frames and turned it on. You could also just add the following to the same key:

- DisableDropFrames (REGWORD set to 1)

That's it. Now everything is working perfectly. Thanks for your help!

jeffy
14th July 2007, 11:48
Is the alternate duration seeking method failing, or do you just want to shorten the time it takes to retrieve the duration? I'm afraid you can't really control the latter because it entirely depends on the time necessary to open the .avs in WMP. If the .avs script is a complex one, it might take 15-20 seconds to just open it.

Thank you for your reply. Unfortunately I know that the first detection always fails for me, so I would just like to skip it. Is it possible? The alternate detection always works for me :)

zambelli
15th July 2007, 04:48
That's it. Now everything is working perfectly. Thanks for your help!
I'm glad that worked for you! Thanks for posting the solution too - I'm sure that will help out others who run into a similar issue.

The reason MPEG-2 decoders often drop frames in transcoding operations is because many of them are designed to be used primarily in playback - where it's desired to drop frames when the decoder can't keep up with realtime decoding.

zambelli
15th July 2007, 04:52
Thank you for your reply. Unfortunately I know that the first detection always fails for me, so I would just like to skip it. Is it possible? The alternate detection always works for me :)
The current "alternate duration detection" method is invoked any time the default duration retrieving method fails. It's irrelevant of the input format type - I don't even check for .avs input specifically. It's a workaround, admittedly, not a proper solution, but it's just what was necessary to make 5-year old code do stuff it wasn't supposed to do in the first place. :) It's pretty much as good as it can get in the script version of the encoder, I'm afraid.

lv-jedster
15th July 2007, 21:45
I'm glad that worked for you! Thanks for posting the solution too - I'm sure that will help out others who run into a similar issue.

The reason MPEG-2 decoders often drop frames in transcoding operations is because many of them are designed to be used primarily in playback - where it's desired to drop frames when the decoder can't keep up with realtime decoding.

Learning that was definitely they important piece of the puzzle -- thanks again.

Do you have any thoughts on whether it matters if I tell the PureVideo Decoder to output to Overlay, VMR7, or VMR9?

Also, I think it may be possible to to tell it to prefer outputting in a certain colorspace. (I saw registry item that was something like PreferYV12 or somesuch.) If I can force it to output in a colorspace, is there any colorspace that would be best, or is the encoder agnostic?

(I assume these are actually features of NVidia's Video Post-processor, but as I'm still a relative novice, I might not be understanding something fundamental.)

Hands-down, the video quality is better now that I'm using PV as the decoder -- very happy.

p.s.: I have one unrelated question -- where would be the appropriate spot to read recommendations for Vista's decoder for simply watching MPEG2 content. I'm debating between trying to make PureVideo work, sticking with the default decoder, or using either PowerDVD or WinDVD. I'm not a huge fan of ffdshow's deinterlacing, nor I am a fan of video processing. In fact, the only post-processing that I am interested in is audio -- dynamic range compression and lip-sync, both of which are handled decently by NVIDIA.

lv-jedster
16th July 2007, 06:40
New question for you zambelli: I've noticed that sometimes when I'm compressing an MPEG that has been ripped, the encoder does not always encode the full clip, usually shortening it, but sometimes eliminating the middle.

is there any option in the wmcmd.vbs script that will fix this issue or any other easy solution that you know of?

i'm assuming that i'll need to reprocess the mpeg files (perhaps i need to learn what demuxing is all about...) but if there was a shortcut, that'd be great news.

zambelli
17th July 2007, 10:32
Do you have any thoughts on whether it matters if I tell the PureVideo Decoder to output to Overlay, VMR7, or VMR9?
It won't matter when transcoding. Those options are for rendering to screen only.

New question for you zambelli: I've noticed that sometimes when I'm compressing an MPEG that has been ripped, the encoder does not always encode the full clip, usually shortening it, but sometimes eliminating the middle.
Hm, I'm not sure what's going on there. In general most people on this forum who transcode MPEG-2 to other formats don't use DirectShow decoders. Instead they use Avisynth and DGMPGDec plugin because it allows greater control over the decoding process. DirectShow MPEG decoders are designed for realtime playback so they often include post-processing and options that aren't necessarily beneficial in transcoding. Donald Graft's DGMPGDec plugin allows you to disable post-proc entirely, ignore pulldown flags, etc. If you do a lot of MPEG-2 transcoding, I would recommend that you look into Avisynth and DGMPGdec.

ACrowley
18th July 2007, 09:23
MKV is not one of the supported input formats. It's mentioned nowhere in the documentation. I've no idea what the encoder thinks it's reading.

600 second buffer is HUGE. You don't want that.
Advice: Don't just copy+paste command lines you see in random threads. Read the documentation.

Do yourself a favor and uninstall K-Lite. It's a terrible excuse for software.


yes, it was a typo in one of my 1st posts about a cbr commandline with 60000Buffer


Ofcourse it must be -v_Buffer 60000

jeffy
2nd August 2007, 15:34
Can you please answer:
1) Is it possible to create with WMCmd.vbs a file containing mp2 or
2) aac sound?

3) Is it possible to create a video only file (eg. VC-1) and mux it with the file containing mp2 or aac sound with some muxer and what is the name of such muxer (preferably free)?

I don't need whatever standalone compatibility, if I can play it on the PC only, it's okay. If possible, the container should either be WMV or AVI.

Thank you.

Sharktooth
2nd August 2007, 17:15
if you dont need standalones compatibility then why dont you use AVC+AAC in MP4?
the advantages are: wide range of available software (for newbies and experts, opensource/free or commercial) for encoding, faster encoding, faster decoding, better quality, can be played back on all OSes (including OSx and Linux) and probably in future standalones (even if you dont care...).

jeffy
2nd August 2007, 17:51
if you dont need standalones compatibility then why dont you use AVC+AAC in MP4?
the advantages are: wide range of available software (for newbies and experts, opensource/free or commercial) for encoding, faster encoding, faster decoding, better quality, can be played back on all OSes (including OSx and Linux) and probably in future standalones (even if you dont care...).

I do use this method, but I am testing VC-1 (and WMV9 Main Profile VFW) as well.

benwaggoner
2nd August 2007, 19:14
Can you please answer:
1) Is it possible to create with WMCmd.vbs a file containing mp2 or
2) aac sound?
Nope. It just does Windows Media files and the codecs supported in the current Format SDK.

3) Is it possible to create a video only file (eg. VC-1) and mux it with the file containing mp2 or aac sound with some muxer and what is the name of such muxer (preferably free)?
You can make a video-only .wmv file using the -videoonly flag, but it always makes an ASF file, not an elementary stream.

We're working with a variety of companies who will be releasing products with elementary stream output support.

I don't need whatever standalone compatibility, if I can play it on the PC only, it's okay. If possible, the container should either be WMV or AVI.
If you want WMV, why not use VC-1 and WMA? Can you give some more details about what you're trying to do?

jeffy
2nd August 2007, 21:53
Nope. It just does Windows Media files and the codecs supported in the current Format SDK.


You can make a video-only .wmv file using the -videoonly flag, but it always makes an ASF file, not an elementary stream.

We're working with a variety of companies who will be releasing products with elementary stream output support.


If you want WMV, why not use VC-1 and WMA? Can you give some more details about what you're trying to do?

Thank you for your reply. I don't want to argue, but to me both the original mp2 or recoded aac audio sounds better than Windows Media Audio, even in its last version. So I would like to have the Windows Media Video (VC-1 or WMV9 Main profile [VfW version]), but mp2 or aac audio. I know I can have an avi file with VirtualDubMod, where I can have WMV9 + mp2. But what if I want VC-1 + mp2? Am I out of options? Thank you.

benwaggoner
3rd August 2007, 01:36
Thank you for your reply. I don't want to argue, but to me both the original mp2 or recoded aac audio sounds better than Windows Media Audio, even in its last version. So I would like to have the Windows Media Video (VC-1 or WMV9 Main profile [VfW version]), but mp2 or aac audio. I know I can have an avi file with VirtualDubMod, where I can have WMV9 + mp2. But what if I want VC-1 + mp2? Am I out of options? Thank you.
Ah. Even if you made a .wmv like that, none of the normal players would work.

I'd like to explore a bit the problems you're having with WMA audio. WMA Pro in particular is quite a bit more efficient than AC-3, and scales all the way up to lossless. Can you describe in more detail where you're hearing audio issues?

jeffy
3rd August 2007, 09:08
Ah. Even if you made a .wmv like that, none of the normal players would work.

I'd like to explore a bit the problems you're having with WMA audio. WMA Pro in particular is quite a bit more efficient than AC-3, and scales all the way up to lossless. Can you describe in more detail where you're hearing audio issues?
Like I said, it's a subjective feeling. If you're recompressing lossy mp2 [MPEG-1 Audio Layer 2] (256 kb/s, CBR - one of the formats my analog TV capture card does) into another lossy format (AAC or WMA), aren't you always losing something more? So if possible, the original suits me best. But like I also said, I don't want to argue, it's a purely subjective feeling. Therefore I am happy I can create a file with WMV9 VCM in VirtualDubMod where the original mp2 file is included and working within the AVI container.
On the other hand, the video quality of VC-1 is better than what WMV9 VCM version allows.

benwaggoner
3rd August 2007, 09:48
Like I said, it's a subjective feeling. If you're recompressing lossy mp2 [MPEG-1 Audio Layer 2] (256 kb/s, CBR - one of the formats my analog TV capture card does) into another lossy format (AAC or WMA), aren't you always losing something more? So if possible, the original suits me best. But like I also said, I don't want to argue, it's a purely subjective feeling. Therefore I am happy I can create a file with WMV9 VCM in VirtualDubMod where the original mp2 file is included and working within the AVI container.
On the other hand, the video quality of VC-1 is better than what WMV9 VCM version allows.
Yes, you'll lose some little bit of accuracy. But will it be audible within the noise threshold of your audio gear? At some point good enough gets good enough that you can't tell the difference between it and perfect.

Plus, you could always break down and use the lossless codec.

Coming from MP2, I imagine that a 2-pass VBR WMA encode at the same bitrate and sample rate would sound nearly identical. It's not like MP2 was that high fidelity to begin with unless you're doing up around 384 Kbps.

jeffy
3rd August 2007, 11:33
Yes, you'll lose some little bit of accuracy. But will it be audible within the noise threshold of your audio gear? At some point good enough gets good enough that you can't tell the difference between it and perfect.

Plus, you could always break down and use the lossless codec.

Coming from MP2, I imagine that a 2-pass VBR WMA encode at the same bitrate and sample rate would sound nearly identical. It's not like MP2 was that high fidelity to begin with unless you're doing up around 384 Kbps.
Unfortunately, if you mean with my capture card, I cannot use a lossless codec. I can use up to 48 kHz/384 Kbps, but only with MPEG-1 Audio Layer 2. The card is Hauppauge PVR350. So I don't have a lossless source to begin with.
Regarding fidelity, you are probably right there are some higher losses with 256 Kbps.
Maybe I will retry 2-pass VBR WMA encode at the same bitrate and sample rate...

Added:
Is there really any difference between 1-pass CBR and 2-pass VBR WMA when the source has a constant bitrate?

Sharktooth
3rd August 2007, 13:57
You can always mux VC1 and MP2 into MKV...

jeffy
3rd August 2007, 14: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, 17:23
http://forum.doom9.org/showthread.php?t=127392

benwaggoner
3rd August 2007, 19: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, 12: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, 19:24
Thank you for your replies, benwaggoner, Sharktooth and zambelli, they were all really helpful!

aqualung99
10th August 2007, 01: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, 11: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, 19: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, 03: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, 03: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, 01: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, 15: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, 15: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, 07: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, 08: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, 08: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, 10: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, 10: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, 10: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, 10: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, 10:41
Using the latest May 21, 2007 WMCmd.vbs on XP.

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

then retry encoding


BHH

leoenc
19th August 2007, 19: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, 20: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, 03: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, 03: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, 08: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, 08: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, 09: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, 18: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, 22: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
27th August 2007, 00: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, 02: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, 05: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, 06: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, 11: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, 04: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, 15: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, 03: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, 04: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, 08: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, 09: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, 15: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, 02: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, 05: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, 05: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, 08: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, 11: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, 11: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, 22: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.

Rash
2nd September 2007, 01:01
No, Fox, you are cropping the black bars that are "burned in" the video stream (that are encoded in the source video). So you are not losing effective pixels (or image pixels), you are simply losing black pictures. He advised you to do so in order to help the codec encode only the image itself, and no black bars with it.

Try creating an AVS script with a tool, such as MeGUI, that will help you crop the black bars properly.

Zambelli, thank you very much for you fast help. :) Here are what you asked me:

-a_mode 1 (bitrate OK)

PS D:\home\rash\Development\Eng test\wav> cscript "C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs" -input e
ng_test.wav -output eng_test.wma -a_codec WMA9PRO -a_mode 1 -a_setting 384_48_6_24
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: 201.5s (97.5%) Elapsed: 00:01:14 Left: 00:00:02 [2.72x]

======== Begin Pass2 ========
Encoded: 141.2s (68.3%) Elapsed: 00:00:04 Left: 00:00:02 [35.3x]

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

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

Overall:
Encoding time: 83 seconds
Average bit rate: 384000 bps
File size: 10018183 bytes
File duration: 206.955 seconds

-a_mode 4 (bitrate not OK)

PS D:\home\rash\Development\Eng test\wav> cscript "C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs" -input e
ng_test.wav -output eng_test.wma -a_codec WMA9PRO -a_mode 4 -a_setting 384_48_6_24
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: 203.8s (98.6%) Elapsed: 00:00:34 Left: 00:00:00 [5.99x]

======== Begin Pass2 ========
Encoded: 202s (97.7%) Elapsed: 00:01:20 Left: 00:00:02 [2.52x]

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

Audio :
Codec: Windows Media Audio 10 Professional
Expected bit rate: 384000 bps
Average bit rate: 565490 bps
Expected sample rate: 2929
Average sample rate: 4314
Dropped byte count: 0 bytes
Dropped sample rate: 0
Total bytes: 14630912 bytes

Overall:
Encoding time: 119 seconds
Average bit rate: 565490 bps
File size: 14664574 bytes
File duration: 207.093 seconds

I'm using Windows Media Encoder x64 on Windows Vista Ultimate x64.

This file of mine is part of an audio/video project. This is a 5.1 audio channel encoded from 6 mono wavs (in the test above they are in a wav_ext file, but encoding from a wme project for the 6 mono channels result the same). I was encoding audio (6 mono wavs) and video all from a wme project when I noticed this effect. If I set 128_48_6_24 I get an aproximate 386 kbps file. But Windows Media Player reports it as 128 VBR 6 channel, though the file properties states 386 kbps. Doing the math (well, the script does it for us), taking the filesize and duration we can see that the real bitrate is indeed 565kbps.

Now that I have encoded everything, I came about a new question. How do I set a delay for audio? My audio is -275ms delayed, so I have to delay the video -275 ms (but -v_buffer doesn't allow me to set negative numbers) or delay the audio 275 ms. Is it possible?

The resulting video quality is amazing! :D With just 2.8Mbps for a 720x480 video.

Thank you ver much for your help. ;)

FoxRacR17
2nd September 2007, 02:35
No, Fox, you are cropping the black bars that are "burned in" the video stream (that are encoded in the source video). So you are not losing effective pixels (or image pixels), you are simply losing black pictures. He advised you to do so in order to help the codec encode only the image itself, and no black bars with it.

Try creating an AVS script with a tool, such as MeGUI, that will help you crop the black bars properly.

Thanks for the reply Rash, i'll try out MeGUI when i get home later tonight to see how to crop out the black bars.

Can anyone tell me how to figure out what resolution i should use depending on what the aspect ratio of the source is? Is there some formula or something?

zambelli
2nd September 2007, 09:38
Can anyone tell me how to figure out what resolution i should use depending on what the aspect ratio of the source is? Is there some formula or something?
Well, yeah, the aspect ratio is the aspect ratio of width over height. If you know the aspect ratio of the movie (i.e. 2.35:1), take the target width and divide it by the AR, then round to nearest multiple of 16. So if you're targetting 1280 pixels wide, that's 1280 / 2.35 = 544.68. The nearest multiple of 16 is 544.

Most of the time you can just figure this out practically by loading the .avs in VirtualDub and using the Crop function of the Null transform filter to figure out how far the black bars go.

FoxRacR17
2nd September 2007, 17:09
Well, yeah, the aspect ratio is the aspect ratio of width over height. If you know the aspect ratio of the movie (i.e. 2.35:1), take the target width and divide it by the AR, then round to nearest multiple of 16. So if you're targetting 1280 pixels wide, that's 1280 / 2.35 = 544.68. The nearest multiple of 16 is 544.

Most of the time you can just figure this out practically by loading the .avs in VirtualDub and using the Crop function of the Null transform filter to figure out how far the black bars go.

Thanks zambelli, for all your help! I successfully cropped off the black bars on top and bottom using megui thanks to the hint that Rash gave me, and i resized the video to 1280x528 since the video is 2.40:1 according the case. Thanks guys, i'm getting so close i can taste it! lol.

However i still have a problem when i try to encode with 2 pass peak vbr. I have now tried it with two different video files and its the same result, video is stuttering or acting like it is two video files overlapped and playing off sync by like half a second.

sportcenter
3rd September 2007, 01:41
Thanks zambelli, for all your help! I successfully cropped off the black bars on top and bottom using megui thanks to the hint that Rash gave me, and i resized the video to 1280x528 since the video is 2.40:1 according the case. Thanks guys, i'm getting so close i can taste it! lol.

However i still have a problem when i try to encode with 2 pass peak vbr. I have now tried it with two different video files and its the same result, video is stuttering or acting like it is two video files overlapped and playing off sync by like half a second.

what kind of equipment are you encoding on?...b/c the 1-pass insane .vbs i have been using has given almost identical results to 2-pass "best" .vbs scripts i have done...

FoxRacR17
3rd September 2007, 04:46
what kind of equipment are you encoding on?...b/c the 1-pass insane .vbs i have been using has given almost identical results to 2-pass "best" .vbs scripts i have done...

I'm running an AMD Athlon X2 2.5Ghz with 3 Gigs of DDR400 memory. Doing a 1pass CBR with "best" setting it takes around 16-18 hours to encode.

sportcenter
3rd September 2007, 06:40
I'm running an AMD Athlon X2 2.5Ghz with 3 Gigs of DDR400 memory. Doing a 1pass CBR with "best" setting it takes around 16-18 hours to encode.

and do you get "stuttering" w/ 1 pass?

FoxRacR17
3rd September 2007, 09:46
no, its only when i try 2 pass peak VBR. I can do 1 and 2 pass CBR and it turns out great. I have uploaded a sample of what i'm talking about, it starts out fine, but then after around 10 seconds it starts to mess out, check it out:
http://www.megaupload.com/?d=XLJCU1W8

This is my .avs script:
DirectShowSource("E:\video.grf",fps=23.976,framecount=4315,seekzero=false,seek=true,audio=false)
crop( 0, 140, 0, -140)
Spline36Resize(1280,528)

and this is my 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 4 -v_preset better -v_bitrate 8000000 -V_peakbitrate 12000000 -v_keydist 30 -v_buffer 60000 -v_peakbuffer 60000

sportcenter
3rd September 2007, 10:14
no, its only when i try 2 pass peak VBR. I can do 1 and 2 pass CBR and it turns out great. I have uploaded a sample of what i'm talking about, it starts out fine, but then after around 10 seconds it starts to mess out, check it out:
http://www.megaupload.com/?d=XLJCU1W8

This is my .avs script:
DirectShowSource("E:\video.grf",fps=23.976,framecount=4315,seekzero=false,seek=true,audio=false)
crop( 0, 140, 0, -140)
Spline36Resize(1280,528)

and this is my 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 4 -v_preset better -v_bitrate 8000000 -v_peakbitrate 12000000 -v_peakbuffer 10000 -v_mmatch 0


try that script...

and here is a sample from my latest run...

http://www.megaupload.com/?d=16027WNY

sportcenter
3rd September 2007, 17:29
what about this...never had this problem...

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


Warning: Encoder failed to retrieve duration attribute from source plug-in.
.

Warning: Encoder failed to retrieve source duration again.
Encode process might not continue or progress report may be inaccurate.

..................................................................................

and then closes...?....

Rash
3rd September 2007, 17:49
I'm glad it worked Fox. :)

Does anybody have any suggestions as how to delay the audio? Please? Look at my first post on this page. Thank you!

FoxRacR17
3rd September 2007, 18:16
I'm glad it worked Fox. :)

Does anybody have any suggestions as how to delay the audio? Please? Look at my first post on this page. Thank you!

Yeah, use delaycut (http://jsoto.posunplugged.com/audiotools.htm) on the individual wav files. I had to find this out kinda on my own with batman begins. When you open of the .evo for batman begins i noticed on the .ddp audio it said something like (+100ms), however on v for vendetta it didnt say anything. So i got delaycut and first tried it on the multichannel .wav but it was not working that way. So what i had to do was do each individual .wav one at a time.

So do the eac3to like normal, then do the tranzcode like normal to get the split up waves, then stop it before wavavimux makes the audio .avi file. Load the first .wav file in delaycut, and then click the little box for "delay" and put in a time (in ms), then repeat for the other five wavs. One you have that done you can continue with wavavimux and then encode to whatever you want.

I found out that when i used the 100ms that evodemux told me on the original .evo, the audio was FINALLY right on with the video for batman begins. That movie was driving me crazy trying to figure that out.

what about this...never had this problem...

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


Warning: Encoder failed to retrieve duration attribute from source plug-in.
.

Warning: Encoder failed to retrieve source duration again.
Encode process might not continue or progress report may be inaccurate.

..................................................................................

and then closes...?....

I got that error once or twice, i dont know why, but all i did was restart the bat file and then it worked fine, so sorry i cant be of anymore help, and thanks for the command line, i'll try it out and see if it helps.

FoxRacR17
3rd September 2007, 19:14
Well i tried that command line sportcenter and it turned out exactly the same. It looks good but once it gets to that box thing it starts messing up.

sportcenter
4th September 2007, 07:50
Well i tried that command line sportcenter and it turned out exactly the same. It looks good but once it gets to that box thing it starts messing up.

are you doing anything else on your pc (hdd) when it is encoding?....

acribb
5th September 2007, 01:31
I too am having problems with a VBR peak bitrate encode. I have tried twice now with no luck. Once with a vpeakbuffer of 5000 and one try with a vpeakbuffer of 60000. No dice. I get what seem to be the same results as FoxRacr17.

Avs script for both:
Directshowsource("E:\WMV-HD Encoding\Video_Only.grf", fps=23.976, audio=false, seekzero=false, seek=true, framecount=188890)
spline36resize(1280,720)

1st try:
cscript.exe "D:\Program Files\Windows Media Components\Encoder\wmcmd.vbs" -input "E:\WMV-HD Encoding\Video_Only.avs"
-a_input "E:\WMV-HD Encoding\audio.avi" -output "E:\WMV-HD Encoding\output.wmv" -v_codec WVC1 -v_mode 4 -v_preset better
-v_keydist 30 -v_peakbuffer 5000 -v_bitrate 8000000 -v_peakbitrate 12500000 -v_quality 100
-a_codec wmapro -a_setting 640_48_6_24

.......
Source duration retrieved: 7878.3 seconds.

======== Begin Pass1 ========
Read: 7878.1s (100%) Elapsed: 09:55:52 Left: 00:00:01 [0.22x]

======== Begin Pass2 ========
Encoded: 7878.3s (100%) Elapsed: 35:11:39 Left: 00:00:01 [0.06x]

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

Audio :
Codec: Windows Media Audio 10 Professional
Expected bit rate: 640032 bps
Average bit rate: 640031 bps
Expected sample rate: 5859
Average sample rate: 5859
Dropped byte count: 0 bytes
Dropped sample rate: 0
Total bytes: 630295948 bytes

Video :
Codec: Windows Media Video 9 Advanced Profile
Expected bit rate: 8000000 bps
Average bit rate: 7937932 bps
Expected fps: 23.976
Dropped frame count: 0
Total coded frames: 188890
Average sample rate: 23.952
Dropped bytes: 0 bytes
Total bytes: 7817138838 bytes

Overall:
Encoding time: 162493 seconds
Average bit rate: 8577963 bps
File size: 8469844808 bytes
File duration: 7878.314 seconds

Audio in sync but video stutters consistently after about 5 minutes into the movie.

2nd try
cscript.exe "D:\Program Files\Windows Media Components\Encoder\wmcmd.vbs" -input "E:\WMV-HD Encoding\Video_Only.avs"
-a_input "E:\WMV-HD Encoding\audio.avi" -output "E:\WMV-HD Encoding\output.wmv" -v_codec WVC1 -v_mode 4 -v_preset better
-v_keydist 30 -v_peakbuffer 60000 -v_bitrate 8000000 -v_peakbitrate 12500000 -v_quality 100
-a_codec wmapro -a_setting 640_48_6_24

.....
Source duration retrieved: 7878.3 seconds.

======== Begin Pass1 ========
Read: 7877.9s (100%) Elapsed: 09:51:36 Left: 00:00:02 [0.22x]

======== Begin Pass2 ========
Encoded: 7878.3s (100%) Elapsed: 35:09:50 Left: 00:00:01 [0.06x]

Blew up with one second left! Incomplete file has out of sync audio from the start of the movie. Is this because the file failed to complete processing?
Video STILL stutters just like the first encode, about 5 minutes in. Stutters exactly as FoxRacr17 describes above.

It takes my old school P4 3 ghz HT about 48 hours per encode, so any help would be greatly appreciated.....

Thanks..

sportcenter
5th September 2007, 01:46
do only video encoding first....then audio...then mux together w/ windows media encoder

try this...

cmd /k cscript.exe c:\windows\wmcmd.vbs -input c:\encodes\hotfuzz.avs -output c:\encodes\hotfuzz.wmv -v_codec WVC1 -videoonly -v_width 1280 -v_height 544 -v_mode 4 -v_preset best -v_bitrate 8765000 -v_peakbitrate 12000000 -v_peakbuffer 10000 -v_mmatch 0

obviously you can take the v_width and v_height out if you have spline36resize in your avs and you can replace "best" w/ "better" if you like

also why are you guys not using

ConverttoYV12()
Asharp(1,3)

in your avs scripts? it will make your video look almost identical to the source

if the above script doesn't work, i hate to say it but it may be the equipment you guys are using - it may be too slow

2-pass "best"takes me around 16 hours on my pc

Q6600
4GB RAM
74GB Raptor

FoxRacR17
5th September 2007, 03:54
Whenever i add Asharp(1,3) my avs. file will not play and WME will not encode the movie. Any ideas why?

FoxRacR17
5th September 2007, 04:04
Whenever i add Asharp(1,3) my avs. file will not play and WME will not encode the movie. Any ideas why?

Nevermind, i downloaded the asharp.dll and put it in the plugins folder and now it works. Out of curiosity, what does those two filters do exactly?

sportcenter
5th September 2007, 04:20
Nevermind, i downloaded the asharp.dll and put it in the plugins folder and now it works. Out of curiosity, what does those two filters do exactly?

Motion Adaptive Edge Sharpening....it works wonders

*thanks Crowley :)

Rash
6th September 2007, 18:25
I encoded some videos here though I think my VC-1 encodes were too blurred. Here is my cmd

"C:\Windows\SysWOW64\cscript.exe" "C:\Program Files (x86)\Windows Media Components\Encoder\wmcmd.vbs" -input "ignoringu.avs" -output "video\ignoringu.wmv" -videoonly -v_codec WVC1 -v_mode 3 -v_preproc 0 -v_bitrate 2560000 -v_buffer 10000 -v_performance 100 -v_compopt 1 -v_dquantstrength 3 -v_percopt 3 -v_denoise 0 -v_median 0 -v_codedwidth 720 -v_codedheight 480 -pixelratio 40 33 -log ignoring.log

Maybe I should not use dquantstrength or percopt? I'm going to try Zambelli's "insane" preset today.

Oh, by the way Zambelli, WMA's 5.1 is still giving me some headaches.

D:\Home\Rash\Development\Pitty IgnorinU\audio>"C:\Windows\SysWOW64\cscript.exe"
"C:\Program Files (x86)\Windows Media Components\Encoder\wmcmd.vbs" -input "igno
ringu synced.wav" -output "ignoringu.wma" -a_codec WMA9PRO -a_mode 3 -a_setting
384_48_6_24
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: 265.8s (96.7%) Elapsed: 00:00:40 Left: 00:00:01 [6.64x]

======== Begin Pass2 ========
Encoded: 260.5s (94.8%) Elapsed: 00:00:42 Left: 00:00:02 [6.2x]

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

Audio :
Codec: Windows Media Audio 10 Professional
Expected bit rate: 384000 bps
Average bit rate: 1030045 bps
Expected sample rate: 2929
Average sample rate: 7858
Dropped byte count: 0 bytes
Dropped sample rate: 0
Total bytes: 35389440 bytes

Overall:
Encoding time: 86 seconds
Average bit rate: 1030045 bps
File size: 35462651 bytes
File duration: 275.071 seconds

1Mbps is too much for audio. I'm sure WMA doesn't need all that to be transparent. The least I can achieve is 430 kbps for 128_48_6_24, but I think 430 is still too much. ;) (Windows Vista x64, WME9 32-bits, latest wmcmd.vbs).

Thank you all.

[EDIT] Oh, by the way, that program do you guys use to mux wmv and wma into a wmv file?. Thank you.

zambelli
7th September 2007, 03:49
-v_preproc 0 -v_denoise 0 -v_median 0
These are unnecessary because those are the default values anyway.
-v_mode 3 -v_buffer 10000
You don't need to specify a buffer for mode 3 - that's unconstrained 2-pass VBR. The buffer is determined by the encoder.
-v_performance 100 -v_compopt 1
Actually, the one thing you can't override in v_compopt 1 is the v_performance value. That gets locked into 60 when you set v_compopt 1. So your v_performance 100 is actually getting ignored here.

I generally would recommend taking all the settings that make up v_compopt 1 and setting those individually, rather than through v_compopt 1. It gives you greater control over them.

-v_dquantstrength 3 -v_percopt 3
If the picture is coming out too soft you could try removing v_percopt.

-v_codedwidth 720 -v_codedheight 480
If that's the resolution of your source, you don't need to set this. These settings are only for when you want the encoded resolution of the video to be different than the source and display resolution.

zambelli
7th September 2007, 04:09
1Mbps is too much for audio. I'm sure WMA doesn't need all that to be transparent. The least I can achieve is 430 kbps for 128_48_6_24, but I think 430 is still too much. ;) (Windows Vista x64, WME9 32-bits, latest wmcmd.vbs).
Unfortunately, I can't repro this with my sources. I tried both x86 and x64 codecs under Vista x64. Would it be possible for you to share your 6ch WAV source with me?

Rash
7th September 2007, 04:12
Well, sure there is a lot to be tweaked on my cmd, hehe. Thank you for the tips, Zambelli. ;) Most of the redundancies I already knew about, but since I was reusing my .bat from other encodes I simply changed what I was testing. My main concerns were really dquantstrength and percopt, I wasn't sure how to use them.

I just reencoded my videos using only -v_preset best (not insane at this time) and no other switch. So I'm not trying to override anything. I thought about setting -v_performance 100 because encoding time is no issue to me. I didn't know it couldn't be overridden. Thank you for the heads up.

I haven't seen the results yet because I'm still at work, hopefully they are not so soft at this time.

Thank you again. ;)

Sure I can send you my wavs. How do we do (6ch wav ~ 4 minutes is big :D)? I don't think lossless is a good idea, right? If the problem is in the wav or in the headers it would be useless. Well, just so you know I tried encoding from 6 mono wavs and I got the same result. So it could be an issue in my OS?

[UPDATE]
My videos turned out awesome! So -v_preset best is going to be my new standard encode right now (which is already quite slow, hehe, 3 hours for a 4 minute video at 720x480 ;)).

sportcenter
9th September 2007, 17:30
[EDIT] Oh, by the way, that program do you guys use to mux wmv and wma into a wmv file?. Thank you.


windows media encoder ----> stream editor

Rash
10th September 2007, 00:12
Yes, thank you Sportcenter but I had already figured that out myself. :)

Just a curiosity, is there a way to mux subtitles to the wmv file? I have some subs in the SAMI format (I've read they were necessary) but stream editor won't allow me to mux them. Thanks again.

zambelli
10th September 2007, 03:35
Sure I can send you my wavs. How do we do (6ch wav ~ 4 minutes is big :D)? I don't think lossless is a good idea, right? If the problem is in the wav or in the headers it would be useless. Well, just so you know I tried encoding from 6 mono wavs and I got the same result. So it could be an issue in my OS?
How big are the files? I could give you an FTP site to upload them to.

Do you have Ffdshow installed on your machine to decode PCM audio, by any chance?


My videos turned out awesome! So -v_preset best is going to be my new standard encode right now (which is already quite slow, hehe, 3 hours for a 4 minute video at 720x480 ;)).
Yikes. What CPU do you have?

Just a curiosity, is there a way to mux subtitles to the wmv file? I have some subs in the SAMI format (I've read they were necessary) but stream editor won't allow me to mux them.
You can't mux SAMI directly into ASF, but there is a way to add single-language subtitles to an ASF by using CAPTION script commands. The method is described here (http://msdn2.microsoft.com/en-us/library/aa391231.aspx), but I'm not aware of any tool that will do that automatically - though if anybody wanted to build it, they could use the WME9 SDK to do it.

tyee
10th September 2007, 23:47
Just a quick question. I want to start using this script and have spent a few days reading all the threads, but I believe to do the VC1 encoding I do not need a computer that can actually play HD-DVDs properly do I?
I only have a P4 2.8GHz machine but to rip/re-encode, to say an 8Mbps file, the computer just does it at it's own speed, right? All I need is the xbox hd-dvd player to get the info off the disk.

zambelli
11th September 2007, 00:10
Just a quick question. I want to start using this script and have spent a few days reading all the threads, but I believe to do the VC1 encoding I do not need a computer that can actually play HD-DVDs properly do I?
I only have a P4 2.8GHz machine but to rip/re-encode, to say an 8Mbps file, the computer just does it at it's own speed, right? All I need is the xbox hd-dvd player to get the info off the disk.
This is probably the wrong thread for HD-DVD ripping questions, but generally you're correct - you do not need an HD-DVD player to be able to encode to VC-1. Encoding and ripping are independent of each other.

sportcenter
11th September 2007, 04:49
Just a quick question. I want to start using this script and have spent a few days reading all the threads, but I believe to do the VC1 encoding I do not need a computer that can actually play HD-DVDs properly do I?
I only have a P4 2.8GHz machine but to rip/re-encode, to say an 8Mbps file, the computer just does it at it's own speed, right? All I need is the xbox hd-dvd player to get the info off the disk.

as Zambelli has mentioned....not the "ripping" thread....

but nonetheless, you are correct - your pc doesn't have to be able to play the discs, just retrieve the .evo's off the disc and begin encoding

sportcenter
11th September 2007, 04:52
[UPDATE]
My videos turned out awesome! So -v_preset best is going to be my new standard encode right now (which is already quite slow, hehe, 3 hours for a 4 minute video at 720x480 ;)).

my God....time for a Quad-Core...lol...

takes me ~ 19-22 hours for a 2-pass 2-hour movie @ 1280x544 w/ all the necessary filters and options

Rash
11th September 2007, 05:21
@ Zambelli,
The file is 135 MB (142,129,220 bytes). I do have ffdshow, but they are not set to decode PCM. Is it really necessary? Windows Media Player can play them fine.

Well, my CPU is an Athlon64 3000+ with 1GB RAM DDR400 and Windows Vista x64. Yes, I know what they say about Vista and 1GB RAM, specially Vista x64, but it does work for my needs. I can even play Guild Wars and Quake Wars fine. :)

When you say "single-language" subtitle you mean we can't have multiple languages to choose from, like in a DVD? That's probably what you meant, I just wanted to make sure. ;)

@ Sportcenter,
Indeed! My PC super upgrade project is coming next year. And it will be a Quad-Core CPU. :D

Thank you all for the help.

Jeremy Duncan
4th October 2007, 02:38
Hello, It's me Jeremy.

I tried to run this software from Zambelli today.
I got it to run now I want to try and tweak it for quality.

This is the avs code I want to run:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DGDecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MT.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ColorMatrix.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Fluxsmooth.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\decomb.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\aWarpSharp.dll")

MPEG2Source("C:\Documents and Settings\Dell\Desktop\Kill Bill\Kill Bill.d2v")

SetMemoryMax(1024)

AssumeTFF()
Telecide(chroma=false)
decimate()

Fluxsmootht(3)
MT("
FFT3DFILTER(sigma=0.6, ncpu=2, bw=14, bh=14, ow=7, oh=7, bt=2, dehalo=1, hr=1, sharpen=0.9)
",3,2)
ColorMatrix(Mode="Rec.601->Rec.709",clamp=false,threads=2)
aWarpSharp(depth=20, blurlevel=2, thresh=0.21, cm=0)

I got this to run fine in Virtualdub using Windows Media Video 9 VCM codec, but now after reading about the fantastic "VC-1" codec I want to see if the quality is better.

Here's my script I use with wmcmd.vbs:
cscript wmcmd.vbs -input "C:\Documents and Settings\Dell\Desktop\GitS\Gits.avs" -output "C:\Documents and Settings\Dell.wmv" -v_codec WVC1 -videoonly -v_bitrate 8000000 -v_preset better -v_buffer 60000 -v_quality 100

I have two goals to use for this software, then I'll make more goals.
A.) To use the fantastic VC-1 codec.
B.) To get the best quality, at the "ideally it should be 8 Mbps." bitrate.

So I'm hoping somebody can recommend a setting to get these two goals. :)

Also, I get this error message before it encodes:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Dell>cscript wmcmd.vbs -input "C:\Documents an
d Settings\Dell\Desktop\GitS\Gits.avs" -output "C:\Documents and Setting
s\Office Admin.wmv" -v_codec WVC1 -videoonly -v_bitrate 8000000
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

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


Warning: Encoder failed to retrieve duration attribute from source plug-in.
Trying alternate method now.......

Inventive Software
4th October 2007, 19:10
That message means that it has to use a WMP instance to get the duration, because it's an AVS file. That's a limitation of the WMV DMOs, so go bug MS about it, not necessarily Zambelli! ;)

Jeremy Duncan
4th October 2007, 23:14
Does that mean I can't use VC1 ?

Inventive Software
5th October 2007, 02:37
No, it just means it needs WMP9 minimum to run the script. Be patient with it and it'll eventually give you a progress bar, which means it's started encoding.

Jeremy Duncan
6th October 2007, 15:03
What I'm hoping to do is simple.
- Use vc1, get the fasted encode at 100 quality, using 8 Mbps bitrate.

After this I'll ask about muxing the dgindex ac3 sound into the wmv I made.

So, a recommendation for the first question: settings ? :script::thanks:

sportcenter
9th October 2007, 20:35
recently re-installed OS and now when i start my vbs script (same ones i have used before)it fails twice...and then just sits there

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


Warning: Encoder failed to retrieve duration attribute from source plug-in.
.

Warning: Encoder failed to retrieve source duration again.
Encode process might not continue or progress report may be inaccurate.

it is very annoying...how can i fix this?

foxyshadis
10th October 2007, 04:13
Install haali's media filter, ffdshow, and possibly WMP11? If you can play it in WMP, you shouldn't get that message.

buzzqw
11th October 2007, 07:59
Zambelli said that for avs input, the current implementation of wmcmd.vbs , is unable to extract exact duration

and then just sits there
you don't see dots spawing while time elapse ?

BHH

zambelli
11th October 2007, 10:31
That message means that it has to use a WMP instance to get the duration, because it's an AVS file. That's a limitation of the WMV DMOs, so go bug MS about it, not necessarily Zambelli! ;)
Actually, it's a limitation of the WME9 SDK... And since WMCmd.vbs is a VBScript it can't use native APIs like DirectShow to work around the duration issue - it can only use ActiveX objects such as WME9 and WMP object models to do stuff.

@Jeremy:
The warning is, well, just a warning - not an error. If you eventually get a duration, it's all good.

@Sportcenter:
If you can play the .avs in WMP, you ought to be able to get a valid duration in WMCmd too. The only occasions it ever times out is if the Avisynth script takes too long to load (longer than 30 seconds).

zambelli
11th October 2007, 10:36
New version of WMCmd.vbs is now available!

Changelog:

10-11-2007:
-----------
Added -v_qp option as an alternative to -v_quality for 1-pass VBR encoding (which is in fact a fixed QP encoding mode). Whereas -v_quality uses an abstract 0 to 100 scale, -v_qp maps directly to quantizer parameter values in the 1.0 to 31.0 range (in 0.5 increments).
Encoder registry settings are now removed immediately after the encoder session is started because the codec only reads them once at the beginning of the encode so there's no reason for them to hang around until the end of the encoding session. This ought to improve parallel encoding jobs interoperability too.
The script no longer indiscriminately destroys existing encoder registry settings. At the beginning of each encoding session it saves the existing registry settings and then restores them at the end. This improves usability in cases where one set of advanced encoder settings is set externally (manually or via PowerToy) while another is used from the command-line.
Deprecated -v_percopt in favor of new -v_adz option because valid range for -v_percopt didn't make much sense. -v_percopt will continue to work as before but it is no longer documented. -v_adz value range now matches that of "Perceptual Option" (Adaptive Dead-Zone) in WMV9 PowerToy. If both -v_percopt and -v_adz are specified, -v_percopt values will override -v_adz values.
Redefined and fully documented -v_preset quality presets. They should now better reflect their speed and quality rankings.
Made -v_compopt 1 into an Advanced Profile exclusive option because some of its components were exclusive to Advanced Profile. It's best to be on the safe side.

Barleyman
16th October 2007, 09:43
We've run some compression tests with automkv here (http://forum.doom9.org/showthread.php?p=1055890#post1055890) ..

Changing v_mslevel from 0 to 1 hits you with 40% performance penalty, I wonder how "significant" the "significant" image quality improvement is and if it's justified WRT using the same CPU time for higher v_performance for example?

April WMCmd.vbs update says the v_mslevel was changed but changes are not actually documented.. Is 1 still the fastest after 0?

ed: And alternatively, maybe it'd be better to drop v_performance a notch and use v_mslevel == 1? I would guess v_mslevel is less significant unless you're encoding ice hockey or something like that?

zambelli
17th October 2007, 01:58
If you're looking to make your encode go faster, you're probably better off staying at a higher complexity with just luma searching than going down to a lower complexity with chroma searching.

Yeah, -v_mslevel 1 is still the fastest after mslevel 0. The adaptive chroma search modes did not, unfortunately, make it into the v11 release as I had previously thought.

Barleyman
17th October 2007, 10:21
Pure speed-wise, complexity = 40 and mslevel = 1 is a lot faster than complexity = 60 and mslevel = 0 (http://forum.doom9.org/showthread.php?p=1056170#post1056170)

I wonder if the visual quality is better with either using complexity 40 with mslevel and dquant options or complexity 60 without? Yes, I can test it myself but I don't think I know what to look for exactly and I'd be victim of good old fashioned placebo-effect..

benwaggoner
17th October 2007, 20:28
Pure speed-wise, complexity = 40 and mslevel = 1 is a lot faster than complexity = 60 and mslevel = 0 (http://forum.doom9.org/showthread.php?p=1056170#post1056170)
I wonder if the visual quality is better with either using complexity 40 with mslevel and dquant options or complexity 60 without? Yes, I can test it myself but I don't think I know what to look for exactly and I'd be victim of good old fashioned placebo-effect..
MSLevel gives you chroma search, so you'd only expect to see a difference with content where chroma changes between frames but luma doesn't. This is most common with motion graphics, and sometimes with animation. The better luma search in higher complexities almost always pays off more.

Barleyman
17th October 2007, 21:17
The better luma search in higher complexities almost always pays off more.

On the other hand, complexity 60 takes about 60% more time than complexity 40, so..

benwaggoner
17th October 2007, 23:32
On the other hand, complexity 60 takes about 60% more time than complexity 40, so..
True, but the improvement in efficiency is way more than 1.5x of what you'd get out of chroma search with most content.

Barleyman
18th October 2007, 12:30
True, but the improvement in efficiency is way more than 1.5x of what you'd get out of chroma search with most content.

Might be summed up that chroma search is not worth it if you're trying to create a cpu-efficient profile with either 40 or 60 complexity.. I'm aiming for being able to compress one 42 minute 720p program during the time I'm at work so I have pretty well-defined compression speed target.

Jeremy Duncan
19th October 2007, 07:55
Hello, It's me Jeremy.

I tried to run this software from Zambelli today.
I got it to run now I want to try and tweak it for quality.

This is the avs code I want to run:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DGDecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MT.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ColorMatrix.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Fluxsmooth.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\decomb.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\aWarpSharp.dll")

MPEG2Source("C:\Documents and Settings\Dell\Desktop\Kill Bill\Kill Bill.d2v")

SetMemoryMax(1024)

AssumeTFF()
Telecide(chroma=false)
decimate()

Fluxsmootht(3)
MT("
FFT3DFILTER(sigma=0.6, ncpu=2, bw=14, bh=14, ow=7, oh=7, bt=2, dehalo=1, hr=1, sharpen=0.9)
",3,2)
ColorMatrix(Mode="Rec.601->Rec.709",clamp=false,threads=2)
aWarpSharp(depth=20, blurlevel=2, thresh=0.21, cm=0)

I got this to run fine in Virtualdub using Windows Media Video 9 VCM codec, but now after reading about the fantastic "VC-1" codec I want to see if the quality is better.

Here's my script I use with wmcmd.vbs:
cscript wmcmd.vbs -input "C:\Documents and Settings\Dell\Desktop\GitS\Gits.avs" -output "C:\Documents and Settings\Dell.wmv" -v_codec WVC1 -videoonly -v_bitrate 8000000 -v_preset better -v_buffer 60000 -v_quality 100

I have two goals to use for this software, then I'll make more goals.
A.) To use the fantastic VC-1 codec.
B.) To get the best quality, at the "ideally it should be 8 Mbps." bitrate.

So I'm hoping somebody can recommend a setting to get these two goals. :)

Also, I get this error message before it encodes:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Dell>cscript wmcmd.vbs -input "C:\Documents an
d Settings\Dell\Desktop\GitS\Gits.avs" -output "C:\Documents and Setting
s\Office Admin.wmv" -v_codec WVC1 -videoonly -v_bitrate 8000000
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

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


Warning: Encoder failed to retrieve duration attribute from source plug-in.
Trying alternate method now.......

I was actually hoping for some advice.
I don't know if the wmcmd.vbs script I posted meets these requirements.
"A.) To use the fantastic VC-1 codec.
B.) To get the best quality, at the "ideally it should be 8 Mbps." bitrate."
C.) A tip for speedy encoding would be nice too. :)

And I got that error while using wmp11 I think.

:script:

benwaggoner
24th October 2007, 22:46
Might be summed up that chroma search is not worth it if you're trying to create a cpu-efficient profile with either 40 or 60 complexity.. I'm aiming for being able to compress one 42 minute 720p program during the time I'm at work so I have pretty well-defined compression speed target.
That's reasonable. In general, I don't think I'd turn on chroma search until I hit Complexity 80 first with some headroom.