View Full Version : VC-1 Encoder SDK - Professional released
lazyn00b
28th December 2007, 06:39
http://www.microsoft.com/downloads/details.aspx?familyid=5031c859-e8da-41bc-98e3-c13add5378b0&displaylang=en&tm
"The Microsoft VC-1 Encoder SDK - Professional is designed to provide file-based and/or real-time encoding capability to general content creation toolsets or dedicated encoding software applications.
Optimizations and features include:
• Can output VC-1 Elementary Streams for delivery in HD Optical Disc applications
• Performance improvements over the Windows Media FSDK11 for the latest generation of processors from Intel and AMD
• Perceptual quality improvements over the Windows Media FSDK11
• Ability to control all advanced settings programmatically through the API (no registry key settings required)
• Native Hardware Acceleration API support"
Does this mean someone can finally design a free GUI to encode HD DVD/Blu-Ray compatible VC-1 streams?
mahsah
28th December 2007, 06:54
Woo, finally an ES encoder!
Sagittaire
28th December 2007, 08:36
Well ... someone can compile RAW2ES and AVI2ASF (Visual Studio) for make test ... ???
crypto
28th December 2007, 09:15
Well, I tried, but the samples do not link:
fatal error C1900: Il mismatch between 'P1' version '20060201' and 'P2' version '20050411'
1>LINK : fatal error LNK1257: code generation failed
Edit: Seems to require SP1, I am currently downloading
Edit 2: That did the trick. SP1 update for Vista was also needed:
Here are the compiled VC-1 sample encoders: VC1ProSDK-samples.zip (http://dvbportal.dyn1.de/download.php?file=VC1ProSDK-samples.zip)
Nic
28th December 2007, 14:15
http://nic.dnsalias.com/AVS2ASF.zip
I've modified the AVI2ASF sample to include:
Avisynth (.avs) YV12 file support
Encoding to both .vc1 ES streams and .asf files
There's more information in the Readme.txt. Source included.
Cheers,
-Nic
crypto
28th December 2007, 14:23
Nic, damn you're fast. I was just adding compressed AVI support, but your mod is better.
Kurtnoise
28th December 2007, 15:00
which splitter/decoder is required to play those files ?
Nic
28th December 2007, 15:05
Very little seems to be able to play .vc1 files. VideoLan can't nor can anything I've currently got installed. However, Nero 8's Showtime with the HDDVD plugin would be able to play it.
crypto
28th December 2007, 15:08
Splitters for VC-1 ES files:
- Sonic HD Demuxer
- V9E Parser (included in the SDK)
Decoders:
- WMVideo Decoder DMO (WMP 11 or WMF 11)
- Sonic Cinemaster Video Decoder >= 4.1
- FFDShow
- Cyberlink VC-1 Decoder (PowerDVD)
Sagittaire
28th December 2007, 16:07
Well this VC1 encoder is not able to produce HDDVD compliant stream (no telecine for pulldown flags).
Nic
28th December 2007, 16:19
It should be able to produce HDDVD compliant streams - what do you mean exactly by "no telecine for pulldown flags"? Maybe I can add whatever you need to the sample.
How are you checking compliance?
-Nic
buzzqw
28th December 2007, 16:20
would be possible to include support for audio ? (wma std/pro)
so will have a command line application able to encode video AND/OR audio and outputting asf (only video), asf (audio and video), wma (only audio).. and what about WMV output ?
and remove the "press input" final... ;)
thanks!
BHH
EDIT: -threads is broken
feeding audiodubbed avs will produce biiiig files (must ctrl+c...)
EDIT2: even feeding audidubbed and specifing -pr audio profile will not close the encoding
lance79
28th December 2007, 16:21
• Can output VC-1 Elementary Streams for delivery in HD Optical Disc applications
How do i get a HD compatible vc1 output from this?
I tried with a 1 minute sample.evo avs
DirectShowSource ("sample.evo",audio=false)
ConvertFPS(24000, 1001)
spline36resize(1280,720)
ConvertToYV12()
I used this command...
AVS2ASF -i sample.avs -o output.vc1 -framerate 23.976 -rate 8000 -ratecontrol 3 -profiletype 2 -bframes 2 -maxkeydist 6 -vbv 300000 -peakrate 28000
Encode took more then 10 minutes
Cinevision(Mui Generator) does not accept this stream, getting error...
No Sequence-Layer just before Entry-Point ??
Sagittaire
28th December 2007, 16:37
It should be able to produce HDDVD compliant streams - what do you mean exactly by "no telecine for pulldown flags"? Maybe I can add whatever you need to the sample.
How are you checking compliance?
-Nic
Well I have a special VC1 encoder (command line from pep) and you must add telecine flag for produce HDDVD NTSC compliant stream. These flags simulate 1080i30 interlaced stream with internal 1080p24 progressive stream.
Here command line for "HDDVD stream" without pulldown 3:2 flag
AVS2ASF.exe -i HDDVD.avs -o ElementryStream.vc1 -framerate 23.976 -ratecontrol 3 -rate 6000 -peakrate 20000 -vbv 1843200 -complexity 5 -profiletype 2 -bframes 1 -maxkeydist 14 -inloop 1 -motionsearchlevel 3 -mesearchmethod 2 -mbcost 1 -mvcost 1 -mvrange 4 -adaptiveGOP -videotype 0
Nic
28th December 2007, 16:56
http://nic.dnsalias.com/AVS2ASF.zip <-- new v0.2
@lance79: Please try the new version. Should solve that issue. (I was creating ES rather than ES_SH streams (ES_SH is needed for HDDVD compatability).
@buzzqw: Did you provide a .prx (Windows Media Profile) file for audio encoding? That should solve it. I'll try to make some and provide them in the .zip file for future versions. For -threads you also need to provide an -affinity switch to state the processor layout. Try -threads 2 -affinity 3 (or 1). Can't test here as I don't have a 2 processor machine handy.
@Sagittaire: Hmm quite specific. I can specify specifc TFF and RFF flags for every frame. Could that help?
-Nic
buzzqw
28th December 2007, 17:04
when setting -threads 2 -affinity 3 (or 1)
got this error
Encoding in ASF mode
Failure in CVC1EncASF::set_advancedProps
error = -20
Failure in CVC1EncASF::Init
hr = 0
VC1 SDK Error = -20
Final error code: -20
Total elapsed time in seconds = 0.031000
and even if providing a prx audio file (namely d6_qvbr_75_audio.prx , taken from program files\windows media components\encoder\settings) the encoding will not conclude. fyi i am using nicac3source feeding 2 channel ac3
BHH
lance79
28th December 2007, 17:16
Thx Nic, gonna give it another try...
Nic
28th December 2007, 17:28
http://nic.dnsalias.com/AVS2ASF.zip <-- v0.3
AviSynth (2.56 at least) doesn't seem to report no more audio frames even if requesting a sample beyond the total number. Hence the audio would encode forever. Hopefully this quick fix to avs2asf should workaround the problem.
The threads issue I cannot debug now - but it should be using the maximum number of CPUs it can by default anyway.
-Nic
buzzqw
28th December 2007, 17:35
Audio is FIXED!!! :thanks:
... about cpu.. not a big problem.. but just 1 core is used
thanks again!
dumb question: from asf to wmv.. it's just a matter of renaming file ?
EDIT: no 5.1 audio support... :(
Original Sample AVI2ASF code Copyright (C) Microsoft Corporation.
All rights reserved.
Avisynth, YV12 & Raw support added by Nic.
*************************************
Encoding in ASF mode
------------Start Analysis-----------
------------End Analysis------------
Average bit rate: 221.00, total bytes processed: 349068.00.
Total frames: 315.00, Coded frames: 315.00.
------------Start Encode-----------
Failure in CASFFileWriter::AddVideoStream
hr = c00d0806
Failure in CASFFileWriter::Init
hr = c00d0806
Failure in VC1Enc::InitFileWriter
hr = c00d0806
VC1 SDK Error = 0
Failure in CASFFileWriter::Destroy
hr = c00d002b
Failure in CVC1EncASF::DestroyFileReader
hr = c00d002b
Failure in Encode
hr = c00d0806
VC1 SDK Error = 0
Total elapsed time in seconds = 6.250000
BHH
Nic
28th December 2007, 17:43
"but just 1 core is used" <--- Not much I can probably do to fix that even when I get on a dual core machine :(
from asf to wmv.. it's just a matter of renaming file ?Yup, and you can use .wmv (instead of .asf) as the file extension too with avs2asf to save time renaming later :)
buzzqw
28th December 2007, 20:01
any hint about 5.1 audio ?:o
BHH
Wilbert
29th December 2007, 00:09
AviSynth (2.56 at least) doesn't seem to report no more audio frames even if requesting a sample beyond the total number. Hence the audio would encode forever. Hopefully this quick fix to avs2asf should workaround the problem.
Could you try this with v2.57? Thanks!
buzzqw
29th December 2007, 08:15
Could you try this with v2.57? Thanks!
i use avisynth version 2.58, 19/sept 2007 (22:10:51)
BHH
lance79
29th December 2007, 23:56
Do i need to set level to 3 with Advanced profile manualy or is this being done automaticly?
I'm getting this error in cinevision...
Error Content :A Combination of HorizontalSize, VerticalSizeis and Level is not supported in the BD standard
Nic
30th December 2007, 12:30
@Lance79:
From the help file that comes with the SDK it states:
You specify the profile type by specifying a value for the dwProfile member of the CONFIG_PROPERTIES structure. You specify the level, indirectly, when you specify the width, height, and peak bit rate using the same structure.
Advanced - Level 0 - 2 Mbps - 352 x 288 @ 30 Hz (CIF)
Advanced - Level 1 - 10 Mbps 720 x 480 @ 30 Hz (NTSC-SD) or 720 x 576 @ 25 Hz (PAL-SD)
Advanced - Level 2 - 20 Mbps 720 x 480 @ 60 Hz (480p) or 1280 x 720 @ 30 Hz (720p)
Advanced - Level 3 - 45 Mbps 1920 x 1080 @ 24 Hz (1080p) or 1920 x 1080 @ 30 Hz (1080i) or 1280 x 720 @ 60 Hz (720p)
Advanced - Level 4 - 135 Mbps 1920 x 1080 @ 60 Hz (1080p) or 2048 x 1536 @ 24 Hz
Setting -profiletype 2 will set it to Advanced. What source and encoding parameters are you using that is causing the non-compliant streams?
Cheers,
Nic
lance79
30th December 2007, 15:04
Thanks
i was using
AVS2ASF.exe -i test.avs -o ElementryStream.vc1 -framerate 23.976 -ratecontrol 3 -rate 6000 -profiletype 2 -peakrate 20000 -vbv 1843200 -complexity 5 -bframes 3 -maxkeydist 14 -inloop 1 -motionsearchlevel 3 -mesearchmethod 2 -mbcost 1 -mvcost 1 -mvrange 4 -adaptiveGOP -videotype 0
Source is a resize 1080p to 720p
Only thing i needed to do was change -peakrate above 20000
b.t.w When u think your ready with the Nic's VC-1 encoder GUI ? :)
@Lance79:
From the help file that comes with the SDK it states:
Setting -profiletype 2 will set it to Advanced. What source and encoding parameters are you using that is causing the non-compliant streams?
Cheers,
Nic
buzzqw
31st December 2007, 15:58
sorry to bother, the 5.1 audio problem is due to vc-1 encoder or something other ?
thanks and sorry
BHH
ACrowley
31st December 2007, 20:02
Splitters for VC-1 ES files:
- Sonic HD Demuxer
- V9E Parser (included in the SDK)
Decoders:
- WMVideo Decoder DMO (WMP 11 or WMF 11)
- Sonic Cinemaster Video Decoder >= 4.1
- FFDShow
- Cyberlink VC-1 Decoder (PowerDVD)
You cant use Cyberlinks VC1 Decoder out of PowerDVD Player..sadly ( because its DXVA capable )
I think your talking about to load the VC1 ES into PowerDVD..right ?
Works nice with VC1 ES the Output from AVS2ASF
@ Nic
Is it possible to add Status Informations into the Encoding Process ? I mean fps ,Remaing/Elapsed Time etc :)
crypto
1st January 2008, 10:41
You cant use Cyberlinks VC1 Decoder out of PowerDVD Player..sadly ( because its DXVA capable )
I think your talking about to load the VC1 ES into PowerDVD..right ?
Yes, that's what I meant. BTW. The WMVideo Decoder DMO also can use DXVA/DXVA2.
ACrowley
1st January 2008, 13:51
Yes, that's what I meant. BTW. The WMVideo Decoder DMO also can use DXVA/DXVA2.
Yeah.. true...
Golgot13
3rd January 2008, 02:04
Hi all,
Happy new year (sorry I'm late...)
"The Microsoft VC-1 Encoder SDK - Professional is designed to provide file-based and/or real-time encoding capability to general content creation toolsets or dedicated encoding software applications.
It's really strange that MS give the SDK...
Because 7 months before they sold it at some companies
to have many VC1 encoder solution for HD DVD (and BD).
And this companies developp nice VC1 encoder which sell
more than 15k$ but this encoder are not better PeP (1.06 or 1.07 core)
which is really not better than H264 encoder.... (MS can not proove it)
It's easy to make VC1 elementary stream for BD with this SDK
(there is not lot of information about flag for HDDVD....).
And it 's strange that Warner start to make specific encoding
for BD disc (before all encoding were for HDDVD and BD,
they only change flag for stream compliant)....
ToS_Maverick
3rd January 2008, 21:43
@Nic:
thank you very much for this tool! a gui would be nice.. anyone?
i got a problem with the following settings:
AVS2ASF -i "F:\Video\BlackPearl\Black.Pearl.Sample.avs" -o "F:\Video\BlackPearl\Black.Pearl.Sample.asf" -framerate 25 -rate 2000 -ratecontrol 3 -complexity 5 -profiletype 2 -bframes 2 -maxkeydist 6 -vbv 300000 -peakrate 10000 -denoise 0 -inloop 1 -median 0 -overlap 0 -motionsearchlevel 3 -mesearchmethod 2 -mbcost 1 -mvcost 1 -mvrange 4 -adaptivequant 10
works but with this added:
-dquantoption 2 -dquantpstrength 1 -dquantbstrength 1
i get an error, code -30
am i applying the wrong settings? something i should consider?
Meilo
4th January 2008, 00:58
What setting do you need to encode anamorphic (16:9)? I found a pixelaspectratioindex but have no idea what index to use...
Thanks
anrque
4th January 2008, 01:29
Wow, thank you Nic. I just saw this on the MS site and downloaded it. I really had no idea how I was going to use it but needed to try something. Another Google search led me here and of course you guys were on top of things. Many thanks!
anrque
4th January 2008, 03:20
I am getting the following errors just running the included test.avs through Nic's V0.3. It seems that the first failure is due to the option - peakrate 2000 and the second error I get with every .avs I've tried so far. I'm running this in XP BTW, WMP11 is installed.
Encoding in ES (Elementry Stream) mode
Failure in CVC1EncASF::set_advancedProps
error = -20
Failure in CVC1EncASF::Init
hr = 0
VC1 SDK Error = -20
Final error code: -20
Total elapsed time in seconds = 0.000000
Beastie Boy
4th January 2008, 17:22
First of all ,thanks to nic for providing AVS2ASF. Am I correct in thinking that this tool is kind of like an upgrade from wmvcmd.vbs provided by Zambelli? If so, I would like to use it for encoding video for XBox 360 playback, but most of the commands I see posted in this thread leave me a little bewildered.
I currently use a very simple command under wmvcmd.vbs with the following options:
-v_videoonly -v_bitrate 17000000 -v_peakbitrate 30000000 -v_buffer 15000 -v_preset better
Can anyone give me a comparable command for AVS2ASF? I must confess that I don't know what -v_preset better does, but I would be looking for high quality without going insane on the encoding time :)
Cheers, Beastie.
buzzqw
4th January 2008, 17:49
v_preset better does
you can open the wmvcmd.vbs with notepad .. and search for it ;)
case "fast" '
Complexity = 2, Lookahead = 16, Loopfilter = On, Overlap = On, B frames = 1
Performance = 40
Lookahead = 16
Loopfilter = 1
VideoOverlap = 1
BFrameDist = 1
case "good" '
Complexity = 3, Lookahead = 16, Loopfilter = On, B frames = 1
Performance = 60
Lookahead = 16
Loopfilter = 1
BFrameDist = 1
case "better" '
Complexity = 3, Lookahead = 16, Loopfilter = On, B frames = 1, MS Level = Integer Chroma, MS Range = Auto
Performance = 60
Lookahead = 16
Loopfilter = 1
BFrameDist = 1
MSLevel = 1
MSRange = -1
case "best" '
Complexity = 5, Lookahead = 16, Loopfilter = On, B frames = 1, MS Range = Auto
Performance = 100
Lookahead = 16
Loopfilter = 1
BFrameDist = 1
MSRange = -1
case "insane" '
Complexity = 4, Lookahead = 16, Loopfilter = On, B frames = 1, MS Level = True Chroma, MS Range = Auto, Motion Match = Auto
Performance = 80
Lookahead = 16
Loopfilter = 1
BFrameDist = 1
MSLevel = 2
MSRange = -1
MMatch = -1
BHH
Beastie Boy
4th January 2008, 18:04
you can open the wmvcmd.vbs with notepad .. and search for it ;)
BHH
Thanks, I didn't know that.
ToS_Maverick
4th January 2008, 23:40
i could narrow my problem down a bit
-dquantoption 1
works, but 2 and 3 doesn't! it's a very important parameter, since it improves gradients a lot!
jmnk
5th January 2008, 00:56
obviously I'm missing something obvious:
##########
G:\WMSDK\VC1ProSDK\Bin>AVS2ASF.exe
The system cannot execute the specified program.
##########
any pointers?
buzzqw
5th January 2008, 08:34
@jmnk
have you installed avisynth? wmp11 or wmfdist11.exe, have you the varius msvcrXX.dll and the WMEncoder9.exe ?
BHH
Meilo
5th January 2008, 15:32
@jmnk: I ran into the same, updting to the last version of .net solved the problem for me.
Opuz Klass
5th January 2008, 20:23
Nic,
Do you have any idea why AVS2ASF's -ratecontrol is only working with "3 = 2-pass peak constrained VBR" option?
Kurtnoise
5th January 2008, 21:14
you should post your whole command line...
Icemaan
5th January 2008, 22:35
Hallo and first happy new Year to all
I have tested and all works fine.But one Problem for me.
After the analysis Pass i get averange Bitrate of 4280 but i want have a averange Bitrate of 8000.
Source is an 1080p resized to 720p
Commandline is
-framerate 23.976 -ratecontrol 3 -rate 100000 -profiletype 2 -peakrate 20000 -vbv 1843200 -complexity 5 -bframes 3 -maxkeydist 14 -inloop 1 -motionsearchlevel 3 -mesearchmethod 2 -mbcost 1 -mvcost 1 -mvrange 4 -adaptiveGOP -videotype 0
Any Idea and thanks for help
Icemaan
Opuz Klass
6th January 2008, 03:54
you should post your whole command line...
If you don't specify any -ratecontrol the assumed/default -ratecontrol will be "3", so just add any -ratecontrol but "3" in the "Example.bat" included with the AVS2ASF.rar package.
For example:
AVS2ASF -i Test.avs -o ElementryStream.asf -framerate 25 -rate 1200 -profiletype 2 -bframes 2 -maxkeydist 6 -vbv 300000 -peakrate 2000 -ratecontrol 0
lance79
6th January 2008, 21:38
Is there any other way for getting a 720p encoded wmv video compatible with sonic BDA.
I found a VC1 es Writer but thatone doesnt seems to work.
For now i use VC-1 Encoder SDK and create avchd disc's with scenarist,but would be better for quality if reencode was not
necessary.
greetz,
lance
jmnk
7th January 2008, 03:20
@jmnk: I ran into the same, updting to the last version of .net solved the problem for me.
thanks, that indeed was the problem.
R3Z
7th January 2008, 06:40
Going by the help text, i thought this should work;
AVS2ASF.exe -i am_test.avs -o encoded.vc1 -framerate 25 -profiletype 2 -bframes 2 -maxkeydist 6 -qp 95 -ratecontrol 1
However it gives me an -20 error. Any ideas ?
Opuz Klass
7th January 2008, 13:04
Going by the help text, i thought this should work;
AVS2ASF.exe -i am_test.avs -o encoded.vc1 -framerate 25 -profiletype 2 -bframes 2 -maxkeydist 6 -qp 95 -ratecontrol 1
However it gives me an -20 error. Any ideas ?
That's the problem I reported. Glad to see I'm not alone (unfortunately). :)
R3Z
8th January 2008, 04:18
So does this build not support the constant quality (qp) option or is the command line wrong ? :confused:
Nic
8th January 2008, 22:34
Sorry I haven't been posting. I will look into this when I get some time. Moving to the other side of London and juggling a production release at work - So a little busy at present :)
-Nic
R3Z
9th January 2008, 03:58
Sorry I haven't been posting. I will look into this when I get some time. Moving to the other side of London and juggling a production release at work - So a little busy at present :)
-Nic
I can appreciate that :) I just had a horrible feeling i couldnt even get the command line correct.
benwaggoner
12th January 2008, 02:18
My blog post going into more details about the Professional and Enterprise versions of the VC-1 Encoder SDK is now up:
http://on10.net/blogs/benwagg/20613/Default.aspx
guada2
12th January 2008, 02:56
Hello benwaggoner, :)
MC Ref v1.0 would use it, the VC-1 Encoder SDK?
if it is true, Would it support 2 pass VBR encoding?
Thank you..
benwaggoner
12th January 2008, 04:55
Hello benwaggoner, :)
MC Ref v1.0 would use it, the VC-1 Encoder SDK?
if it is true, Would it support 2 pass VBR encoding?
Thank you..
I'm not surehat "MC Ref" is, but yes, the Pro SDK supports 2-pass VBR among the other usual modes.
crypto
12th January 2008, 10:35
Hi benwaggoner,
a big thank you for helping to make the ProSDK available and thanks for the clarification on the several editions in your blog post. I feel, it was not an easy decision to open the ProSDK, but it is the right one and will help VC-1 to get even more momentum.
guada2
12th January 2008, 23:18
MC Ref = Mainconcept reference
"surehat" ? I don't understand..
yes, the Pro SDK supports 2-pass VBR among the other usual modes.
Surely, but it possible that MC Ref have limits.
Of course, It is possible that I missed something or i am mistaken.
Bye. ;)
benwaggoner
13th January 2008, 03:12
MC Ref = Mainconcept reference
"surehat" ? I don't understand..
Surely, but it possible that MC Ref have limits.
Of course, It is possible that I missed something or i am mistaken.
Bye. ;)
Ah. Main Concept doesn't use the VC-1 Encoder SDK. Their low-cost verison is 1-pass only for all codecs AFAIK. Very limited for practical purposes.
guada2
13th January 2008, 16:00
@benwaggoner
Thank you for this clarification.
And, cheer for your work. :)
benwaggoner
14th January 2008, 22:57
@benwaggoner
Thank you for this clarification.
And, cheer for your work. :)
Thanks. And I'm really pleased that we were able to come up with a 0-cost solution for this community. I look forward to seeing what everyone here can do with it!
CruNcher
15th January 2008, 04:34
Nice now it gets interesting in compareing it with the recent X264 builds in terms of Speed/Quality and Grain Behaveiour :)
Btw wasn't there something about a Source you were going to provide for testing purposes ;)
And as crypto said good decission in terms of momentum now to catch the Web with Silverlight and VC-1, as on Media it seems the fight is lost and if Blu-Ray now wins VC-1 is gonna fade away in that area too (didn't saw 1 Blu-Ray useing VC-1). The same as when WMV-HD faded away (and ohh is it supriseing that Paramount was supporting that too) ;).
benwaggoner
15th January 2008, 07:34
Nice now it gets interesting in compareing it with the recent X264 builds in terms of Speed/Quality and Grain Behaveiour :)
Looking forward to hearing your results.
Btw wasn't there something about a Source you were going to provide for testing purposes ;)
Ugh, yeah. I finished something enough to use it for some DLNA conformance streams, but I'm still to embarrassed by it to release it publicly, yet am too busy to actually finish it :). Hopefully now that the holidays are over...
And as crypto said good decission in terms of momentum now to catch the Web with Silverlight and VC-1, as on Media it seems the fight is lost and if Blu-Ray now wins VC-1 is gonna fade away in that area too (didn't saw 1 Blu-Ray useing VC-1). The same as when WMV-HD faded away (and ohh is it supriseing that Paramount was supporting that too) ;).
Tons of Blu-ray discs use VC-1. If anything, having HD DVD go away (which isn't going to happen, but that's another discussion) would reduce the political pressures on some of the companies that are Blu-ray only to not use a Microsoft technology. Codecs are pretty orthogonal to the format war.
WMV-HD didn't fade away. We just decided to throw our weight behind HD DVD instead of pushing a third standard which also brought big optical improvements.
Stebet
15th January 2008, 09:51
And as crypto said good decission in terms of momentum now to catch the Web with Silverlight and VC-1, as on Media it seems the fight is lost and if Blu-Ray now wins VC-1 is gonna fade away in that area too (didn't saw 1 Blu-Ray useing VC-1). The same as when WMV-HD faded away (and ohh is it supriseing that Paramount was supporting that too)
Blu-ray codec statistics (courtesy of http://www.blu-raystats.com/index.php):
Codecs
MPEG2 157 35.44%
AVC 163 36.79%
VC-1 123 27.77%
I find it rather scary that MPEG2 is used that much :eek:
clockworkman
22nd January 2008, 06:34
I managed to encode some HDV footage with AVI2ASF and the SDK encoder with the following:
AVS (HDVMOVIE.AVS):
DirectShowSource("C:\test\HDVMOVIE.m2t",fps=29.97,audio=false)
LanczosResize(1440,1080)
converttoyv12()
Graphedit:
HDVMOVIE -----> Sonic HD Demuxer------>Elecard MPEG2 Video Decoder
I use the following to encode:
AVS2ASF.exe -i c:\vc1\HDVMOVIE.avs -o Sampleencode.vc1 -framerate 29.97 -ratecontrol 3 -rate 6000 -peakrate 20000 -vbv 1843200 -complexity 5 -profiletype 2 -bframes 1 -maxkeydist 14 -inloop 1 -motionsearchlevel 3 -mesearchmethod 2 -mbcost 1 -mvcost 1 -mvrange 4 -adaptiveGOP -videotype 0
The resulting vc1 is strange. It is like a slideshow.....the picture looks fine but there is one still frame every 5 seconds or so. Any ideas?
Sagittaire
22nd January 2008, 09:41
Well this sdk encoder is not able to produce HDDVD NTSC compliant stream (if you want progressive stream with pulldown flag).
If your source is native 29.97 fps interlaced source, you must use interlaced profil with max GOP at 18.
buzzqw
31st January 2008, 08:55
any news about error on 5.1 audio ?
BHH
cboese
31st January 2008, 15:50
Hello!
First of all a great, not mandatory and absolutely apropriate
Thanks! to Nic, Koepi (whose builts are already kind of legendary), the admins and all posters (who read the FAQ ;-) for helping me for such a long time out of situations for which my brain was simply too small for to get :thanks:
Now for my question.
I use the following avs-script (here called try.avs):
black = Blackness(pixel_type="YV12", length=100)
black
and the command line for the avs2asf looks as the follwing (right now, I played around with all the options a little but no luck (and as I dont fully understand what I am doing, I obviously had to rely on luck ;-) ))
AVS2ASF -i try.avs -o try.asf -rate 9000 -framerate 25 -complexity 0 -profiletype 2 -bframes 2 -maxkeydist 6 -vbv 300000 -peakrate 2000
When I hit Enter, it gives me:
Failure in CVC1EncASF::Init
hr = 0
VC1 SDK Error = -30
Final error code: -30
benwaggoner
10th February 2008, 08:38
[QUOTE=cboese;1094768]Hello!
First of all a great, not mandatory and absolutely apropriate
Thanks! to Nic, Koepi (whose builts are already kind of legendary), the admins and all posters (who read the FAQ ;-) for helping me for such a long time out of situations for which my brain was simply too small for to get :thanks:
Now for my question.
I use the following avs-script (here called try.avs):
black = Blackness(pixel_type="YV12", length=100)
black
What does the Blackness filter do?
Inventive Software
10th February 2008, 09:28
The BlankClip filter produces a solid color, silent video clip of the specified length (in frames).
There's yer answer guv. ;)
benwaggoner
10th February 2008, 16:47
There's yer answer guv. ;)
Y'=16? R'G'B'=0?
Inventive Software
10th February 2008, 19:04
BlankClip (clip "clip", int "length", int "width", int "height", string "pixel_type", float "fps", int "fps_denominator",
int "audio_rate", bool "stereo", bool "sixteen_bit", int "color", int "color_yuv")
Blackness ()
The BlankClip filter produces a solid color, silent video clip of the specified length (in frames). The clip passed as an argument is used as a template for frame rate, image size, and so on, but you can specify all clip properties without having to provide a template. color should be given as hexadecimal RGB values. Without any argument, BlankClip will produce a pitch-black 10 seconds clip (RGB32), 640x480, 24 fps, 16 bit 44100 Hz mono.
clip: if present, the resulting clip will have the clip-properties of the template, except for the properties you define explicitly.
length: length of the resulting clip (in frames).
width, height: width and height of the resulting clip.
pixel_type: pixel type of the resulting clip, it can be "RGB24", "RGB32", "YUY2" or "YV12".
fps: the framerate of the resulting clip.
fps_denominator: you can use this option if "fps" is not accurate enough. For example: fps = 30000, fps_denominator = 1001 (ratio = 29.97) or fps = 24000, fps_denominator = 1001 (ratio = 23.976). It is 1 by default.
audio_rate: samplerate of the silent audio of the clip.
stereo: (boolean) when set to true the silent audio is in stereo, when set to false a silent mono track is added
sixteen_bit: (boolean) true and false give both 16 bit, except when a template is used where a different bit is set.
color: specifies the color of the clip, black (= $000000) by default. See ColorPresets for preset colors. See here for more information on specifying colors.
color_yuv: is added in v2.55, and it lets you specify the color of the clip using YUV values. It requires setting pixel_type to "YUY2" or "YV12", otherwise it doesn't do anything.
Blackness is an alias for BlankClip, provided for backward compatibility.
That's the AviSynth entry for BlankClip, so I can't answer more than that, other than possibly suggesting using color_yuv.
cboese
11th February 2008, 09:45
Thanks for the answers.
I wanted to try the int "color_yuv" parameter but I couldnt find Information about what integer value to use (tried 0 and 16, but nothing chaged). What would be the right place to ask for this?
Is there any way to tell if this has to do with avs2avi or if its a more general problem?
I couldn't find documentation about error "-30".
I also switched to BlankClip because Blackness was only for backward compatibility
I also tried ColorBars and others, but always the same error, so I dont think it has something to do with the Filter itself.
Maybe something with the avs2avi command line is wrong?
Inventive Software
11th February 2008, 10:11
Ask in the AviSynth Usage forum. ;)
anrque
11th February 2008, 18:33
I am seeing the same type of errors everytime I try to do an encode using the SDK and Nic's additions. Even running the demo clip and .avs through the SDK with AVS2ASF is resulting in a -20 error on my end. However, I am trying to produce content and am not a SW developer so I do not have Visual Studio or any other programming environment installed, so maybe I am missing some dynamic libraries or something??
Here are the various error codes listed in the SDK documentation.
Error code Value Description
ERR_OK 0L The method succeeded.
ERR_ENCODER -10L Unspecified VC-1 encoder error.
ERR_INVALIDARG -20L An argument is out of range.
ERR_INVALIDSETTING -30L A setting is not valid for the current encoder state. This usually means the setting conflicts with an existing one.
ERR_MEMORY -40L There is not enough memory to perform the operation.
ERR_POINTER -50L The argument is NULL.
ERR_ENCODE_STARTED -60L The VC-1 encoder is running.
ERR_IO -70L Unspecified input or output error.
ERR_NOANALYZE_FRAME -80L You must specify at least one frame for analysis between calls to StartAnalyze and EndAnalyze. Call CVC1Encoder::AnalyzeFrame.
ERR_NOTCONFIGURED -90L The VC-1 encoder is not configured. Call CVC1Encoder::Configure first.
ERR_NOENCODE_FRAME -100L You must specify at least one frame for encoding between calls to StartEncode and EndEncode. Call CVC1Encoder::EncodeFrame.
ERR_NOMORE_FRAMES -110L The encoding queue is empty.
ERR_NO_OP_FRAME -120L The output buffer does not contain valid frame data.
ERR_NOSTART_ANALYZE -130L You first must call CVC1Encoder::StartAnalyze.
ERR_NOSTART_ENCODE -140L You first must call CVC1Encoder::StartEncode.
buzzqw
3rd March 2008, 09:02
any news on this application ?
it's seem more stable then wmcmd.vbs (and with a better handling of avisynth input) BUT lack of 5.1 audio support.
if better/easier (without prx profiles) audio support isn't wanted from Microsoft, and no developing are on the way, what command line application is suggested by Microsoft for encoding entusiast ?
.. basically.. how to encode by command line with a freeware, comprensive, well documented, with wmv7/8/9/vc-1 AND wma std/pro 5.1 support ?
BHH
benwaggoner
8th March 2008, 06:37
The beta of Expression Encoder 2 is out now, incorporating the VC-1 Encoder SDK.
http://www.microsoft.com/expression/products/download.aspx?key=encoder2beta
It has a command-line interface, and supports .avs. However, it doesn't support 5.1 audio as it targets Silverlight, which is mono/stereo in 1.0 and 2.
buzzqw
8th March 2008, 13:46
and it's valid to july... and "weight" 300mb..
not very consumer friendly
BHH
Kurtnoise
8th March 2008, 14:10
http://www.microsoft.com/downloads/details.aspx?familyid=5031c859-e8da-41bc-98e3-c13add5378b0&displaylang=en&tm
Version: 1.1
Date Published: 3/6/2008
buzzqw
8th March 2008, 14:13
hoping for a new avs2vc1!
BHH
Kurtnoise
8th March 2008, 17:28
I believe it's the same package as the previous one in fact...
http://kurtnoise.free.fr/index.php?dir=misc/&file=AVS2ASF-0.3_20080308.zip
buzzqw
12th March 2008, 09:36
thanks Kurtnoise13!
but can you remove the prompt at end encoding (avi2avs.cpp, line 73)
thanks!
BHH
Kurtnoise
12th March 2008, 09:54
sure...I'll upload a new build tonight.
http://kurtnoise.free.fr/index.php?dir=misc/&file=AVS2ASF-0.3_20080312.zip
buzzqw
13th March 2008, 12:48
thanks!
BHH
buzzqw
18th March 2008, 09:19
another bug
if encode to vc1 the framerate is respected, if i encode to wmv (wmv video+wma audio) the framerate is fixed to 15
BHH
Nic
22nd March 2008, 17:13
@buzzqw:
You're persistent :) been a while since I looked at this thread.
Just tried encoding some 5.1 audio, worked fine for me. You do, of course, need an appropriate 5.1 audio profile/prx file. Did you create one? (use GenProfile.exe from the WMV SDK or similar)
The encoder sdk 1.1 file that kurtnoise pointed out is exactly the same version of the SDK from December. So no need for a new build with it.
"if i encode to wmv (wmv video+wma audio) the framerate is fixed to 15" <--- Not sure what you mean by that, always seems to work fine here...Please post your commandline.
Still can't figure out how to do telecine. I can of course set the TFF/RFF flags, but what do I set the framerate to be in ConfigProps? What do I set the timestamps to of the video samples when I call EncodeFrame? Maybe the MS guys can point me in the right direction...
-Nic
buzzqw
22nd March 2008, 19:12
if you create a wmv (audio+video) even if your use -framerate 25, the resulting wmv , analyzed with avinaptic or mediainfo will report 15fps
if you do a raw vc1 file, specifing -framerate 25, the framerate reported by avinaptic or mediainfo is 25
about profile.. i use WMProEdt.exe .. but will try with genprofile
also.. seems i am unable to build a pure vbr profile.. but il will study genprofile profiles
thanks Nic
BHH
Nic
22nd March 2008, 21:13
@buzzqw: But the file doesn't play back at 15fps, it's just those apps reporting that framerate. Strange that they do, must be reading it from somewhere. Will try to see how to set that.
-Nic
EDIT:
Easy Fix. Framerate wasn't being set in the mediatype.
buzzqw
23rd March 2008, 09:02
thanks Nic!
i will try to do 5.1ch wmv, and will report any errors :D
(thanks again!)
BHH
M10
23rd March 2008, 17:11
I appreciate everyone's work with this application!
I have a fairly specific question. Has anyone been able to use the "-aspectratio" line successfully with AVS2ASF?
Per the documentation, they want: [-aspectratio] <aspectratioindex> <aspectratiowidth> <aspectratioheight>. If aspectratioindex=15, then you can specify aspectratiowidth & aspectratioheight. Specifying an "aspectratioindex" alone doesn't seem to be recognized when wmv's played by wmv or xbox. However, when I enter:
"-aspectratio 15 40 33" I get an error stating that "40" is an unrecognized command...as if it is not parsing the input correctly. Any thoughts?
Nic
23rd March 2008, 23:06
Well spotted M10. You should get a job doing QA in MS ;)
m_dwPixIndex = 0;
.....
else if (!wcscmp (L"-aspectratio", m_ppArgv[i]))
{
// Pixel aspect ratio.
i++;
// Convert the argument to a number.
DWORD dwPixIndex = wcstoul(m_ppArgv[i], NULL, 10);
// 15 means "Aspect width and height transmitted"
// Update the w and h based on command line args.
if (m_dwPixIndex == 15)
{
i += 2;
}
}
Spot the bug? :) I'll release a fix sometime.
-Nic
anrque
24th March 2008, 19:32
I have tried this numerous times and feel like I'm missing something. I have the VC1 SDK installed, I installed the WM11 SDK and finally i Installed the platform SDK that has all of the DShow extras. I installed VS 2008 as well and "think" I have all the run-time components I need. I have AVISynth 2.5.7 installed but I continue to get this error after running the example.bat:
Also, I am trying to run this in XP Pro 32 SP2.
C:\AVS2ASF>AVS2ASF -i Test.avs -o ElementryStream.vc1 -framerate 25 -rate 1200 -profiletype 2 -bframes 2 -maxkeydist 6 -vbv 300000 -peakrate 2000
*************************************
VC-1 AVS2ASF v0.3 Encoding Sample
Original Sample AVI2ASF code Copyright (C) Microsoft Corporation.
All rights reserved.
Avisynth, YV12 & Raw support added by Nic.
*************************************
Encoding in ES (Elementry Stream) mode
Failure in CVC1EncASF::set_advancedProps
error = -20
Failure in CVC1EncASF::Init
hr = 0
VC1 SDK Error = -20
Final error code: -20
Total elapsed time in seconds = 0.000000
Can anyone tell me what I am doing wrong?
Mike
Kurtnoise
4th April 2008, 20:39
@benwaggoner: Is there somewhere a tool to check the BD/HD-DVD compliancy for VC-1 Elementary Streams ?
benwaggoner
4th April 2008, 23:59
@benwaggoner: Is there somewhere a tool to check the BD/HD-DVD compliancy for VC-1 Elementary Streams ?
Nothing freely available that I know of.
ACrowley
12th April 2008, 08:08
I have tried this numerous times and feel like I'm missing something. I have the VC1 SDK installed, I installed the WM11 SDK and finally i Installed the platform SDK that has all of the DShow extras. I installed VS 2008 as well and "think" I have all the run-time components I need. I have AVISynth 2.5.7 installed but I continue to get this error after running the example.bat:
Also, I am trying to run this in XP Pro 32 SP2.
C:\AVS2ASF>AVS2ASF -i Test.avs -o ElementryStream.vc1 -framerate 25 -rate 1200 -profiletype 2 -bframes 2 -maxkeydist 6 -vbv 300000 -peakrate 2000
*************************************
VC-1 AVS2ASF v0.3 Encoding Sample
Original Sample AVI2ASF code Copyright (C) Microsoft Corporation.
All rights reserved.
Avisynth, YV12 & Raw support added by Nic.
*************************************
Encoding in ES (Elementry Stream) mode
Failure in CVC1EncASF::set_advancedProps
error = -20
Failure in CVC1EncASF::Init
hr = 0
VC1 SDK Error = -20
Final error code: -20
Total elapsed time in seconds = 0.000000
Can anyone tell me what I am doing wrong?
Mike
Same Error here.
So far i can remeber it was caused by -profiletype 2
M10
13th April 2008, 00:32
Well spotted M10. You should get a job doing QA in MS ;)
m_dwPixIndex = 0;
.....
else if (!wcscmp (L"-aspectratio", m_ppArgv[i]))
{
// Pixel aspect ratio.
i++;
// Convert the argument to a number.
DWORD dwPixIndex = wcstoul(m_ppArgv[i], NULL, 10);
// 15 means "Aspect width and height transmitted"
// Update the w and h based on command line args.
if (m_dwPixIndex == 15)
{
i += 2;
}
}
Spot the bug? :) I'll release a fix sometime.
-Nic
Thanks, Nic. I look forward to the fix! I need to get the aspect ratio settings working before I can move my encodes to the new codec.
HookedOnTV
10th June 2008, 17:34
I get:
Bad AVS/AVI format - Has to be YV12!
my avs file has a line:
ConvertToYV12()
benwaggoner
10th June 2008, 18:06
I get:
Bad AVS/AVI format - Has to be YV12!
my avs file has a line:
ConvertToYV12()
I think it actually has to be IYUV.
HookedOnTV
2nd July 2008, 23:22
I'm not getting anywhere. Trying to encode the included sample script (as suggested by executable) and get nothing but errors. I have WMP11, WMEncoder 9, VC1ProSDK, WMFSDK11, AVISynth 2.57. I get:
Bad AVS/AVI format - Has to be YV12!
Failure in CAVIFileReader::Init
hr = 80044066
Failure in CVC1EncASF::InitFileReader
hr = 80044066
Encoding in ASF mode
Failure in CVC1EncASF::Init
hr = 80044066
VC1 SDK Error = -90
Final error code: -90
Total elapsed time in seconds = 0.000000
HookedOnTV
3rd July 2008, 17:02
Problem fixed. I couldn't successfully compile the sample from the SDK and once I got the service pack for Visual Studio installed it fixed both.
HookedOnTV
14th July 2008, 19:27
Is there some resource that lists which settings are required based upon choices made? In trying to do CBR encodes, using -ratecontrol 0 or 2, I always just get error code -20. I'm assuming I'm not setting a required parameter but I don't know which.
HookedOnTV
15th July 2008, 14:24
It's kinda like I'm having a conversation with myself... found the problem. Nic, you've made -peakrate required when actually it only applies to -ratecontrol 3. VC1EncASF.cpp line 1524, removing bPeak allows for CBR encoding.
HookedOnTV
4th November 2008, 03:56
Any idea why this is happening:
Encoding in ASF mode
------------Start Analysis-----------
------------End Analysis------------
Average bit rate: 2741.00, total bytes processed: 6610556.00.
Total frames: 463.00, Coded frames: 463.00.
------------Start Encode-----------
------------End Encode--------------
------------Done-----------
Average bit rate: 1609.00, total bytes processed: 3880639.00.
Total frames: 463.00, Coded frames: 203.00.
Total elapsed time in seconds = 193.625000
It's a small mpeg2 file. Encodes fine in other encoders.
ss3
5th November 2008, 20:26
Hello all,
New bie here, happy to join this community after months of passive participation.
I am unable to encode in simpe profile when I am trying to to use SDK RAW2ES @LL (Basically for my research)
RAW2ES.exe -i foreman.yuv -o foreman.vc1 -maxw 176 -maxh 144 -rate 96 -framerate 5 -peakrate 200 -profiletype 0 -bframes 0 -maxkeydist 10 -vbv 327680
*************************************
VC-1 RAW2ES Encoding
*************************************
Failure in CVC1EncES::Init
error = -30
Final error code: -30
Total elapsed time: 0.000000 seconds
Press <Enter> to continue...
Code 30 means
A setting is not valid for the current encoder state. This usually means the setting conflicts with an existing one.
But I am unable to figure out what might be conflict in settings. I donot face such problems with Advanced Profile. Any pointers why?
Few more rookie questions ( or call dumb ones) regarding AP
I need to encode in interlace mode, so does this mean my source has to be an interlace content or by setting -videotype 3 does encodes progressive source to interlaced vc1 stream.
Because this part in documentation confuses me
By default, the VC-1 encoder uses progressive frame encoding for progressive source video and interlaced field encoding for interlaced source video, as specified by the bInterlacedSource member of the CONFIG_PROPERTIES structure passed as an argument to CVC1Encoder::Configure.
Also if i need multiple slices in stream, I am not clear if setting -SH flag is sufficient?
Any help is greatly appreciated
benwaggoner
19th November 2008, 18:06
I believe that -peakrate is defined in bps, not Kbps (at least it is in the library itself). If, so, setting it to 20000 would be a lot better :). Give that a shot. Otherwise what you've got looks good to me. What are you making Simple Profile for?
As for interlaced, yes, you'll want to set the mode to pass interlaced through. It's not going to do any detection, so it'll treat your source as whatever you tell it, so getting that right is pretty important.
ss3
21st November 2008, 03:31
Just curious
Is encoding in SP/MP (profile 0/1) not currently supported ? I mean I used WM 8 utilities and I never get any problem encoding in SP/MP but I always get error codes 20 and 30 while using AVS2ASF.
any body with success encoding in simple profile with elementary stream.
for example
this command work (i.e AP)
AVS2ASF.exe -i football.avs -o ElementryStream.vc1 -framerate 23.976 -ratecontrol 3 -rate 60000 -peakrate 20000 -vbv 1843200 -complexity 5 -profiletype 2 -bframes 1 -maxkeydist 14 -inloop 1 -motionsearchlevel 3 -mesearchmethod 2 -mbcost 1 -mvcost 1 -mvrange 4 -adaptiveGOP -videotype 0
Once I give this command (SP)
AVS2ASF.exe -i football.avs -o ElementryStream.vc1 -framerate 23.976 -ratecontrol 3 -rate 60000 -peakrate 20000 -vbv 184320 -profiletype 0 -bframes 0 -maxkeydist 14 -adaptiveGOP -videotype 0
it doesnot work :(
Any Clues??
The second issue is i am looking to support is multiple slices (in AP) in the encoder. I am a new bie, wondering if some one can give me pointers on how to get support for multiple slices. [ I am able to encode multiple slices with wm9eutil.exe , but I have only binary of this utility, no source hence clueless how to proceed if I need support multiple slices in AVS2ASF)
@Ben
I am doing a comparative study of 264/VC1 for my research report. Hence looking for SP/MP too.
Thanks in advance for any help
Sagittaire
22nd November 2008, 21:50
bitrate must be inferior to max rate:
@REM -----------------------------------------------------------
@REM
@REM Profil BluRay 1080p23.976 2 passes extra high quality
@REM
@REM -----------------------------------------------------------
@REM Source file name (suffit de mettre la source ici)
set E_SRC=Lossless.avs
@REM Set of bitrates (ici le bitrate)
set E_BR=12000
@REM Set of max bitrates (ici le bitrate max)
set MAX_BR=40000
@REM Set of Buffer (ici le buffer)
set BUF_BR=3750000
@REM Profil (ici le nom des fichiers de sortie)
AVS2ASF.exe -i %E_SRC% -o azerty.vc1 -rate %E_BR% -peakrate %MAX_BR% -vbv %BUF_BR% -framerate 23.976 -ratecontrol 3 -profiletype 2 -maxkeydist 24 -bframes 2 -adaptiveGOP -inloop 1 -complexity 5 -motionsearchlevel 2 -mesearchmethod 1 -mbcost 1 -mvcost 1 -mvrange 4
pause
ss3
23rd December 2008, 00:54
Can some one post the working command for simple profile? I am frustrated making the encoder work. It doesnot accept SP settings at all
AVS2ASF.exe -i football.avs -o ElementryStream.vc1 -framerate 23.976 -ratecontrol 3 -rate 60000 -peakrate 120000 -vbv 184320 -profiletype 0 -bframes 0 -maxkeydist 14 -adaptiveGOP -videotype 0
Kurtnoise
5th January 2009, 20:41
@Benwaggoner: could you tell us why SP & MP encodings fail with this tool please ?
benwaggoner
6th January 2009, 05:20
Is there some resource that lists which settings are required based upon choices made? In trying to do CBR encodes, using -ratecontrol 0 or 2, I always just get error code -20. I'm assuming I'm not setting a required parameter but I don't know which.
Hmmm. I don't see anything obviously wrong, but I'm pretty rusty using AVS2ASF; I've been mainly doing Expression Encoder lately. EEv2 uses the same lib and does SP just fine, so you're probably right that it's a paramter thing.
One thing that stands out is that a maxkeydist of 14 is very aytpically low for SP. I don't know that I've ever seen a SP encode with keyframes less than every couple of seconds. Generally for the low power devices where SP makes sense, optimizing for quality@perf is best done with long GOPs and a smaller VBV.
What's the content like, and what are you shooting for with your encode?
benwaggoner
6th January 2009, 19:28
sure...I'll upload a new build tonight.
http://kurtnoise.free.fr/index.php?dir=misc/&file=AVS2ASF-0.3_20080312.zip
Say, is this still the current version?
I'd love to cover this in a blog post. Is there a web site somewhere I can link to for the download, or is this thread it?
I'd like to encourage others to start using it and hopefully enhancing it.
rica
6th January 2009, 19:51
Hi guys, is any gui available?
ss3
6th January 2009, 19:56
Hi Ben,
I donot think they is an issue with key dist , I did try both longer GOPs and shorter VBVs. I guess it is more of an issue with some default settings AP profile which donot work with SP/MP. I tried all possibilities and went through most of documentation but fell short . EE does SP/MP with out much problems but I was looking for generating ES to be used with ref decoder.
I am still looking for solution?.
Kurtnoise
7th January 2009, 07:37
Say, is this still the current version?
yes...although I've a custom build (for my needs) not published.
I'd love to cover this in a blog post. Is there a web site somewhere I can link to for the download, or is this thread it?
no website dedicated to this tool...
benwaggoner
8th January 2009, 01:29
Hi Ben,
I donot think they is an issue with key dist , I did try both longer GOPs and shorter VBVs. I guess it is more of an issue with some default settings AP profile which donot work with SP/MP. I tried all possibilities and went through most of documentation but fell short . EE does SP/MP with out much problems but I was looking for generating ES to be used with ref decoder.
I am still looking for solution?.
Ah! Only AP supports being in ES :). SP and MP were designed with some dependencies on the ASF file format. We fixed that as part of the VC-1 and Advanced Profile effort.
benwaggoner
8th January 2009, 01:30
yes...although I've a custom build (for my needs) not published.
no website dedicated to this tool...
No prob. I've blogged here:
http://on10.net/blogs/benwagg/AVS2ASF-ndash-Open-Source-VC-1-Encoder-SDK-application/
The URL it is actually a search string, so it should continue to point to your current version going forward.
ss3
9th January 2009, 23:15
Ah! Only AP supports being in ES :). SP and MP were designed with some dependencies on the ASF file format. We fixed that as part of the VC-1 and Advanced Profile effort.
I didnot get the fix part. I understand that SP/MP used RCV container to remove ASF dependency.Is it not possible to encode SP/MP to RCV container using SDK?
benwaggoner
10th January 2009, 19:14
I didnot get the fix part. I understand that SP/MP used RCV container to remove ASF dependency.Is it not possible to encode SP/MP to RCV container using SDK?
No, I don't believe so. This is the first time I've ever even seen the letters "RCV" typed by someone not on the Microsoft codec team :).
ss3
12th January 2009, 20:22
No, I don't believe so. This is the first time I've ever even seen the letters "RCV" typed by someone not on the Microsoft codec team :).
RCV is surely not a full fledged container format but surely a encapuslation scheme and Alex zambelli reply on this thread just explains it. http://forum.doom9.org/showthread.php?t=131117 (I guess Alex is part of MS team [:)] and I am just a research student )
But I am desperately looking for a VC1 encoder which can generate SP/MP in ES and multiple slices directly in VC1 ES stream. EE and SDK seems to be not much of help here. Any pointers please?
benwaggoner
15th January 2009, 07:34
RCV is surely not a full fledged container format but surely a encapuslation scheme and Alex zambelli reply on this thread just explains it. http://forum.doom9.org/showthread.php?t=131117 (I guess Alex is part of MS team [:)] and I am just a research student )
But I am desperately looking for a VC1 encoder which can generate SP/MP in ES and multiple slices directly in VC1 ES stream. EE and SDK seems to be not much of help here. Any pointers please?
Alex and I both used to be on the codec team. He's now on the Silverlight evangelism team:
http://www.alexzambelli.com/blog
Anyway, SP and MP simply aren't part about the VC-1 elementary stream spec. Can you explain what you're trying to do? Perhaps you could just make AP with SP/MP feature subsets?
Celeritas
23rd January 2009, 07:03
I have been able to get the video to convert, but in the past I have been using 6 mono wav files in WME (via WMCmd.vbs) to add a 5.1 channel soundtrack. I have been experimenting with the -pr option, but I can't seem to make a .prx file that AVS2ASF likes. I only know enough about avs files to add a single wav, so the avs will play, but AVS2ASF balks at the .prx file, even though I am creating it with WME. If I leave the audiodub section out of the avs file, it works but picks up no audio.
My avs file looks like:
a=DirectShowSource("C:\Users\Public\Videos\HD Transcodes\vob\video-indexed.avi", audio=false)
b=WavSource("C:\Users\Public\Videos\HD Transcodes\vob\audio.C.wav")
audiodub(a,b)
Trim(0,100) #to make it short for testing
ConvertToYV12()
The current contents of the .prx file:
<?xml version="1.0"?>
<WMEncoder major_version="9"
minor_version="0"
Name="WMEncoder10810"
AutoIndex="0"
SynchroniesOperation="0" >
<Description />
<Attributes >
<WMENC_LONG Name="SurroundMix" Value="-3" />
<WMENC_LONG Name="CenterMix" Value="-3" />
<WMENC_LONG Name="LFEMix" Value="-12" />
</Attributes>
<SourceGroups >
<SourceGroup Name="Source 1" >
<Source Type="WMENC_AUDIO" Scheme="multichannel" >
<UserData >
<WMENC_STRING Name="FrontLeft" Value="C:\Users\Public\Videos\HD Transcodes\vob\audio.L.wav" />
<WMENC_STRING Name="FrontRight" Value="C:\Users\Public\Videos\HD Transcodes\vob\audio.R.wav" />
<WMENC_STRING Name="FrontCenter" Value="C:\Users\Public\Videos\HD Transcodes\vob\audio.C.wav" />
<WMENC_STRING Name="LowFrequency" Value="C:\Users\Public\Videos\HD Transcodes\vob\audio.LFE.wav" />
<WMENC_STRING Name="BackLeft" Value="C:\Users\Public\Videos\HD Transcodes\vob\audio.SL.wav" />
<WMENC_STRING Name="BackRight" Value="C:\Users\Public\Videos\HD Transcodes\vob\audio.SR.wav" />
</UserData>
</Source>
<EncoderProfile id="Multiple bit rates audio (CBR)" />
<UserData >
</UserData>
</SourceGroup>
</SourceGroups>
<File LocalFileName="C:\Users\Public\Videos\HD Transcodes\vob\audio.wma" />
<WMEncoder_Profile id="Multiple bit rates audio (CBR)" >
<![CDATA[ <profile version="589824"
storageformat="1"
name="Multiple bit rates audio (CBR)"
description="">
<streamconfig majortype="{73647561-0000-0010-8000-00AA00389B71}"
streamnumber="1"
streamname="Audio Stream"
inputname="Audio409"
bitrate="640008"
bufferwindow="-1"
reliabletransport="0"
decodercomplexity=""
rfc1766langid="en-us"
>
<wmmediatype subtype="{00000162-0000-0010-8000-00AA00389B71}"
bfixedsizesamples="1"
btemporalcompression="0"
lsamplesize="27307">
<waveformatex wFormatTag="354"
nChannels="6"
nSamplesPerSec="48000"
nAvgBytesPerSec="80001"
nBlockAlign="27307"
wBitsPerSample="24"
codecdata="18003F0000000000000000000000E0000000"/>
</wmmediatype>
</streamconfig>
</profile>
]]>
</WMEncoder_Profile>
<UserData >
<WMENC_LONG Name="Encoding\Bitrate0\Video0\CustomW" Value="320" />
<WMENC_LONG Name="Encoding\Bitrate0\Video0\CustomH" Value="240" />
<WMENC_STRING Name="Encoding\Audio0" />
<WMENC_STRING Name="Encoding\Video0" />
<WMENC_STRING Name="Encoding\Script0" />
</UserData>
</WMEncoder>
The error message I get is:
------------Start Encode-----------
Failure in CASFFileWriter::LoadCustomProfile
hr = 80070002
Failure in CASFFileWriter::Init
hr = 80070002
Failure in VC1Enc::InitFileWriter
hr = 80070002
VC1 SDK Error = 0
Failure in CASFFileWriter::Destroy
hr = c00d002b
Failure in CVC1EncASF::DestroyFileReader
hr = c00d002b
Failure in Encode
hr = 80070002
VC1 SDK Error = 0
Total elapsed time in seconds = 18.557000
The command I am using is:
C:\Users\John\Downloads\Software\Multimedia\AVS2ASF-0.3_20080312\Release>avs2asf
-i "C:\Users\Public\Videos\HD Transcodes\vob\video.avs" -o "C:\Users\Public\Videos\HD Transcodes\Serenity-VC1.asf"
-rate 8000 -framerate 23.976 -peakrate 12000 -maxkeydist 4 -profiletype 2
-bframes 2 -vbv 300000 -pr "C:\Users\Public\Videos\HD Transcodes\vob\audioencode.prx"
NorthPole
23rd January 2009, 17:09
@Celeritas
add this to your avs file will give you 5.1 audio:
audio1 = WavSource("fl.wav")
audio2 = WavSource("fr.wav")
audio3 = WavSource("c.wav")
audio4 = WavSource("lfe.wav")
audio5 = WavSource("sl.wav")
audio6 = WavSource("sr.wav")
fl = GetChannel(audio1, 1)
fr = GetChannel(audio2, 1)
c = GetChannel(audio3, 1)
lfe = GetChannel(audio4, 1)
sl = GetChannel(audio5, 1)
sr = GetChannel(audio6, 1)
b = MergeChannels(fl, fr,c, lfe, sl, sr)
Not sure how that will work with avs2asf because I don't us the audio options.
ss3
23rd January 2009, 19:28
Alex and I both used to be on the codec team. He's now on the Silverlight evangelism team:
http://www.alexzambelli.com/blog
Anyway, SP and MP simply aren't part about the VC-1 elementary stream spec. Can you explain what you're trying to do? Perhaps you could just make AP with SP/MP feature subsets?
Ben,
this is what I cam looking for
A VC1 encoder which can encode in ES (i.e VC1) the AP Profile with multiple slices
and SP/MP based elementary stream encoder i.e with RCV encapsulation.
the reason I am looking for multiple slices is I need to compare the performance of error concealment of VC1 and 264 multiple slices
And SP/MP because I need to use ref decoder which doesnot accept wmv format
Any pointers/help please?
NorthPole
24th January 2009, 22:45
Here is a modified version of Nic's program:
I fixed the aspectratio error described on page 5 of this thread. Also, I fixed the rate control CBR modes 0 & 2 and the 1 pass VBR mode 1. Previously you could only use modes 3 and 4.
Works fine for me in all modes.
http://www.mediafire.com/?3m5x8mmn0rt
b66pak
24th January 2009, 23:47
thanks a lot...but no documentation?...could you post some examples with the new modes?
_
NorthPole
25th January 2009, 00:40
The encoder defaults to mode 1... which is 1-pass VBR with a quantizier setting of 8. You only need to supply the input and output files and these switches
-framerate <xxxx> -profiletype <x> -bframes <x> -maxkeydist <x>
Examples are at the end of the command line help.
This is from the command line help
*************************************
VC-1 AVS2ASF v0.4 Encoding Sample
Original Sample AVI2ASF code Copyright (C) Microsoft Corporation.
All rights reserved.
Avisynth, YV12 & Raw support added by Nic.
Aspect Ratio, Help and Rate Control Mode changes by Northpole.
*************************************
The required parameters are based on the default rate control mode 1,
1-pass VBR with a Fixed QP of 8.
If you change the rate control mode, simply specify appropriate values
for the required parameters.
Syntax:
AVS2ASF.exe -i <inputfile> -o <outputfile>
-framerate <frame rate> -profiletype <profile type>
-bframes <number of b frames> -maxkeydist <maximum key frame distance>
[Optional 1] <value1> [Optional 2] <value2> ...
Command line options:
-i <input AVI file name>
-o <output ASF file name>
[-rate] <output rate (kilobits per second)>
The range is 1 to 135000.
Not used when Rate Control Mode equals 1.
[-complexity] <encoder complexity>
0 to 5, 0 = best performance, 5 = best quality.
[-qp] <quantization parameter (QP)>
Fixed QP if -ratecontrol equals 1 (1-pass VBR)
Max QP if -ratecontrol equals 0 or 2 (CBR)
The range is 1 to 31.
Not applicable when Rate Control Mode equals 3 or 4.
[-framerate] <source frame rate>
[-interlaced] Specifies interlaced source.
[-maxkeydist] <maximum distance between key frames>
[-bframes] <number of B-frames per P-frame>
Range is 0 to 7.
[-peakrate] <peak bit rate (kilobits per second)>
The range is 1 to 135000.
Not used when Rate Control Mode equals 0, 1, 2, or 4.
[-profiletype] <type specifier>
0 = Simple, 1= Main, 2 = Advanced.
[-ratecontrol]
0 = 1-pass CBR
1 = 1-pass VBR fixed QP
2 = 2-pass CBR
3 = 2-pass peak constrained VBR
4 = 2-pass unconstrained VBR.
[-vbv] <size of vbv buffer>
The range is 1 to 157696 for Simple profile, 1 to 5001216 for Main profile
and 1 to 33792000 for Advanced profile.
VBVBuffer = Bit rate in kbps x buffer duration in seconds x 125.
Recommended buffer duration = 8 seconds.
Not used when Rate Control Mode equals 1 or 4.
[-colorformatflags] <colorformatflag> <colorprimaries> <transferchar>
<matrixcoef>
- If colorformatflag is 1, then you must specify colorprimaries,
transferchar, and matrixcoef.
- If colorformatflag is 0, then no need to specify colorprimaries,
transferchar, and matrixcoef because the decoder will generate them
for you.
[-denoise] <0 or 1>
Turn on or off denoise filter.
[-inloop] <0 or 1>
Turn on or off in-loop filter.
[-median] <0 or 1>
Turn on or off median filter.
[-overlap] <0 or 1>
Turn on or off overlap smoothing.
[-noiseedge] <0 or 1>
Turn on or off noise edge removal.
[-deltamvrange] <delta mv range index>
0 = off, 1= horizontal, 2= vertical, 3 = h + v.
[-motionsearchlevel] <level>
0 = Luma only. (Default)
1 = Luma w/ nearest-int chroma.
2 = Luma w/ true chroma.
3 = Macroblock-adaptive with true chroma.
4 = Macroblock adaptive with nearest int chroma.
[-mesearchmethod] <phase>
0 = off, 1 = always use hadamard, 2 = adaptive sad/hadamard
[-mbcost] <cost method>
0 = SAD/Hadamard, 1 = RD cost.
[-mvcost] <cost method>
0 = static, 1 = dynamic.
[-mvrange] <mv range>
0 to 3 are increasing ranges. 4 is macroblock adaptive.
[-dquantoption] <level>
0 to 3, 0 = off, 1 = I frame only, 2 = I/P frame only, 3 = I/P/B frame.
[-adaptivequant] <adaptive quantization>
0 to 21
[-dquantpstrength] <level>
Range is 0 to 2.
0 = VC-1 encoder-managed setting.
Only valid when -dquantoption > 0.
[-dquantbstrength] <level>
Range is 0 to 4.
0 = VC-1 encoder-managed setting.
Only valid when -dquantoption > 0.
[-bdeltaqp] <qp increase for B-frames>
0 to 30
[-closedentrypt] <closed entry point value.
[-dw] <display width (pixels)>
[-dh] <display height (pixels)>
[-ew] <encode width (pixels)>
[-eh] <encode height (pixels)>
[-lbpresent]
Indicates letterboxing is present.
[-lookahead]
Indicates use lookahead.
-ratecontrolmode must equal 0.
[-adaptiveGOP]
Indicates use adaptive GOP.
[-keyPop] <key pop level>
Indicates use key frame pulse reduction.
Range is 0 to 4. 0 = Off, 1 -4 are strength levels.
[-threads] <num threads>
Maximum is 4.
[-affinity] <affinity mask>
Processor mapping.
[-aspectratio] <aspectratioindex> <aspectratiowidth> <aspectratioheight>
If aspectratioindex is 15, then you must specify aspectratiowidth and
aspectratioheight
ie. if video is 720x480 at 16x9 aspect ratio, use -aspectratio 15 40 33
[-videotype] <type>
0 = progressive, 1 = interlaced frames, 2= interlaced fields
3 = detect interlacing type, 4 = automatic.
[-tff]
Indicates top field first.
[-rff]
Indicates repeat first field.
[-pr] <path to .prx file>
Specifies a .prx file to use for audio profile data.
By default, the sample looks for an appropriate audio codec.
Example: Mode 0
AVS2ASF.exe -i video.avs -o encoded.asf -framerate 25 -profiletype 2
-bframes 2 -maxkeydist 6 -ratecontrol 0 -rate 3000 -vbv 3000000
Example: Mode 1
AVS2ASF.exe -i video.avs -o encoded.asf -framerate 25 -profiletype 2
-bframes 2 -maxkeydist 6
Example: Mode 2
AVS2ASF.exe -i video.avs -o encoded.asf -framerate 25 -profiletype 2
-bframes 2 -maxkeydist 6 -ratecontrol 2 -rate 3000 -vbv 3000000
Example: Mode 3
AVS2ASF.exe -i video.avs -o encoded.asf -framerate 25 -profiletype 2
-bframes 2 -maxkeydist 6 -ratecontrol 3 -rate 3000 -peakrate 25000 -vbv 3000000
Example: Mode 4
AVS2ASF.exe -i video.avs -o encoded.asf -framerate 25 -profiletype 2
-bframes 2 -maxkeydist 6 -ratecontrol 4 -rate 3000
Use an output filename with a suffix of .vc1 for VC1 Elementry Stream encoding
b66pak
25th January 2009, 00:44
thanks...i will give it a try...
_
Celeritas
27th January 2009, 02:30
@NorthPole, thank you. I can get it to play 5.1 with your help, but the 5.1 WAVE_EXTENSIBLE audio is not welcome in WME, so the .prx file can't process it. I've decided to bag the idea of trying to get avs2asf to take 5.1 audio in through a .prx file. I'll just create the 5.1 wma file separately and mux it with Windows Stream Editor.
NorthPole
30th January 2009, 04:03
@celeritas
How did you create your 5.1 wma file? what tool?
Sagittaire
30th January 2009, 06:52
Here is a modified version of Nic's program:
I fixed the aspectratio error described on page 5 of this thread. Also, I fixed the rate control CBR modes 0 & 2 and the 1 pass VBR mode 1. Previously you could only use modes 3 and 4.
Works fine for me in all modes.
http://www.mediafire.com/?3m5x8mmn0rt
You can fix the thread mode bug? (impossible to use more than one thread here).
There are probleme with dquant mode too (impossible to use more than level 1 for dequant)
NorthPole
30th January 2009, 14:56
You can fix the thread mode bug? (impossible to use more than one thread here. There are probleme with dquant mode too (impossible to use more than level 1 for dequant)
I'll look into it... On the thread bug, I don't have a duo core so I'm not sure how successful I will be.
buzzqw
30th January 2009, 15:45
would be awesome if you can use the audio options as wmcmd.vbs in avs2vc1
also fixing audio encoidng (5.1)
BHH
NorthPole
30th January 2009, 16:27
would be awesome if you can use the audio options as wmcmd.vbs in avs2vc1
also fixing audio encoidng (5.1)
BHH
I have been looking at it but I can't get a 5.1 wma file from wmcmd yet. What profile works with wmcmd or what is your command line. I know nic got it to work but I have not had any luck.
NorthPole
30th January 2009, 16:31
Ok here is a new build v0.5...
http://www.mediafire.com/?dcx3lmtygu8
Fixed the quantization problem.
I tried these option and they worked.
-adaptivequant 5 -dquantoption 2 -dquantpstrength 2 -dquantbstrength 0
-adaptivequant 1 -dquantoption 3 -dquantpstrength 2 -dquantbstrength 2
Still working on the thread bug...
Also update the command line help
buzzqw
30th January 2009, 16:42
well at least including audio support will be very GOOD!
BHH
NorthPole
30th January 2009, 17:43
@Sagittaire
Have you tried setting both the -threads and -affinity switches when doing an encode? Also, if you use the Dquant option, you have to have the mvcost = 0.
Sagittaire
31st January 2009, 21:09
@Sagittaire
Have you tried setting both the -threads and -affinity switches when doing an encode? Also, if you use the Dquant option, you have to have the mvcost = 0.
Yes -threads 2 don't work. I have error when I use it.
*************************************
Encoding in ES (Elementry Stream) mode
Failure in CVC1EncASF::set_advancedProps
error = -20
Failure in CVC1EncASF::Init
hr = 0
VC1 SDK Error = -20
Final error code: -20
D:\Mes dossiers\Codec\VC1 SDK>pause
Appuyez sur une touche pour continuer...
NorthPole
31st January 2009, 22:10
@satittaire
I looked at the code and I believe it is sending the correct command line values (ie thread, affinity etc) to the encoder. The error occurs when the encoder gets the info and tries to apply them. What type of cpu do you have?
This is the info from the SDK
Each instance of the VC-1 encoder can use up to four threads to distribute encoding tasks. Each thread runs on a separate processor. Each thread processes a different horizontal portion of the frame. Each horizontal portion should be at least 64 rows in height.
Motion search operations only happen within each horizontal portion. Because most motion in video is typically horizontal, such as panning, motion estimation usually works well. However, if the content contains a lot of vertical motion, some slight loss of coding efficiency may occur.
Note that specifying higher values will not raise an error. The encoder will simply use four threads.
The affinity mask specifies which processors to use. Each binary digit (bit) in the affinity mask represents an individual processor. Setting a bit to one makes the VC-1 encoder use the corresponding processor to run an encoding thread. For example, to make the VC-1 encoder use processors zero, one, two, and three, the low-order byte of the affinity mask would be:
00001111
This affinity mask has a corresponding decimal value of 15
So for the four processors example shown above with the low-order byte of 00001111,
I believe that you obtain the affinity value is decimals by
(1 * 2^3) + (1 * 2^2) + (1 * 2^1) + (1 * 2^0) = 8 + 4 + 2 + 1 = 15
Don't know if that helps (or makes any difference) but the SetNumThreads command used within the program passes both the thread and affinity to the encoder. You may try different combinations to see if anything works. Sorry I couldn't be of more help.
Sagittaire
31st January 2009, 23:01
I have c2d ...
-threads 2 -affinity 00000011 don't work
NorthPole
31st January 2009, 23:44
@sagittarie
You need to enter a decimal number for the affinity so try:
-threads 2 -affinity -3
or
-threads 2 -affinity -2
or
-threads 2 -affinity -1
or
-threads 2 -affinity -0
That about all the ideas I have... Good Luck.
Celeritas
1st February 2009, 00:36
@celeritas
How did you create your 5.1 wma file? what tool?
I will likely just use 6 wav files and create a 5.1 wma10 file with WME9 by removing the video section from what I already use to make wmv files. Then I can mux it with the asf file from avs2asf. Using avs to create a 5.1 soundtrack the file generate an audio stream that WME9 can't decode, and a .prx file just defines the output. I'm starting to wonder if I should just stick with the old Format Encoder, as I was already producing VC-1 output via the advanced profile. I'm not looking to create elementary streams, I just want to play movies back on my Xbox.
b66pak
1st February 2009, 23:06
@sagittaire...may be this fix will help:
http://support.microsoft.com/kb/945170
_
L.E. the source:
http://on10.net/blogs/benwagg/Best-practices-for-Windows-Media-Encoder-in-2009/
_
hellrasinbrasom
7th February 2009, 01:56
I've been having a field day with VC-1 Encoder by using it for my Video Game Projects.:sly:
benwaggoner
9th February 2009, 03:37
I've been having a field day with VC-1 Encoder by using it for my Video Game Projects.:sly:
For recording game activity, or for doing cut scenes in games?
I've been doing some encoding from FRAPS lately, and would love to hear what your experience was like and what settings you've used.
As expected, good modern game footage with nice anti-aliasing looks good. It's the old pixelated Quake/Counterstrike caps full of blocks that aren't aligned with block boundaries that are the killer :).
hellrasinbrasom
9th February 2009, 17:05
In answer to your que benwaggoner its for Cutscenes from 2 game series. The results I got from encoding with VC-1 as a 1st time encoder has been uncanny. As far as settings went I mainly stuck with the HD format for all VOB encodes.
OS: Vista 32 bit
W/H: 1280 x 720
Total Bitrate: 6241
Audio: 192
benwaggoner
19th February 2009, 18:52
@kurtnoise (or anyone else with insight)
I've been trying to get AVS2ASF working, and I keep erroring out. Certainly user error, but here's my (super-simple) command:
"C:\Program Files\AVS2ASF\AVS2ASF.exe" -i BBB.avs -o BBB_Zunecompat.wmv -rate 2000 -peakrate 3000 -framerate 23.976 -maxkeydist 96 -bframes 1 -profiletype 1 -vbv 1500000
And it returns:
Encoding in ASF mode
Failure in CVC1EncASF::set_advancedProps
error = -30
Failure in CVC1EncASF::Init
hr = 0
VC1 SDK Error = -30
Final error code: -30
Total elapsed time in seconds = 0.045000
An expected advanced property not being passed on? I've got all the required ones on there, I believe.
Kurtnoise
19th February 2009, 19:17
profiletype 1/2 have never worked for me with this tool and I don't know why as I said earlier...Hope someone else knows.
benwaggoner
19th February 2009, 19:25
profiletype 1/2 have never worked for me with this tool and I don't know why as I said earlier...Hope someone else knows.
Interesting. If I just switch -profiletype to 2, I fail with a -20 instead of a -30, but I still fail. There's probably a clue in there.
Darn it, I guess I'll have to file a bug on my own product :).
Are you planning any more updates? It could be useful to have a debug mode where it dumps out the exact parameters it's passing off to the SDK.
ss3
19th February 2009, 19:38
oops i too faced frustration using 1/2 profile settings, attemps to work didnot succeed
Looks like problem from MS [:(]
Sagittaire
19th February 2009, 20:35
Interesting. If I just switch -profiletype to 2, I fail with a -20 instead of a -30, but I still fail. There's probably a clue in there.
Darn it, I guess I'll have to file a bug on my own product :).
Are you planning any more updates? It could be useful to have a debug mode where it dumps out the exact parameters it's passing off to the SDK.
work for me ...
@REM Source file name (suffit de mettre la source ici)
set E_SRC=Test.avs
@REM Set of bitrates (ici le bitrate)
set E_BR=2000
@REM Set of max bitrates (ici le bitrate max)
set MAX_BR=3000
@REM Set of Buffer (ici le buffer)
set BUF_BR=1500000
@REM Profil (ici le nom des fichiers de sortie)
AVS2ASF.exe -i %E_SRC% -o azerty.asf -rate %E_BR% -peakrate %MAX_BR% -vbv %BUF_BR% -framerate 23.976 -ratecontrol 3 -profiletype 2 -maxkeydist 96 -bframes 1 -adaptiveGOP -inloop 1 -overlap 0 -complexity 4 -motionsearchlevel 2 -mesearchmethod 1 -mbcost 1 -mvcost 1 -mvrange 4 -adaptivequant 1 -threads 1
Sagittaire
19th February 2009, 20:36
Anyway multithread mode don't work ...
zambelli
19th February 2009, 21:10
@sagittarie
You need to enter a decimal number for the affinity so try:
-threads 2 -affinity -3
or
-threads 2 -affinity -2
or
-threads 2 -affinity -1
or
-threads 2 -affinity -0
That about all the ideas I have... Good Luck.
Correct. Setting the number of threads also requires an affinity mask. If you set the affinity mask to 0, that will instruct the encoder to leave the thread affinitization to the OS.
This should therefore work:
-threads 2 -affinity 0
On a more general note... The sample code that shipped with the SDK is really just that: sample code. If you guys want to make it into a functional utility, somebody needs to implement better parameter parsing, range checking, compatibility checking, etc. ASF muxing could also be enhanced, as well as muxing to non-ASF formats. Finally, audio encoding would be easy to add for somebody with DirectShow or WMF SDK dev knowledge.
If anybody is interested in doing this work, ping me privately and I can help you better understand the SDK.
zambelli
19th February 2009, 21:18
Interesting. If I just switch -profiletype to 2, I fail with a -20 instead of a -30, but I still fail. There's probably a clue in there.
Darn it, I guess I'll have to file a bug on my own product :)
It's unlikely to be a bug on the VC-1 Encoder SDK itself. Simple and Main profile encoding was well tested. It's more likely a bug in the sample code, which wouldn't be all that surprising since its purpose is primarily to demonstrate how to write an encoding app - and not to actually be the encoding app.
Sagittaire
20th February 2009, 00:24
Correct. Setting the number of threads also requires an affinity mask. If you set the affinity mask to 0, that will instruct the encoder to leave the thread affinitization to the OS.
This should therefore work:
-threads 2 -affinity 0
... don't work. I use all possible combinaison with my c2d ... and multithred don't work here.
Comatose
23rd February 2009, 16:42
Can't get it to work... tried encoding a 24000/1001 Blackness clip with Sagittaire's bat (copypasted) and I get error -90.
NorthPole
24th February 2009, 14:25
Ok here is a new build v0.5...
http://www.mediafire.com/?dcx3lmtygu8
Fixed the quantization problem.
I tried these option and they worked.
-adaptivequant 5 -dquantoption 2 -dquantpstrength 2 -dquantbstrength 0
-adaptivequant 1 -dquantoption 3 -dquantpstrength 2 -dquantbstrength 2
Still working on the thread bug...
Also update the command line help
@comatose
Download this updated version. All the command line switches work with this fixed version.
Currently, I can only get this version to work with 2 channel audio sources because the encoder requires wavextensible formatted input for 5.1, etc (which avisynth can't do correctly). Therefore, you can create a wmv with 2 channels audio by using a valid 2 channel prx (profile) file.
For 5.1 wma audio, you can use zambelli's command line script with a valid 5.1 wav file or 5.1 wavepack file. For > 4GB wav files you can use soundout to generate a intermediate 5.1 wavepack file then send it into zambelli's command line script.
There is still a bug in the framerate for the asf container that I haven't had a change to look at yet. So to mux a vc-1 es and a 5.1 wma, use tsmuxer to put the video vc-1 es into a transport stream. Then use elecards asfmuxer to mux the ts video only into a asf container. Finally, use windows media stream editor to put the asf video and 5.1 wma together into a valid wmv file.
buzzqw
24th February 2009, 15:17
would be possible to implement direct audio encoding, without using prx profile ? (like using -a_codec , -a_bitrate ...)
thanks!
BHH
NorthPole
24th February 2009, 17:13
would be possible to implement direct audio encoding, without using prx profile ? (like using -a_codec , -a_bitrate ...)
thanks!
BHH
Yep, I'm hoping to get to that point.... sometime. Still learning
buzzqw
24th February 2009, 17:23
thanks for your work NorthPole!
BHH
zambelli
3rd March 2009, 02:38
There is still a bug in the framerate for the asf container that I haven't had a change to look at yet.
Yeah, that's a known issue with the SDK sample code - it forgot to set a few key properties on the ASF Writer. I can help you out with that. You have my work e-mail now so just shoot me an e-mail anytime.
would be possible to implement direct audio encoding, without using prx profile ? (like using -a_codec , -a_bitrate ...)
NorthPole: You'll want to take a look at these docs - http://msdn.microsoft.com/en-us/library/bb288699(VS.85).aspx. You can talk to the WMA codecs directly and just pass compressed audio samples into the ASF Writer, like with VC-1 samples.
ss3
10th March 2009, 01:57
It's unlikely to be a bug on the VC-1 Encoder SDK itself. Simple and Main profile encoding was well tested. It's more likely a bug in the sample code, which wouldn't be all that surprising since its purpose is primarily to demonstrate how to write an encoding app - and not to actually be the encoding app.
Bump!
Lyris
14th March 2009, 12:14
Apologies if it's been posted, but I can't find this on search:
I'm attempting to use AVS2ASF to generate a VC1 stream for use in Blu-ray Disc authoring (tests).
Everything I encode stutters badly. The encoder codes all the frames I ask it to, but something goes wrong on playback.
Anyone else having this issue? I've looked at all the options but can't find a fix.
My source:
.AVS Script, YV12, 1920x1080, 23.976fps.
My command:
avs2asf -i bbb.avs -o bbb.vc1 -framerate 23.976 -rate 35000 -peakrate 39800 -ratecontrol 3 -complexity 5 -profiletype 2 -bframes 2 -maxkeydist 6 -vbv 300000 -videotype 0 -threads 4
The stutter occurs in PowerDVD for Windows, as well as on Sony BDP-S5000ES hardware player that I have here for review.
benwaggoner
14th March 2009, 16:47
Apologies if it's been posted, but I can't find this on search:
I'm attempting to use AVS2ASF to generate a VC1 stream for use in Blu-ray Disc authoring (tests).
Everything I encode stutters badly. The encoder codes all the frames I ask it to, but something goes wrong on playback.
Anyone else having this issue? I've looked at all the options but can't find a fix.
My source:
.AVS Script, YV12, 1920x1080, 23.976fps.
My command:
avs2asf -i bbb.avs -o bbb.vc1 -framerate 23.976 -rate 35000 -peakrate 39800 -ratecontrol 3 -complexity 5 -profiletype 2 -bframes 2 -maxkeydist 6 -vbv 300000 -videotype 0 -threads 4
The stutter occurs in PowerDVD for Windows, as well as on Sony BDP-S5000ES hardware player that I have here for review.
What did you use to mux the .vc1 into a BD image?
FWIW, Complexity 5 is going to be very slow overkill for HD at those rates. 3 would robably be every bit as good.
Sagittaire
14th March 2009, 16:58
Apologies if it's been posted, but I can't find this on search:
I'm attempting to use AVS2ASF to generate a VC1 stream for use in Blu-ray Disc authoring (tests).
Everything I encode stutters badly. The encoder codes all the frames I ask it to, but something goes wrong on playback.
Anyone else having this issue? I've looked at all the options but can't find a fix.
My source:
.AVS Script, YV12, 1920x1080, 23.976fps.
My command:
avs2asf -i bbb.avs -o bbb.vc1 -framerate 23.976 -rate 35000 -peakrate 39800 -ratecontrol 3 -complexity 5 -profiletype 2 -bframes 2 -maxkeydist 6 -vbv 300000 -videotype 0 -threads 4
The stutter occurs in PowerDVD for Windows, as well as on Sony BDP-S5000ES hardware player that I have here for review.
Your profil is simply bad ...
thread 4 work for you ... ???
Lyris
15th March 2009, 21:37
Ben, thanks for your input. It was a trial version of Netblender DoStudio. Can't afford Scenarist at the moment, sadly.
Does the "Complexity" setting affect compatibility at all? Or is this purely a setting that defines the encode process? I'll try lowering it and report back.
Sagittaire: not totally sure how I would test this - would Windows Task Manager's 4 CPU indicaters show it? (I've just had to reinstall everything, so will heck this out soon).
Lyris
16th March 2009, 06:50
Changing the complexity didn't help, but changing the -maxkeydist to 24 did - not sure why I had it set to 14, maybe an early morning typo :)
Sagittaire
16th March 2009, 08:02
Changing the complexity didn't help, but changing the -maxkeydist to 24 did - not sure why I had it set to 14, maybe an early morning typo :)
-maxkeydist use second for unity. BD profil use maxgop at 24 frame if you use maxbitrate > 15 Mbps. Here good BD profil:
@REM -----------------------------------------------------------
@REM
@REM Profil BluRay 1080p23.976 2 passes extra high quality
@REM
@REM -----------------------------------------------------------
@REM Source file name (suffit de mettre la source ici)
set E_SRC=HDDVD.avs
@REM Set of bitrates (ici le bitrate)
set E_BR=12000
@REM Set of max bitrates (ici le bitrate max)
set MAX_BR=40000
@REM Set of Buffer (ici le buffer)
set BUF_BR=3750000
@REM Profil (ici le nom des fichiers de sortie)
AVS2ASF.exe -i %E_SRC% -o azerty.vc1 -rate %E_BR% -peakrate %MAX_BR% -vbv %BUF_BR% -framerate 23.976 -ratecontrol 3 -profiletype 2 -maxkeydist 24 -bframes 1 -adaptiveGOP -inloop 1 -overlap 0 -complexity 4 -motionsearchlevel 2 -mesearchmethod 1 -mbcost 1 -mvcost 1 -mvrange 4 -adaptivequant 1 -threads 1
pause
ACrowley
16th March 2009, 10:22
I get a Error with this Profile
Encoding in ES (Elementry Stream) mode
Failure in CVC1EncASF::set_advancedProps
error = -30
Failure in CVC1EncASF::Init
hr = 0
VC1 SDK Error = -30
Final error code: -30
And why -thread 1 ? Are there still Problmes with more Threads ?
Bframes 1 ? For example Mainconcept Reference use 3 bframes for the VC1 Bluray Profile
Sagittaire
16th March 2009, 18:24
I get a Error with this Profile
strange ... work for me.
It's compliant BD profil.
And why -thread 1 ? Are there still Problmes with more Threads ?
Multithread don't work for me with c2d and winXP.
Bframes 1 ? For example Mainconcept Reference use 3 bframes for the VC1 Bluray Profile
More is not always better:
1) Even for really advanced codec like x264 more than 1 bframe don't improve quality with large margin. In most case more than 3 bframe with x264 is completely useless and codec will use in most case only 1 bframe.
2) 7 bframes is compliant with BD. Anyway VC1 SDK implementation from MS don't use adaptative bframe. For me 1 bframe produce the best visual result. 3 no adaptive bframe is not good for quality in general case.
benwaggoner
17th March 2009, 19:35
Multithread don't work for me with c2d and winXP.
What happens when you use it?
We've got plenty of companies shipping the SDK on multicore XP (both Pro and Embedded) boxes and we haven't had any complaints about multithreading now working.
1) Even for really advanced codec like x264 more than 1 bframe don't improve quality with large margin. In most case more than 3 bframe with x264 is completely useless and codec will use in most case only 1 bframe.
For film/video source, 1 B-Frame is almost always optimal for VC-1.
2) 7 bframes is compliant with BD. Anyway VC1 SDK implementation from MS don't use adaptative bframe. For me 1 bframe produce the best visual result. 3 no adaptive bframe is not good for quality in general case.
Actually, I thought BD was limited to 3 B-frames; HD DVD could do the full 7.
Also, I should mention there's some B-Frame scalability in the decoder; it'll turn off B-frames during fades in order to get intensity compensation, and will insert BI frames at flashes. It's just the default B-frame pattern itself doesn't change.
timna
19th March 2009, 20:46
I am trying to develop real-time live stream application using VC-1 SDK with Vista 32bit VS2005.
After doing a bit of research, I thought doing main profile would be a good idea for start. So here I am, trying to figure out how to configure CVC1Encoder.
However, no matter what I configure with it (for main profile), it always returns 'ERR_INVALIDSETTING'.
Here is example setting that I am doing. Someone who has any success in this can perhaps help me.
// Create the VC-1 encoder class.
m_pEncoder = new CVC1Encoder;
CONFIG_PROPERTIES config;
ZeroMemory(&config, sizeof(CONFIG_PROPERTIES));
config.dBitRate = 800;
config.dwComplexityLevel = 2;
config.dwQP = 20;
config.dFrameRate = 30;
config.bInterlacedSource = FALSE;
config.dwMaxKeyFrameDistance = 10;
config.dwMaxHeight = 240;
config.dwMaxWidth = 320;
config.dwNumOfBFrames = 1;
config.dPeakBitRate = 1200;
config.dwProfile = 1;
config.dwRateControlMode = 0;
config.dwVBVBufferInBytes = 3000000;
DWORD code = m_pEncoder->Configure(config);
I thought that perhaps it is a problem with my VC++ project setting or some sort so I set this right into AVI2ASF sample, still same error pops out.
timna
23rd April 2009, 00:53
I was able to solve the problem by getting help from Alex.
The problem is that for CBR case dPeakBitRate needs to be set to 0 and dFrameRate is double that for 15 fps it need to be as 10000000/666666. dwQP was set to 60 since it was not in seconds but in frames. dwVBVBufferInBytes was set to dBitRate/8*1000*seconds (where seconds time for buffer).
The real-time quality for VC-1 is stunning. With only using 50KB or less for bandwidth, it was producing great pictures for me.
I hope this helps.
DrBonzo
12th May 2009, 19:16
Someone was asking for a GUI for this encoder - here's one:
http://extranet.spitzinc.com/download/public/misc/VC123.zip
This is a Visual Studio '08 project that uses MFC. It's basically AVI2ASF plus a big dumb dialog for all the parameters. This is a work in progress on the way to becoming a fairly narrow-purpose in-house tool, but others might find it useful for experimenting with the VC-1 encoder. I've left a pre-built executable in the Release folder for anyone without an IDE.
Read UsageNotes.txt
I'd be happy to entertain suggestions for improvement, but can't promise to implement anything . . .
b66pak
12th May 2009, 19:41
thanks...
_
benwaggoner
13th May 2009, 05:18
Someone was asking for a GUI for this encoder - here's one:
http://extranet.spitzinc.com/download/public/misc/VC123.zip
This is a Visual Studio '08 project that uses MFC. It's basically AVI2ASF plus a big dumb dialog for all the parameters. This is a work in progress on the way to becoming a fairly narrow-purpose in-house tool, but others might find it useful for experimenting with the VC-1 encoder. I've left a pre-built executable in the Release folder for anyone without an IDE.
Very cool!
I suppose zambelli and I should start offering suggestions for how to constrain the options so that it doesn't let you do illegal combinations...
DrBonzo
13th May 2009, 12:57
Very cool!
I suppose zambelli and I should start offering suggestions for how to constrain the options so that it doesn't let you do illegal combinations...
That would be great. For me, the hardest thing about working with the SDK is the minimal information I get from the error returns. I've tried to incorporate as much info from the docs as I can about parameter limits and such, but there's clearly a lot of cross-dependencies that either aren't documented or that I've missed. If only the settings validation source code from the encoder could be released . . .
benwaggoner
13th May 2009, 15:09
That would be great. For me, the hardest thing about working with the SDK is the minimal information I get from the error returns. I've tried to incorporate as much info from the docs as I can about parameter limits and such, but there's clearly a lot of cross-dependencies that either aren't documented or that I've missed. If only the settings validation source code from the encoder could be released . . .
Well, first off, if you have any active questions, ask away.
DrBonzo
26th May 2009, 17:34
Well, first off, if you have any active questions, ask away.
Well, OK. Here's a couple:
First, here's a set of parameters that gives an ERR_INVALIDSETTINGS from Configure(..):
interlaced "0"
lbpresent "0"
lookahead "1"
adaptivegop "1"
tff "0"
rff "0"
denoise "0"
inloop "0"
median "0"
overlap "0"
noiseedge "0"
closedentrypt "1"
allowinvalid "1"
rate "12000.00"
framerate "30.00"
peakrate "1.00"
complexity "3"
qp "31"
maxkeydist "30"
bframes "1"
profiletype "2"
ratecontrol "0"
vbv "1500000"
deltamvrange "0"
mbcost "0"
motionsearchlevel "2"
mesearchmethod "0"
mvcost "0"
mvrange "0"
adaptivequant "0"
dquantbstrength "0"
dquantpstrength "0"
dquantoption "0"
bdeltaqp "1"
dh "1920"
dw "1920"
eh "1920"
ew "1920"
keypop "0"
threads "1"
affinity "0"
videotype "0"
outmode "0"
i "Z:\ScidomeHD\BlackHoles_Trailer\1920x1920_Source\BH_Trailer_1920_Lagarith_NoAudio.avi"
o "Z:\ScidomeHD\BlackHoles_Trailer\1920x1920_Source\BH_Trailer_1920_Lagarith_NoAudio.wmv"
pr "C:\devSpace\VC123\SciDomeAudio.prx"
The encoder seems to think it's Configure(..)ed anyway, though, and is willing to continue. A more serious and puzzling problem is the following:
The input is a 2100 frame 1920x1920 clip. At the end of the encode loop, GetWriterStatistics(..) reports that there were a total of 2100 frames, but only 89 coded. A little additional instrumentation in the loop showed that there were a total of 2011 ERR_NO_OP_FRAMEs with 2002 consecutive and 9 flushed in CVC1EncASF::FlushVideo(). The output file plays fine, but it appears to be only the first 3 seconds of the input, consistent with the number of reported coded frames. CVC1Encoder::EncodeFrame(..) reports no errors other than ERR_NO_OP_FRAME.
I'm sort of clueless about what else to look for. Any ideas?
benwaggoner
26th May 2009, 17:57
Well, OK. Here's a couple:
First, here's a set of parameters that gives an ERR_INVALIDSETTINGS from Configure(..):
...
peakrate "1.00"
...
The input is a 2100 frame 1920x1920 clip. At the end of the encode loop, GetWriterStatistics(..) reports that there were a total of 2100 frames, but only 89 coded. A little additional instrumentation in the loop showed that there were a total of 2011 ERR_NO_OP_FRAMEs with 2002 consecutive and 9 flushed in CVC1EncASF::FlushVideo(). The output file plays fine, but it appears to be only the first 3 seconds of the input, consistent with the number of reported coded frames. CVC1Encoder::EncodeFrame(..) reports no errors other than ERR_NO_OP_FRAME.
I'm sort of clueless about what else to look for. Any ideas?
It's not supposed to matter as you're doing a CBR encode, but your peak bitrate is set to 1 Kbps. The behavior you're seeing would be compatible with the encoder just being able to give you a few QP31 frames at that bitrate.
Perhaps try setting it to the same as your bitrate, or just don't set it?
DrBonzo
27th May 2009, 14:26
It's not supposed to matter as you're doing a CBR encode, but your peak bitrate is set to 1 Kbps. The behavior you're seeing would be compatible with the encoder just being able to give you a few QP31 frames at that bitrate.
Perhaps try setting it to the same as your bitrate, or just don't set it?
Thanks, Ben.
Yes, setting the peak rate = bit rate made everything work, though I still get the ERR_INVALIDSETTINGS. Since peak rate is part of the struct that gets sent to Configure, not setting it would not seem to be an option, but if I make it 0, the ERR_INVALIDSETTINGS goes away (?!) and the encode seems to work (it's still running). I guess the lesson is to make peak rate zero in the GUI for all but peak-constrained VBR.
I don't understand the peak rate / QP relation - could you offer a line or two of explanation? Actually I don't understand what QP is at all - maybe you've got a pointer to a fuller doc?
benwaggoner
27th May 2009, 14:47
Yes, setting the peak rate = bit rate made everything work, though I still get the ERR_INVALIDSETTINGS. Since peak rate is part of the struct that gets sent to Configure, not setting it would not seem to be an option, but if I make it 0, the ERR_INVALIDSETTINGS goes away (?!) and the encode seems to work (it's still running). I guess the lesson is to make peak rate zero in the GUI for all but peak-constrained VBR.
Cool. Glad that's working.
You might want to take a look with WMSnoop to make sure your output is what you think it should be.
I don't understand the peak rate / QP relation - could you offer a line or two of explanation? Actually I don't understand what QP is at all - maybe you've got a pointer to a fuller doc?
QP=Quantization Parameter. Higher QP is higher quantization, hence more compressed and lower quality.
When you set buffer, that determines the maximum bitrate for any section of the video.
QP sets the maximum compression per frame.
Both constraints will be honored, with frames being dropped as needed. So, using lower QP values mean that minimum quality for a frame goes up, but frames are more likely to be dropped in order to maintain the buffer.
Generally QP=31 is the appropriate default, since dropped frames are really annoying. For typical content, bitrates, and frame sizes, you're not likely to get to QP 31 even once in a file. Your file is probably all QP 31, since you were encoding at 1 Kbps :).
Midzuki
27th May 2009, 15:24
Someone was asking for a GUI for this encoder - here's one:
http://extranet.spitzinc.com/download/public/misc/VC123.zip
You forgot to mention that VC123.exe requires the annoying MSVC9 dlls, which I do not intend to install on my PC.
DrBonzo
27th May 2009, 15:50
You forgot to mention that VC123.exe requires the annoying MSVC9 dlls, which I do not intend to install on my PC.
Yeah, sorry. I sympathize, but that's the way it builds on my machine. Worse, it wants MFC dlls, too.
It's probably possible to use alternate C libs, but you'd have to build from source & finesse the MFC stuff too...
DrBonzo
28th May 2009, 15:31
You forgot to mention that VC123.exe requires the annoying MSVC9 dlls, which I do not intend to install on my PC.
I've added a setup project to this solution and left a .msi setup file in the tree. Upside - you can now install it even if you don't already have the proper libraries; downside - it will install the libraries. Also, the .zip file has grown from less than 1 meg to over 14 meg. It's available at the same URL.
DrBonzo
28th May 2009, 15:37
QP=Quantization Parameter. Higher QP is higher quantization, hence more compressed and lower quality.
. . .
Um, yes, but what specifically does quantization refer to here? It would not seem to be intensity levels or DCT coefficients. The range of values and name make me think that something is limited to 5 bits, but what?
benwaggoner
29th May 2009, 03:14
Um, yes, but what specifically does quantization refer to here? It would not seem to be intensity levels or DCT coefficients. The range of values and name make me think that something is limited to 5 bits, but what?
This is the quantization parameter used to scale the DCT coefficients. Higher values give coarser quantization and cause more detail to fall into the deadzone and disappear. This increases compression artifacts, and compression. Ala:
http://en.wikipedia.org/wiki/Quantization_(image_processing)#Frequency_quantization_for_image_compression
The least compression is QP=1, where the matrix is left alone. The highest in VC-1 is 31, where each coefficient is divided by 31.
There's actually more than 31 steps in VC-1, though, as half-step values can be used from 1.5-7.5.
AlexW
29th May 2009, 03:35
The least compression is QP=1, where the matrix is left alone. The highest in VC-1 is 31, where each coefficient is divided by 31.
wouldn't each coefficient be divided by 2 when QP=1 and 62 when QP=31 in VC-1?
benwaggoner
4th June 2009, 19:59
wouldn't each coefficient be divided by 2 when QP=1 and 62 when QP=31 in VC-1?
Ooops, scale factor, not QP :).
TinTime
19th October 2009, 20:36
I've been using my own version of this code recently (including Nic's changes) so, after a bit of last minute tidying up, I thought I'd pass it on to anyone who's interested.
Download here (http://www.mediafire.com/file/ztl0tdilg4n/AVS2ASF.zip).
First a quick disclaimer. I only use it for encoding AVS to a VC-1 elementary stream (so profile 2 and no audio). I don't think I've broken anything else but you never know :)
Also I've tried to add a bit more validation but I'm sure I've missed plenty of illegal parameter combinations.
Anyway, the changes:
Parameters:
Removed -framerate. Framerate is now taken from the input file.
Added -showparms. This will print all of the encoder parms to the command window.
Added -sarx and -sary. These are used to set PixHeight, PixWidth, PixIndex, DisplayHeight and DisplayWidth. They will override -aspectratio, -dw and -dh if they're also set.
e.g. If the input resolution is 704x576 then using -sarx 16 -sary 11 will set...
PixHeight = 11
PixWidth = 16
PixIndex = 15
DisplayHeight = 576
DisplayWidth = 1024
NB. I've hardcoded an exception to these rules. If DisplayHeight is calculated as 480 and DisplayWidth is calculated as 853 then they'll be changed to 1024x576. My goal here is to be able to mux to mkv without having to set display parameters and 853x480 isn't quite right. I wanted to think of a better way to handle non-integer display values but then I hardcoded it and lazyness took over...
e.g. If the input resolution is 704x480 then using -sarx 40 -sary 33 will set...
PixHeight = 33
PixWidth = 40
PixIndex = 15
DisplayHeight = 576
DisplayWidth = 1024
Functionality:
Various default values are set so that it only needs input and output filenames to run. Obviously it probably won't encode as you want but running...
AVS2ASF.exe -i input.avs -o output.vc1
...can provide a starting point, especially if -showparms is specified. Then other parms can be set as needed.
Validation:
I've tried to validate parameters based on the ratecontrol setting. If they're obviously wrong then it will fail, otherwise it will correct the fault.
e.g.
If -rate isn't set for -ratecontrol 2 then it will fail.
If -peakrate is set for -ratecontrol 2 then it will set it to 0 and continue.
In both cases a message will be written out, and there's always -showparms to see what parameter values are ultimately being used.
Kurtnoise
19th October 2009, 21:27
nitpick: you use the win 7 SDK or the old one for the compilation ?
TinTime
19th October 2009, 21:40
The old one - I'm running WinXP at the moment. Presumably any Win 7 libraries will require Win 7?
Kurtnoise
19th October 2009, 21:47
Win 7 SDK supports x86, x64, and IA64 platform architectures for building and running applications on Windows XP SP3, Windows Server 2003 R2, Windows Vista, Windows Server 2008, and Windows 7.
http://www.microsoft.com/downloads/info.aspx?na=40&p=2&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=71deb800-c591-4f97-a900-bea146e4fae1&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2f8%2f8%2f0%2f8808A472-6450-4723-9C87-977069714B27%2fReleaseNotes_Win7RTMSDK.Htm
Midzuki
19th October 2009, 22:20
@ TinTime: YES!, your wvc1enc.exe :D is working as it should! :)
So far at least, I mean. :p
"-bframes 0" don't generate an esoteric error message, and the program accepts all the 5 types of ratecontrol. :cool:
Only one small annoyance: when it finishes the encoding, it doesn't close itself, so I have to open another CMD window in order to kill the stubborn application. :)
Anyway, : :goodpost: && :thanks:
Inspector.Gadget
19th October 2009, 22:27
Tintime: Thanks for your build! On my system (64-bit Vista SP2), your ASV2ASF binary crashes at 99% when used with no switches other than -i and -o but apparently generates a compliant VC1 file anyway (OK with mkvmerge, etc.). I've been feeding it the following:
Colorbars()
Trim(0,10000)
ConverttoYV12()
So this strikes me as likely something simple, such as some 64-bit weirdness with your encoders' return code.
Midzuki
20th October 2009, 00:01
Colorbars()
Trim(0,10000)
ConverttoYV12()
Add a "KillAudio()" and see if it makes a difference
(but I agree, the encoder is not ignoring completely the presence of an audio stream, therefore the source code needs to be improved).
Inspector.Gadget
20th October 2009, 00:49
OK, that fixed the error. Definitely related to audio handling. Thanks, Midzuki!
TinTime
20th October 2009, 01:31
http://www.microsoft.com/downloads/info.aspx?na=40&p=2&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=71deb800-c591-4f97-a900-bea146e4fae1&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2f8%2f8%2f0%2f8808A472-6450-4723-9C87-977069714B27%2fReleaseNotes_Win7RTMSDK.Htm
Ah. I'll do some reading :) - thanks.
Only one small annoyance: when it finishes the encoding, it doesn't close itself, so I have to open another CMD window in order to kill the stubborn application. :)
On my system (64-bit Vista SP2), your ASV2ASF binary crashes at 99% when used with no switches other than -i and -o but apparently generates a compliant VC1 file anyway (OK with mkvmerge, etc.).
Add a "KillAudio()" and see if it makes a difference
(but I agree, the encoder is not ignoring completely the presence of an audio stream, therefore the source code needs to be improved).
OK, that fixed the error. Definitely related to audio handling. Thanks, Midzuki!
Thanks for your feedback. Midzuki, you're right. KillAudio() stops it hanging. I've only ever used the code to produce a VC-1 stream, and so I've never tried audio in the input. It clearly throws a wobbly with audio, as generated by Colorbars() for example, when writing a VC-1 stream. Which makes sense (from the code's point of view) - no audio possible in a raw video stream. Although waiting until the end of the encode probably isn't ideal.
So, error handling should be - if output is raw VC-1, audio cannot be present.
Midzuki
20th October 2009, 03:17
Well, here go another $1.99, to whom this may interest. :)
A command-line VC-1 compressor should, ideally, do without the .ASF output option (or... replace it with .TS, .MP4, and .AVI options :D — and I'm serious). From the several VC-1 encodes I have done so far, I perceive that the Microsoft implementation of the open VC-1 standard is "ASF-centric" :( Which means, even when generating an elementary stream, the Microsoft compressors not rarely drop/repeat frames :mad: Only when I use VirtualDub + ffdshow, or cscript.exe + Wmcmd.vbs w/ unconstrained 2-pass VBR, I can be (almost-)sure I won't get skipped/duplicated frames. OK, the ASF container is good for streaming, and was designed to support variable frame-rate and variable sample-rate — however the VC-1 encoders themselves have no good reason to be "optimized for the ASF wrapper". :devil:
benwaggoner
20th October 2009, 03:49
@Midzuki,
Well, VC-1 Simple and Main profiles really require the ASF wrapper. It's only AP that has transport independence. And there's no reason not to support ASF output along with other container types. The bitstream encoding is identical; it's just a different muxing mode.
buzzqw
20th October 2009, 08:07
@TinTime
awesome works! :thanks:
will be possibile to add audio support ?
BHH
Midzuki
20th October 2009, 13:15
@TinTime
awesome works! :thanks:
will be possibile to add audio support ?
If by "audio support" you mean "encoding to AAC / AC3 / MPA",
then TinTime will have my official approval. :D
buzzqw
20th October 2009, 13:18
just wma... and producing a wmv file with both audio and video muxed...
for aac/ac3/mpa.. i prefer eac3to/neroaac... ;)
BHHH
Midzuki
20th October 2009, 13:27
Well, I think it wouldn't be terribly difficult to call libaften and lame_enc. :) Anyway, WMA is not suitable for the containers MP4 and M2TS ;)
@ benwaggoner: it seems you missed my whole point.
Even when I use "insane" settings for VC-1 encoding,
duplicated frames will still happen. And when the ASF output is chosen,
the compressor may generate less frames than the framecount of the source file (1095 frames instead of 1100 frames, for example).
I serious doubt the WMV~encoders didn't behave so
before the "VC-1 Era".
TinTime
20th October 2009, 15:08
just wma... and producing a wmv file with both audio and video muxed...
for aac/ac3/mpa.. i prefer eac3to/neroaac... ;)
BHHH
I agree - I think eac3to has got all the audio options well covered. Does the audio not work at all now? I'm wondering if I've broken something or whether it never worked properly. I'll give it a go now.
Well, I think it wouldn't be terribly difficult to call libaften and lame_enc. :) Anyway, WMA is not suitable for the containers MP4 and M2TS ;)
I think you're overestimating my C++ skills :)
TinTime
20th October 2009, 18:06
I've made a small change to completely ignore audio when the output is .vc1 or .raw. New version is here (http://www.mediafire.com/file/nnmajnyzzng/AVS2ASF.zip).
It now doesn't hang/crash when writing to .vc1 with this script:
Colorbars()
Trim(0,1000)
ConverttoYV12()
just wma... and producing a wmv file with both audio and video muxed...
I tried with the following script:
Colorbars()
Trim(0,1000)
ConverttoYV12()
ConvertAudioTo16bit()
It produced a working asf file with audio, but I had to create an encoder profile and specify it with the -pr switch.
Midzuki
20th October 2009, 19:04
I've made a small change to completely ignore audio when the output is .vc1 or .raw. New version is here (http://www.mediafire.com/file/nnmajnyzzng/AVS2ASF.zip).
Thanks! I will test it A.S.A.P.
buzzqw
20th October 2009, 19:14
It produced a working asf file with audio, but I had to create an encoder profile and specify it with the -pr switch.
yes, but would be very very handy if avs2asf will accept the same audio encoder parameters as wmcmd.vbs
BHH
TinTime
20th October 2009, 21:44
I see what you mean. To be honest I'm not really interested in the audio side of things - my goal was really just to get the video encoding into a more stable state so I could start trying out different options without it failing inexplicably.
That said, I might have a look and see if I can make any sense of the audio code. I guess my first task will be to see if I can get it to work without specifying an external encoder profile. If I can then perhaps adding the kind of audio options you want won't be too hard. But don't hold your breath :)
By the way, if anyone wants the source code I'm using I can post that too. In fact I'll include it with any future updates.
benwaggoner
20th October 2009, 23:19
Well, I think it wouldn't be terribly difficult to call libaften and lame_enc. :) Anyway, WMA is not suitable for the containers MP4 and M2TS ;)
We've got WMA working just fine in MP4 for Smooth Streaming, FWIW.
@ benwaggoner: it seems you missed my whole point.
Even when I use "insane" settings for VC-1 encoding,
duplicated frames will still happen.
There's something wrong in your pipeline or settings then. We've exaustively tested that SDK with lots of long-form content, and simply have never seen it inject duplicated frames. If you're in Elementary Stream Sequence Header mode with proper settings, if it has to drop a frame due to VBV restrictions, it'll insert a proper skip_frame tag.
And when the ASF output is chosen,
the compressor may generate less frames than the framecount of the source file (1095 frames instead of 1100 frames, for example).
The container is a muxing post-process and so won't have any impact on the elementary bitstream.
I serious doubt the WMV~encoders didn't behave so
before the "VC-1 Era".
I think all the frame dropping issues had been fixed by the 2006 Format SDK 11, which is a generation before the VC-1 encoder SDK.
Midzuki
21st October 2009, 03:01
TinTime: now the program closes properly after encoding a .vc1 file, but it still "stalls" after creating a .ASF. I would like to know why this bad behavior appears not only in the WMV9 Sample Encoder, but also in ffmpeg2theora, WMVmuxer, and wm8eutil. :)
As for the WMA support, that's not relevant to me. If/when I want to create a WMA file, I can use Winamp, or WMNicEnc (yes, the GUI of Windows Media Encoder is a "mess", I really can't stand it. :p ). For muxing, AsfBin or WMVMuxer can do the job, fast and well.
benwaggoner wrote:
We've got WMA working just fine in MP4 for Smooth Streaming, FWIW.
Good! Now all that we need is a MP4 muxer and a MP4 splitter that support WMA in MP4. (BTW, what about VC-1 in MP4?)
If you're in Elementary Stream Sequence Header mode with proper settings, if it has to drop a frame due to VBV restrictions, it'll insert a proper skip_frame tag.
Wouldn't it be possible to rewrite the encoder in order to avoid the frame dropping completely ??? If I am not recording a live video stream, what is the point of dropping frames during the compression process? :confused:
The container is a muxing post-process and so won't have any impact on the elementary bitstream.
Perhaps...
The Windows Media Audio and Video codecs have been developed
to use the properties of the Advanced Systems Format (ASF),
which is the container used by Windows Media.
One of the ways in which the Windows Media Video codecs
produce video content for low bit rates is
by dropping duplicate frames.
{
source: msdn.microsoft.com
}
TinTime
22nd October 2009, 17:50
TinTime: now the program closes properly after encoding a .vc1 file, but it still "stalls" after creating a .ASF. I would like to know why this bad behavior appears not only in the WMV9 Sample Encoder, but also in ffmpeg2theora, WMVmuxer, and wm8eutil. :)
I'm not sure why this should be - all I can say is that this doesn't happen on my pc. The last thing the asf writer does is update the indexing, etc. so for a large file it may appear to stall after it's finished encoding whilst it's doing this. Perhaps something else like explorer is trying to access it when this is happening? Pure guesswork on my part though.
Anyhow, there's a new version (http://www.mediafire.com/file/ztl0tdilg4n/AVS2ASF.zip), with the tiniest of changes. It just skips a bit of asf code when writing .vc1 output, but functionally there's no difference. The main reason for recompiling is that I've updated to the Win 7 SDK as per Kurtnoise's suggestion. Also I wanted to include the source with the download.
Midzuki
23rd October 2009, 00:41
I'm not sure why this should be - all I can say is that this doesn't happen on my pc.
.
.
.
Perhaps something else like explorer is trying to access it when this is happening?
Probably it's because your PC is full of SDKs, compilers, poorly-designed runtime environments ;) , etc., — whereas my obsolete Pentium-4 isn't. :D
Anyhow, there's a new version (http://www.mediafire.com/file/ztl0tdilg4n/AVS2ASF.zip), with the tiniest of changes. It just skips a bit of asf code when writing .vc1 output, but functionally there's no difference. The main reason for recompiling is that I've updated to the Win 7 SDK as per Kurtnoise's suggestion. Also I wanted to include the source with the download.
Thanks.
benwaggoner
23rd October 2009, 18:23
As for the WMA support, that's not relevant to me. If/when I want to create a WMA file, I can use Winamp, or WMNicEnc (yes, the GUI of Windows Media Encoder is a "mess", I really can't stand it. :p ). For muxing, AsfBin or WMVMuxer can do the job, fast and well.
Try the free Expression Encoder 3, or even WMP. I'm not a fan of the WME GUI either.
benwaggoner wrote:
Good! Now all that we need is a MP4 muxer and a MP4 splitter that support WMA in MP4. (BTW, what about VC-1 in MP4?)
MPEG has an official mapping spec for VC-1 in MPEG-4, which we used for the fragmented MPEG-4 Smooth Streaming implementation.
Wouldn't it be possible to rewrite the encoder in order to avoid the frame dropping completely ??? If I am not recording a live video stream, what is the point of dropping frames during the compression process? :confused:
I think you'll only see frame dropping in CBR modes, in fact. The main time I see significant frame dropping is if a max QP per frame is set too low. Leave it at the default max of 31.
If there's a mismatch between source and output frame rates, that could also yield duplicate frames due to judder, although that's rarer.
One of the ways in which the Windows Media Video codecs produce video content for low bit rates is
by dropping duplicate frames.
{
source: msdn.microsoft.com
}
This was true of older versions of the Format SDK, but was removed for VBR as of Format SDK 11, which the VC-1 Encoder SDK is derived from.
Midzuki
24th October 2009, 02:21
Try the free Expression Encoder 3
When I buy a new PC and install Windows Vista or Windows Seven on it, surely. :)
I'm not a fan of the .NET FrameworkS.
I think you'll only see frame dropping in CBR modes, in fact. The main time I see significant frame dropping is if a max QP per frame is set too low. Leave it at the default max of 31.
Sorry, but it seems that neither AVI2ASF, nor AVS2ASF are aware of that. :(
This was true of older versions of the Format SDK, but was removed for VBR as of Format SDK 11, which the VC-1 Encoder SDK is derived from.
As I said above, it seems that neither AVI2ASF, nor AVS2ASF are aware of that.
BTW: dropping or duplicating frames should have never been present in any of the WMV9 implementations, to begin with. :p To drop and to duplicate frames is a decision that should always be taken by the capturing/streaming application, NOT by the codec itself. At least XviD and Mencoder give to the user the freedom to choose, whereas the Windows Media Video encoders give me no choice at all. :(
Inspector.Gadget
24th October 2009, 02:30
Try the free Expression Encoder 3, or even WMP. I'm not a fan of the WME GUI either.
Wow, EE3 free is sharp! I've been playing around with it today and there's only one thing I can't figure out: how to get the output of input from Avisynth video and WAV audio to go to the same file. What I need to do is point the encoded video and audio to the same file, rather than separate ASF containers. I can work around this in Avisynth with AudioDub(), but that's annoying. Where's the switch I'm missing? Thanks.
benwaggoner
24th October 2009, 03:57
Wow, EE3 free is sharp! I've been playing around with it today and there's only one thing I can't figure out: how to get the output of input from Avisynth video and WAV audio to go to the same file. What I need to do is point the encoded video and audio to the same file, rather than separate ASF containers. I can work around this in Avisynth with AudioDub(), but that's annoying. Where's the switch I'm missing? Thanks.
Go into the "Enhance" tab and select your WAV source as the Audio Overlay.
benwaggoner
24th October 2009, 04:02
When I buy a new PC and install Windows Vista or Windows Seven on it, surely. :)
I'm not a fan of the .NET FrameworkS.
It's supported back to XP. If you have an objection to installing .NET, I can't help you though :).
BTW: dropping or duplicating frames should have never been present in any of the WMV9 implementations, to begin with. :p To drop and to duplicate frames is a decision that should always be taken by the capturing/streaming application, NOT by the codec itself. At least XviD and Mencoder give to the user the freedom to choose, whereas the Windows Media Video encoders give me no choice at all. :(
It's always been under programmatic control, via the "Quality" slider. A value of 0 sets the Max QP to 31, and eliminates CBR frame dropping in all but the most extreme cases as long as your using VC-1 Encoder SDK or at least the Format SDK 11 (WMP 11/Vista).
FSDK 11 and later should not drop frames in VBR encoding under any normal circumstances (I'm not really sure what happens if you set Min QP to 1).
Also, if you're using Advanced Profile properly configured, even in CBR mode it would introduce an explicit frame_repeat tag, not just extend the duration of the previous frame.
Inspector.Gadget
24th October 2009, 04:04
Go into the "Enhance" tab and select your WAV source as the Audio Overlay.
Thanks!
Midzuki
24th October 2009, 04:35
benwaggoner wrote:
It's always been under programmatic control, via the "Quality" slider.
I would prefer a checkbox with the option "Never drop frames". So the encoder would have to either increase bitrate and quality, or generate artifacts.
<!-- I'm leaving this thread behind -->
benwaggoner
24th October 2009, 23:18
benwaggoner wrote:
I would prefer a checkbox with the option "Never drop frames". So the encoder would have to either increase bitrate and quality, or generate artifacts.
<!-- I'm leaving this thread behind -->
Well, I'd say that respecting the VBV is the first order of business; a non-compliant file is worse than a missing frame. That said, I certainly think older versions of Windows Media, like other streaming-era codecs, dropped frames too much with default settings.
But it really hasn't been a problem in any of the implementations of the last 3 years.
Just using 2-pass VBR where the peak=average probably would give you this behavior I believe. And having non-pathological bitrates is always a big help :).
Jerry_Sm@rt
20th May 2010, 16:23
@TinTime
mediafire is blocked here,would you make a mirror download?
Biggiesized
20th May 2010, 21:10
@TinTime
mediafire is blocked here,would you make a mirror download?
What mirrors aren't blocked?
TinTime
22nd May 2010, 12:14
@TinTime
mediafire is blocked here,would you make a mirror download?
Try this:
http://www.tintime.talktalk.net/AVS2ASF.zip
Jerry_Sm@rt
25th May 2010, 05:16
thanx.
filler56789
25th June 2012, 07:07
@comatose
Download this updated version. All the command line switches work with this fixed version.
The mediafire link is dead, does anybody have a copy of that file?
Reel.Deel
26th June 2012, 04:29
Try this one (http://forum.doom9.org/showpost.php?p=1336993&postcount=211).
filler56789
26th June 2012, 13:09
Try this one (http://forum.doom9.org/showpost.php?p=1336993&postcount=211).
Thanks for trying to help, but that's not what I am looking for (Tintime's AVS2ASF encodes to Advanced Profile only).
filler56789
23rd March 2013, 05:15
has there ever been made a GUI for this in the meantime?
Yes, BUT...
Someone was asking for a GUI for this encoder - here's one:
http://extranet.spitzinc.com/download/public/misc/VC123.zip <= 404 ERROR :(
This is a Visual Studio '08 project that uses MFC. It's basically AVI2ASF plus a big dumb dialog for all the parameters. This is a work in progress on the way to becoming a fairly narrow-purpose in-house tool, but others might find it useful for experimenting with the VC-1 encoder. I've left a pre-built executable in the Release folder for anyone without an IDE.
Read UsageNotes.txt
I'd be happy to entertain suggestions for improvement, but can't promise to implement anything . . .
Anyway, Nic's AVS2ASF is the least usable one. :( TinTime's mod is quite usable, however it doesn't support Simple and Main profiles, and NorthPole's builds are not available anymore. :(
FWIW,
TinTime
Registered User
Last Activity: 10th September 2011 23:28
NorthPole
Registered User
Last Activity: 6th September 2011 21:29
DragonZord
20th May 2013, 19:56
I've been trying to get a VC-1 encoder set up for VirtualDub. It's proving difficult.
Benwaggoner over on Doom10 suggested (http://doom10.org/index.php?topic=2554.msg11655#msg11655) the AVS2ASF solution, but all I can get is an Error -20. I have Expression Encoder v4 installed but no information on how to set-up AVS2ASF. I'd guess that it needs some DLLs from Expression Encoder? Is my version even compatible?
Is this an appropriate solution? If so, how do you set it up prior to encoding?
Unfortunately without stdin on any of the VC-1 encoders I'll have to use a temp file. VirtualDub's limited implementation of external encoders doesn't favour this approach, but I have it working, even if it makes a joke of the progress bar during the encode process.
Help very much appreciated. Thanks :-)
DragonZord
20th May 2013, 22:52
Why? Just curious.
Because not every use for digital video is related to leisure viewing. At home I like my videos in mp4(x264+aac). At work, we use wmv(wvc1) for compatibility reasons. The sort of videos we produce are used in presentations and sent around the world. WMV is about the only thing that isn't routinely answered with complaints, and given that we use Expression Encoder, our stuff has historically been in VC-1 which actually does a great job. WMVs from ffmpeg do get returned sometimes which is why I'm keen to keep an official VC-1 implementation.
Part two of the story is that I like VirtualDub. It's not perfect and personally I think the way they've implemented external encoders is limited, awkward and badly integrated, but that's off topic. I've nothing against moving to AviSynth one day, except that I find with text-based interfaces you often forget how to do things unless you use them all the time. And that's very inefficient. Case and point, I could use AviSynth very well in 2004. All I can do now is DirectShowInput().
So the crux is that it'd be very nice if when I've finished my video I can just make it into a wmv(wvc1) by File > Export. I am obviously putting too much time into this, but I figured that I'd have solved it by now and in the process published a step-by-step solution online in a nice concise forum post. Something the Internet is missing at the moment.
DragonZord
20th May 2013, 23:58
What do you mean by this? It reads like as if you already have solved it and already published such a post?
I didn't start here. I started about 10 days ago but couldn't find my old Doom9 login. And no it doesn't read like that: it's past conditional (http://www.edufind.com/english/grammar/if_conditional1.php).
In VirtualDub you probably could export your finished video in a lossless intermediate format and then import and encode that in Expression Encoder 4 SP2 with VC-1?
Yep, that's what I do. I figured the collective wit of mankind might be able to eliminate that step though.
benwaggoner
21st May 2013, 20:05
Yep, that's what I do. I figured the collective wit of mankind might be able to eliminate that step though.
EEv4 supports live encoding. So if you could hack VirtualDub to output a frame server as a DirectShow video source, then that could work.
However, I'm having trouble coming up with a problem that would be a good way to solve. EEv4 SP2's internal preprocessing is generally as good as VirtualDub, and it can also read AVS directly as long as the per-frame render time isn't so slow that the encoder times out.
In those cases, I'll just dump to a LAGS 4:2:0 AVI, and EE will take that perfectly and pass on the pixels to the encoder as is.
More broadly, what do you need really good VC-1 for in 2013? I see its value today most in its being broadly compatible with old Windows managed desktops in enterprise environments.
DragonZord
22nd May 2013, 10:29
...what do you need really good VC-1 for in 2013? I see its value today most in its being broadly compatible with old Windows managed desktops in enterprise environments.
Yep. I think I said that didn't I?
benwaggoner
22nd May 2013, 21:24
Yep. I think I said that didn't I?
Okay. Could you just use Expression Encoder, then? It's a very nice tool for doing encoding for typical enterprise scenarios, and certainly takes a lot less time per file than anything involving VirtualDub or a command line.
You get nice features like parallel encode of multiple bitrates of a single source, automatic settings configuration based on interlaced/progressive source, aspect ratio, and frame rate, very nice scaling algorithms, a nice audio normalization filter, etcetera.
For most enterprise scenarios I can think of, EEv4 will give pretty much the optimal possible output for VC-1. And since it has the final Enterprise SDK version, it has the quality and speed improvements from that which were never added to the Professional version.
DragonZord
4th June 2013, 12:23
Okay. Could you just use Expression Encoder, then? It's a very nice tool...
That's an option, yes. Personally I don't think it is a nice tool though. Just now it failed to encode something and now it won't import video anymore. Just another painful morning with this tool. I've deleted the user settings (etc) and re-installed and still it's broken. Joy.
Maybe I will focus my attention on wmcmd.vbs or see if I can bribe someone to add stdin. I'm not really bothered that it's out of date as it is at least reliable and can make decent videos.
benwaggoner
5th June 2013, 17:19
That's an option, yes. Personally I don't think it is a nice tool though. Just now it failed to encode something and now it won't import video anymore. Just another painful morning with this tool. I've deleted the user settings (etc) and re-installed and still it's broken. Joy.
SP2 installed?
Also, by default EE will use DXVA to decode supported formats, which could possibly cause issues with funky bitstreams. You can control which decoder does what in
Maybe I will focus my attention on wmcmd.vbs or see if I can bribe someone to add stdin. I'm not really bothered that it's out of date as it is at least reliable and can make decent videos.
If you're on at least Windows 7, you'll get the 8-way threading, 30% speedup improvement, and "swirly fix" from the final Enterprise release. Plus a better low bitrate DQuant. No Lookahead Rate Control, though. But on the whole that is probably as good or better as the existing Pro library for most scenarios.
An app that calls the OS Windows Media encoding functionality, using a PropertyBucket to control parameters, could be a lot easier to write. And getting stdin to work with DirectShow should be pretty trivial. You could probably prototype the whole thing in GraphEdit if you wanted.
DarrellS
30th June 2013, 22:38
Hey DragonZord, did you get anything working in Virtualdub?
I've got WMA-STD, WMA-LSL and WMA-PRO working with WMAEncode_0.2.9b but I cannot get 5.1 with any encoder I've tried. The cscript/wmcmd.vbs option isn't working for me at all with audio or video. Any help would be appreciated.
Here are the commands for WMA using wmaencode.exe...
{
"description": "VirtualDub external encoder profile collection",
"externalEncoders": {
"sets": {
"WMA-STD": {
"videoEncoder": "",
"audioEncoder": "WMA-STD",
"multiplexer": "",
"description": "wma",
"extension": "wma",
"processPartial": true,
"useOutputAsTemp": false
},
"WMA-PRO": {
"videoEncoder": "",
"audioEncoder": "WMA-PRO",
"multiplexer": "",
"description": "wma",
"extension": "wma",
"processPartial": false,
"useOutputAsTemp": false
},
"WMA-LSL": {
"videoEncoder": "",
"audioEncoder": "WMA-LSL",
"multiplexer": "",
"description": "wma",
"extension": "wma",
"processPartial": false,
"useOutputAsTemp": false
},
"profiles": {
"ASFmux": {
"name": "ASFmux",
"program": "ffmpeg-20130624-git\\ffmpeg.exe",
"commandArguments": "-i \"%(tempvideofile)\" -i \"%(tempaudiofile)\" -vcodec copy -acodec copy -f wmv -y \"%(outputname)\"",
"outputFilename": "%(outputname).audio",
"type": 2,
"inputFormat": 0,
"checkReturnCode": true,
"logStdout": true,
"logStderr": true,
"bypassCompression": false,
"predeleteOutputFile": true
},
"WMA-STD": {
"name": "WMA-STD",
"program": "WMAEncode.exe",
"commandArguments": "-i \"-\" -c std -m cbr \"%(tempaudiofile)\"",
"outputFilename": "%(outputname).wma",
"type": 1,
"inputFormat": 1,
"checkReturnCode": true,
"logStdout": true,
"logStderr": true,
"bypassCompression": true,
"predeleteOutputFile": true
},
"WMA-PRO": {
"name": "WMA-PRO",
"program": "WMAEncode.exe",
"commandArguments": "-i \"-\" -c pro -m cbr \"%(tempaudiofile)\"",
"outputFilename": "%(outputname).wma",
"type": 1,
"inputFormat": 1,
"checkReturnCode": true,
"logStdout": true,
"logStderr": true,
"bypassCompression": true,
"predeleteOutputFile": true
},
"WMA-LSL": {
"name": "WMA-LSL",
"program": "WMAEncode.exe",
"commandArguments": "-i \"-\" -c lsl \"%(tempaudiofile)\"",
"outputFilename": "%(outputname).wma",
"type": 1,
"inputFormat": 1,
"checkReturnCode": true,
"logStdout": true,
"logStderr": true,
"bypassCompression": true,
"predeleteOutputFile": true
},
}
}
}
}
Not sure if ASFmux will work since I can't get any wmv encoders working. ffmpeg or wmcmd.
raffriff42
1st July 2013, 20:14
>>In VirtualDub you probably could export your finished video in a
>>lossless intermediate format and then import and encode
>>that in Expression Encoder 4 SP2 with VC-1?
Yep, that's what I do. I figured the collective wit of mankind might be able to eliminate that step though.You want to eliminate the intermediate file, or eliminate VirtualDub entirely? To eliminate VirtualDub, skip to step 4 Frame serve from VirtualDub.
Save signpost as .avi, not .vdr as documented.
Do not open signpost .avi in MS Expression 4.
Create Avisynth wrapper script.
Open script in MS Expression 4.
Encode. Share and enjoy. :)Tested with VirtualDub 1.10.3, Avisynth 2.6, MS Expression Encoder 4 SP 1
DarrellS
2nd July 2013, 18:16
I think the idea is to do it all in Virtualdub with the external encoder feature using command line encoders and multiplexer without having to use two or three other programs to do the job.
ffmpeg supports wmv1 and wmv2 but does not support wmv3 or vc-1 encoding.
cmdvbs doesn't support raw input from Virtualdub so we can't do audio or video
asfbin will not mux the wmv2 and wma2 audio from Virtualdub
ffmpeg will mux the files but the files won't play in wmp or mpc-hc (the files will seek but not play). They do play in VLC player.
If the guy that created wmaenc.exe would've created a wmvenc.exe then we'd be in business since we are able to create windows media audio files with his command line encoder. We just can't create 5.1 audio files (not sure why since it uses the pro codec).
I have no desire to encode wmv for myself but I am interested in getting as many command line encoders as possible working with the external encoder feature of Virtualdub. It looked like DragonZord was really close but as long as the cmdvbs option doesn't support stdin then I don't think it's possible and I don't think anyone is going to create a wmv command line encoder anytime soon (or ever). ffmpeg could implement a wmv9 encoder and make it easy for everyone since MS released wwv9vcm years ago but I guess they're afraid of a lawsuit. I know someone was working on a vc1 encoder for ffmpeg years ago but the project was dropped.
filler56789
11th October 2014, 15:54
I was bored, so I archived TinTime's mod of AVS2ASF @ GitHub:
https://github.com/filler56789/AVS2ASF-2
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.