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 > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 17th May 2009, 02:11   #1  |  Link
creedo
Registered User
 
Join Date: Dec 2007
Posts: 41
Garbled image when I open an ASF in VirtualdubMod w/avisynth

I have an ASF captured from a live stream. It can play in media player classic, but with a weird hitch: I must seek somewhere in the file. Otherwise I just see the first frame. After seeking it plays fine.

My avisynth script is pretty simple:

directshowsource("C:\final.asf")
crop(2,0,0,0)

The crop is because my width is not divisible by 4.

Anyway, the file appears to load without error but the visuals are garbled. The image seems skewed diagonally quite a bit and the colors are funky. I can seek it within the program and probably could convert it to AVI/MKV also, it'd just look weird.

Any guesses on how I can fix this? Or a different program for converting? I tried super, wmrecorder, and one or two other programs... but they all seem to give errors or hang.
creedo is offline   Reply With Quote
Old 18th May 2009, 08:35   #2  |  Link
creedo
Registered User
 
Join Date: Dec 2007
Posts: 41
Desperation bump.

I just need to convert an ASF to another format.

Need a program that actually works instead of choking and crashing or producing garbled output.
creedo is offline   Reply With Quote
Old 18th May 2009, 13:23   #3  |  Link
JohannesL
AviSynth/x264 user
 
JohannesL's Avatar
 
Join Date: Jan 2009
Posts: 149
Did you try encoding the avs with x264.exe or MEncoder?
__________________
archlinux
JohannesL is offline   Reply With Quote
Old 18th May 2009, 17:29   #4  |  Link
creedo
Registered User
 
Join Date: Dec 2007
Posts: 41
Quote:
Originally Posted by JohannesL View Post
Did you try encoding the avs with x264.exe or MEncoder?
Hello...I just tried it in Megui - same issue. The preview window shows a skewed, distorted image. Maybe I'm in the wrong subforum? Is there something I can put into my script that might affect this? Force a certain color space or something? Or is it just that we're dealing with a streamed file and the index is bad? I am stumped.

By the way thanks for giving it a try... hoping you have some other ideas.
creedo is offline   Reply With Quote
Old 18th May 2009, 23:10   #5  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
Are you using 2.5.8, I added some code to help with some non-standard memory packing, the default assumes 32 bit alignment.

Also try different pixel types, this may change the way the codec packs it's data and allow you access to the image data uncorrupted.
Code:
directshowsource("C:\final.asf", pixel_type="RGB") # Also try "YUY2"
What are the actual image dimensions of your final.asf?

How did you generate the file?

Can you upload a similar short sample .asf file (10 or so frames)?
IanB is offline   Reply With Quote
Old 19th May 2009, 14:33   #6  |  Link
creedo
Registered User
 
Join Date: Dec 2007
Posts: 41
Howdy IanB - thanks so much, directshowsource("C:\final.asf", pixel_type="RGB") did the trick.

VirtualdubMod's currently cranking out the converted file as we speak. Hopefully no further glitches.
If you were curious, the asf was captured from a live stream by using WM Recorder, res. was 426x240.

Keep up the good work on avisynth
creedo is offline   Reply With Quote
Old 19th May 2009, 16:09   #7  |  Link
creedo
Registered User
 
Join Date: Dec 2007
Posts: 41
Well, I have a whole new problem now but I'm hoping you might have some suggestions.

I'm a noob at this but I guess the issue is that the ASF has indexing issues or something? Encoding process seemed to hang (64% done but 0 frames being rendered)
and video seems to skip around, jumping ahead a few seconds here and there. It looks good at the keyframes (I guess every 10 seconds) but in between them, it gets blocky and weird looking. Audio seems to lag behind as well... hard to tell if it's synching up or not because the video seems to be skipping and the visuals get so blocky I can't tell what's going on.

Will I get this with other programs too? Is there something I need to do to the ASF before converting it?
creedo is offline   Reply With Quote
Old 19th May 2009, 19:16   #8  |  Link
JohannesL
AviSynth/x264 user
 
JohannesL's Avatar
 
Join Date: Jan 2009
Posts: 149
DirectShowSource is known for being unreliable with seeking. Try loading the asf with a different source filter?
__________________
archlinux
JohannesL is offline   Reply With Quote
Old 19th May 2009, 21:08   #9  |  Link
creedo
Registered User
 
Join Date: Dec 2007
Posts: 41
I could try that, but what other filter will work? The only other filters I know of deal with AVI files...?

Could it be I need convertfps, it's not exactly 25.00 FPS maybe? I don't know about asf files but maybe they're variable framerate.

I went back to the original file and realized it seems to have the same skipping issues. I'd like to think the file is ok and it's just a playback or processing issue.
But maybe the original file is junk. I am gonna try researching other filters and then see if I can post a sample clip.
creedo is offline   Reply With Quote
Old 19th May 2009, 21:18   #10  |  Link
setarip_old
Registered User
 
setarip_old's Avatar
 
Join Date: Aug 2005
Posts: 16,267
Hi!

Please load the capture .ASF file into GSpot and post a screencapture back here...
setarip_old is offline   Reply With Quote
Old 20th May 2009, 04:07   #11  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
The DirectShow splitter for .ASF/WMV is pretty antagonistic about doing frame exact seeking. Avisynth will just reflect the frame access pattern of the host application to DirectShowSource(), thus if the encoder asks for frames 0, 3, 1, 2, 6, 4, 5, 9, ... without help you are going to be screwed.

The most reliable solution is to linearly transcode the .ASF stream to an intermediate lossless format workfile like huffyuv and encode from that.

If this is unpalatable then some tricks using a hugh cache, abusing the ChangeFPS() filter and setting the seekzero option may help.
Code:
SetMemoryMax(512) # big cache
DirectShowSource(..., seekzero=true)
ChangeFPS (Last, Last, True) # Give 10 frames random seek protection.
...
IanB is offline   Reply With Quote
Old 20th May 2009, 20:30   #12  |  Link
creedo
Registered User
 
Join Date: Dec 2007
Posts: 41
setarip: G-spot recognizes it's an ASF but has no useful info... most of the fields are blank/NA and it just says WMV as the audio and video codecs.

Ian: As I look closer at the file, it appears it's just borked. The missed frames are not just failing to display, they simply don't exist. I guess some weakness of the capture method or the internet stream. On top of that, whenever there is a scene change there are giant swimming macroblocks and it's unwatchable until there's a keyframe.

For fun I tried encoding to huffyuv. I had to settle for just a portion of it as I'm low on disk space. The bottom 1/3rd of the video was fine and the upper 2/3rds was colorful static. MPC crashed when I tried to seek.

So, I think I can officially give up on this file... it's a case of garbage in, garbage out.

I do appreciate you taking a crack at though. At least I'll know what to do if I ever end up with an ASF worth saving and converting.

Maybe you have suggestions on a better way to capture mms:// streams that might have avoided this? I got the impression that some programs want to capture as wmv, some as asf... and one guy said he could capture with the same program in mpeg2 but I couldn't find an option for it. Would that have been better?
creedo is offline   Reply With Quote
Reply

Tags
asf, avisynth, convert, garbled, virtualdubmod

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 22:24.


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