Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > New and alternative video codecs

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd September 2007, 00:01   #201  |  Link
Rash
Registered User
 
Rash's Avatar
 
Join Date: Aug 2002
Posts: 403
No, Fox, you are cropping the black bars that are "burned in" the video stream (that are encoded in the source video). So you are not losing effective pixels (or image pixels), you are simply losing black pictures. He advised you to do so in order to help the codec encode only the image itself, and no black bars with it.

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

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

-a_mode 1 (bitrate OK)

Code:
PS D:\home\rash\Development\Eng test\wav> cscript "C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs" -input e
ng_test.wav -output eng_test.wma -a_codec WMA9PRO -a_mode 1 -a_setting 384_48_6_24
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.

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


======== Begin Pass1 ========
Read: 201.5s (97.5%)    Elapsed: 00:01:14    Left: 00:00:02   [2.72x]

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

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

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

Overall:
        Encoding time:          83 seconds
        Average bit rate:       384000 bps
        File size:              10018183 bytes
        File duration:          206.955 seconds
-a_mode 4 (bitrate not OK)

Code:
PS D:\home\rash\Development\Eng test\wav> cscript "C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs" -input e
ng_test.wav -output eng_test.wma -a_codec WMA9PRO -a_mode 4 -a_setting 384_48_6_24
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.

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


======== Begin Pass1 ========
Read: 203.8s (98.6%)    Elapsed: 00:00:34    Left: 00:00:00   [5.99x]

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

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

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

Overall:
        Encoding time:          119 seconds
        Average bit rate:       565490 bps
        File size:              14664574 bytes
        File duration:          207.093 seconds
I'm using Windows Media Encoder x64 on Windows Vista Ultimate x64.

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

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

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

Thank you ver much for your help.

Last edited by Rash; 2nd September 2007 at 00:08.
Rash is offline   Reply With Quote
Old 2nd September 2007, 01:35   #202  |  Link
FoxRacR17
Registered User
 
Join Date: Jan 2007
Posts: 66
Quote:
Originally Posted by Rash View Post
No, Fox, you are cropping the black bars that are "burned in" the video stream (that are encoded in the source video). So you are not losing effective pixels (or image pixels), you are simply losing black pictures. He advised you to do so in order to help the codec encode only the image itself, and no black bars with it.

Try creating an AVS script with a tool, such as MeGUI, that will help you crop the black bars properly.
Thanks for the reply Rash, i'll try out MeGUI when i get home later tonight to see how to crop out the black bars.

Can anyone tell me how to figure out what resolution i should use depending on what the aspect ratio of the source is? Is there some formula or something?
FoxRacR17 is offline   Reply With Quote
Old 2nd September 2007, 08:38   #203  |  Link
zambelli
Doom9ing since 2001
 
zambelli's Avatar
 
Join Date: Oct 2001
Location: Seattle, WA, USA
Posts: 2,002
Quote:
Originally Posted by FoxRacR17 View Post
Can anyone tell me how to figure out what resolution i should use depending on what the aspect ratio of the source is? Is there some formula or something?
Well, yeah, the aspect ratio is the aspect ratio of width over height. If you know the aspect ratio of the movie (i.e. 2.35:1), take the target width and divide it by the AR, then round to nearest multiple of 16. So if you're targetting 1280 pixels wide, that's 1280 / 2.35 = 544.68. The nearest multiple of 16 is 544.

Most of the time you can just figure this out practically by loading the .avs in VirtualDub and using the Crop function of the Null transform filter to figure out how far the black bars go.
zambelli is offline   Reply With Quote
Old 2nd September 2007, 16:09   #204  |  Link
FoxRacR17
Registered User
 
Join Date: Jan 2007
Posts: 66
Quote:
Originally Posted by zambelli View Post
Well, yeah, the aspect ratio is the aspect ratio of width over height. If you know the aspect ratio of the movie (i.e. 2.35:1), take the target width and divide it by the AR, then round to nearest multiple of 16. So if you're targetting 1280 pixels wide, that's 1280 / 2.35 = 544.68. The nearest multiple of 16 is 544.

Most of the time you can just figure this out practically by loading the .avs in VirtualDub and using the Crop function of the Null transform filter to figure out how far the black bars go.
Thanks zambelli, for all your help! I successfully cropped off the black bars on top and bottom using megui thanks to the hint that Rash gave me, and i resized the video to 1280x528 since the video is 2.40:1 according the case. Thanks guys, i'm getting so close i can taste it! lol.

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

Last edited by FoxRacR17; 2nd September 2007 at 22:30.
FoxRacR17 is offline   Reply With Quote
Old 3rd September 2007, 00:41   #205  |  Link
sportcenter
Registered User
 
Join Date: Apr 2007
Location: The North Pole
Posts: 43
Quote:
Originally Posted by FoxRacR17 View Post
Thanks zambelli, for all your help! I successfully cropped off the black bars on top and bottom using megui thanks to the hint that Rash gave me, and i resized the video to 1280x528 since the video is 2.40:1 according the case. Thanks guys, i'm getting so close i can taste it! lol.

However i still have a problem when i try to encode with 2 pass peak vbr. I have now tried it with two different video files and its the same result, video is stuttering or acting like it is two video files overlapped and playing off sync by like half a second.
what kind of equipment are you encoding on?...b/c the 1-pass insane .vbs i have been using has given almost identical results to 2-pass "best" .vbs scripts i have done...
sportcenter is offline   Reply With Quote
Old 3rd September 2007, 03:46   #206  |  Link
FoxRacR17
Registered User
 
Join Date: Jan 2007
Posts: 66
Quote:
Originally Posted by sportcenter View Post
what kind of equipment are you encoding on?...b/c the 1-pass insane .vbs i have been using has given almost identical results to 2-pass "best" .vbs scripts i have done...
I'm running an AMD Athlon X2 2.5Ghz with 3 Gigs of DDR400 memory. Doing a 1pass CBR with "best" setting it takes around 16-18 hours to encode.
FoxRacR17 is offline   Reply With Quote
Old 3rd September 2007, 05:40   #207  |  Link
sportcenter
Registered User
 
Join Date: Apr 2007
Location: The North Pole
Posts: 43
Quote:
Originally Posted by FoxRacR17 View Post
I'm running an AMD Athlon X2 2.5Ghz with 3 Gigs of DDR400 memory. Doing a 1pass CBR with "best" setting it takes around 16-18 hours to encode.
and do you get "stuttering" w/ 1 pass?
sportcenter is offline   Reply With Quote
Old 3rd September 2007, 08:46   #208  |  Link
FoxRacR17
Registered User
 
Join Date: Jan 2007
Posts: 66
no, its only when i try 2 pass peak VBR. I can do 1 and 2 pass CBR and it turns out great. I have uploaded a sample of what i'm talking about, it starts out fine, but then after around 10 seconds it starts to mess out, check it out:
http://www.megaupload.com/?d=XLJCU1W8

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

and this is my command line:
cmd /k cscript.exe "C:\Program Files\Windows Media Components\Encoder\wmcmd.vbs" -input "E:\video.avs" -output "E:\final video.wmv" -v_codec WVC1 -videoonly -v_mode 4 -v_preset better -v_bitrate 8000000 -V_peakbitrate 12000000 -v_keydist 30 -v_buffer 60000 -v_peakbuffer 60000
FoxRacR17 is offline   Reply With Quote
Old 3rd September 2007, 09:14   #209  |  Link
sportcenter
Registered User
 
Join Date: Apr 2007
Location: The North Pole
Posts: 43
Quote:
Originally Posted by FoxRacR17 View Post
no, its only when i try 2 pass peak VBR. I can do 1 and 2 pass CBR and it turns out great. I have uploaded a sample of what i'm talking about, it starts out fine, but then after around 10 seconds it starts to mess out, check it out:
http://www.megaupload.com/?d=XLJCU1W8

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

and this is my command line:
cmd /k cscript.exe "C:\Program Files\Windows Media Components\Encoder\wmcmd.vbs" -input "E:\video.avs" -output "E:\final video.wmv" -v_codec WVC1 -videoonly -v_mode 4 -v_preset better -v_bitrate 8000000 -v_peakbitrate 12000000 -v_peakbuffer 10000 -v_mmatch 0

try that script...

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

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

Last edited by sportcenter; 3rd September 2007 at 09:51.
sportcenter is offline   Reply With Quote
Old 3rd September 2007, 16:29   #210  |  Link
sportcenter
Registered User
 
Join Date: Apr 2007
Location: The North Pole
Posts: 43
what about this...never had this problem...

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


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

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

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

and then closes...?....
sportcenter is offline   Reply With Quote
Old 3rd September 2007, 16:49   #211  |  Link
Rash
Registered User
 
Rash's Avatar
 
Join Date: Aug 2002
Posts: 403
I'm glad it worked Fox.

Does anybody have any suggestions as how to delay the audio? Please? Look at my first post on this page. Thank you!
Rash is offline   Reply With Quote
Old 3rd September 2007, 17:16   #212  |  Link
FoxRacR17
Registered User
 
Join Date: Jan 2007
Posts: 66
Quote:
Originally Posted by Rash View Post
I'm glad it worked Fox.

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

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

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

Quote:
Originally Posted by sportcenter View Post
what about this...never had this problem...

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


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

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

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

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

Last edited by FoxRacR17; 3rd September 2007 at 17:22.
FoxRacR17 is offline   Reply With Quote
Old 3rd September 2007, 18:14   #213  |  Link
FoxRacR17
Registered User
 
Join Date: Jan 2007
Posts: 66
Well i tried that command line sportcenter and it turned out exactly the same. It looks good but once it gets to that box thing it starts messing up.
FoxRacR17 is offline   Reply With Quote
Old 4th September 2007, 06:50   #214  |  Link
sportcenter
Registered User
 
Join Date: Apr 2007
Location: The North Pole
Posts: 43
Quote:
Originally Posted by FoxRacR17 View Post
Well i tried that command line sportcenter and it turned out exactly the same. It looks good but once it gets to that box thing it starts messing up.
are you doing anything else on your pc (hdd) when it is encoding?....
sportcenter is offline   Reply With Quote
Old 5th September 2007, 00:31   #215  |  Link
acribb
Registered User
 
Join Date: Aug 2007
Posts: 10
I too am having problems with a VBR peak bitrate encode. I have tried twice now with no luck. Once with a vpeakbuffer of 5000 and one try with a vpeakbuffer of 60000. No dice. I get what seem to be the same results as FoxRacr17.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

Thanks..
acribb is offline   Reply With Quote
Old 5th September 2007, 00:46   #216  |  Link
sportcenter
Registered User
 
Join Date: Apr 2007
Location: The North Pole
Posts: 43
do only video encoding first....then audio...then mux together w/ windows media encoder

try this...

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

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

also why are you guys not using

ConverttoYV12()
Asharp(1,3)

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

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

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

Q6600
4GB RAM
74GB Raptor
sportcenter is offline   Reply With Quote
Old 5th September 2007, 02:54   #217  |  Link
FoxRacR17
Registered User
 
Join Date: Jan 2007
Posts: 66
Whenever i add Asharp(1,3) my avs. file will not play and WME will not encode the movie. Any ideas why?
FoxRacR17 is offline   Reply With Quote
Old 5th September 2007, 03:04   #218  |  Link
FoxRacR17
Registered User
 
Join Date: Jan 2007
Posts: 66
Quote:
Originally Posted by FoxRacR17 View Post
Whenever i add Asharp(1,3) my avs. file will not play and WME will not encode the movie. Any ideas why?
Nevermind, i downloaded the asharp.dll and put it in the plugins folder and now it works. Out of curiosity, what does those two filters do exactly?
FoxRacR17 is offline   Reply With Quote
Old 5th September 2007, 03:20   #219  |  Link
sportcenter
Registered User
 
Join Date: Apr 2007
Location: The North Pole
Posts: 43
Quote:
Originally Posted by FoxRacR17 View Post
Nevermind, i downloaded the asharp.dll and put it in the plugins folder and now it works. Out of curiosity, what does those two filters do exactly?
Motion Adaptive Edge Sharpening....it works wonders

*thanks Crowley
sportcenter is offline   Reply With Quote
Old 6th September 2007, 17:25   #220  |  Link
Rash
Registered User
 
Rash's Avatar
 
Join Date: Aug 2002
Posts: 403
I encoded some videos here though I think my VC-1 encodes were too blurred. Here is my cmd

Code:
"C:\Windows\SysWOW64\cscript.exe" "C:\Program Files (x86)\Windows Media Components\Encoder\wmcmd.vbs" -input "ignoringu.avs" -output "video\ignoringu.wmv" -videoonly -v_codec WVC1 -v_mode 3 -v_preproc 0 -v_bitrate 2560000 -v_buffer 10000 -v_performance 100 -v_compopt 1 -v_dquantstrength 3 -v_percopt 3 -v_denoise 0 -v_median 0 -v_codedwidth 720 -v_codedheight 480  -pixelratio 40 33 -log ignoring.log
Maybe I should not use dquantstrength or percopt? I'm going to try Zambelli's "insane" preset today.

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

Code:
D:\Home\Rash\Development\Pitty IgnorinU\audio>"C:\Windows\SysWOW64\cscript.exe"
"C:\Program Files (x86)\Windows Media Components\Encoder\wmcmd.vbs" -input "igno
ringu synced.wav" -output "ignoringu.wma" -a_codec WMA9PRO -a_mode 3 -a_setting
384_48_6_24
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.

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


======== Begin Pass1 ========
Read: 265.8s (96.7%)    Elapsed: 00:00:40    Left: 00:00:01   [6.64x]

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

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

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

Overall:
        Encoding time:          86 seconds
        Average bit rate:       1030045 bps
        File size:              35462651 bytes
        File duration:          275.071 seconds
1Mbps is too much for audio. I'm sure WMA doesn't need all that to be transparent. The least I can achieve is 430 kbps for 128_48_6_24, but I think 430 is still too much. (Windows Vista x64, WME9 32-bits, latest wmcmd.vbs).

Thank you all.

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

Last edited by Rash; 6th September 2007 at 17:46.
Rash is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:18.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.