Log in

View Full Version : x264 Command Line Won't Open AVS Input


kalorx
16th July 2005, 14:39
Hi all. For some reason, x264 275 won't open my "input.avs" AviSynth file. ...at least, that's what I think is happening. It gives me this error when I run the x264 BAT file:


avis [error]: unsupported input format (DUB )
could not open input file '\input.avs'


This is what's contained in my AVS file:


AviSource("d:\rips1\Huffy.00.avi", "d:\rips1\Huffy.01.avi", "d:\rips1\Huffy.02.avi", "d:\rips1\Huffy.03.avi", "d:\rips1\Huffy.04.avi")


The same happened even when I was trying to open one AVI.

And before you ask, I first tried using a VFAPI AVI file, and then a Huffyuv AVI file. It won't open either. I have a feeling it's not going to open anything. Both AVIs were of the most modern AVI file format with no audio, 23.976fps, nothing fancy.

I would like to skip the AVI file format post-encode if at all possible. I can do this with Graphedit, but I've only figured out how to output to a matroska file. While for XviD and DivX that isn't a problem, it may be a problem for AVC/H.264; I'm not sure if the MKV container can handle all of AVC/H.264's features. (In fact, I'm not even wholly sure it can support all of the other MPEG-4-based codecs' features, but I'm pretty sure it does.)

Editing the actual video and audio streams of an output file is something I do quite rarely, so that's not a problem. Of course, I could edit MKV files if VirtualDubMod didn't output cout-of-date matroska files...

Any help would be greatly appreciated.

Thanks,

Robert Aronson (KalorX)

IgorC
16th July 2005, 15:00
*.AVS input works here fine with rev275

Doom9
16th July 2005, 15:03
the problem is the script, I'm quite sure it has the wrong colorspace. Try adding ConvertToYV12() to the script.

kalorx
16th July 2005, 15:16
But I'd like my output to be RGB24, and conversion isn't lossless. Is there a way around converting to YV12? I've always much preferred RGB over other formats... are the Y-formats higher quality or something? I know that PAL uses YUV, but that doesn't tell me anything.

Just about everything and everyone tells me to use the various Y-formats -- even the AviSynth manual, now that I look more deeply into it. It speaks as if RGB is of the devil and I should never use it.

Then again, I'm not even overly sure what color format the source AVI is in; I'm guessing it's in RGB, seeing as I didn't convert to YUV when compressing with HuffYUV.

EDIT: I added "ConvertToYV12()" after the AviSource line (as it shows in the AviSynth manual) just to see if it would work. It didn't. I still get the same error message.

Thanks,

Robert Aronson (KalorX)

Doom9
16th July 2005, 15:25
well, you cannot force the output to be in the color format you want... it'll be in the color format the codec supports.

I think the default color space of HuffyUV is YUV2 and iirc the conversion between YUV2 and YV12 is lossless, but you might want to read up on this in the AviSynth forum.

And why are you using HuffyUV as intermediate format?

kalorx
16th July 2005, 15:27
I'm using HuffUV as the intermediate format because it wouldn't open my VFAPI AVI. Maybe I should try that again.

My source is DVD, BTW. Isn't RGB supposed to be used when DVD is the source?

EDIT: And I wouldn't have to do any of this at all if I could just find a way to use VirtualDub or Graphedit to output raw H264 or H264 MP4 video!

Doom9
16th July 2005, 16:00
Maybe I should try that again.That won't do you any good... VFAPI is RGB.

Isn't RGB supposed to be used when DVD is the source?No.. it isn't RGB and you should never use that color space when converting DVDs. Why are you using VFAPI? What kind of processing are you doing that you cannot do with AviSynth?

And you can forget about raw or MP4 output from VirtualDubxyz..

kalorx
16th July 2005, 16:43
I'm trying to combine what I do know with what I don't know in order to learn as little new as possible and maximize output.

As for why VFAPI, I ran a DVD2AVI D2V project through TMPG for IVTC and concurrent deinterlacing, saved the results as a TPR (TMPG project), and then converted the TPR to a frameserver AVI using VFAPI.

This is an excellent method of gaining an AVI for use with VirtualDub and any XviD, DivX, or HuffUV compression thereafter.

However, I'm trying to learn ways around VirtualDub so I encode to raw video files. MPEG-4 codecs these days is killing AVI's usefulness.

God knows no one is replying to my question in the VirtualDub forum about how to use anything to output raw video; in that specific post I wanted to know if VirtualDub could somehow do it, but not only will no one give an answer one way or another, but they won't even tell me an alternative. At least you've answered my question now -- but I still need an alternative...

EDIT: I'd just like to add that I posted the second paragraph if this post to my online blog in an effort to prove to the world that I have long graduated from the mundane world into the world of pure, unadulterated nerdity.

Manao
16th July 2005, 16:44
YUY2 to YV12 isn't lossless, but is mandatory since x264 encodes in the YV12 colorspace.

kalorx : open your script ( with the converttoyv12() ) in virtualdub, to check if the script is working. Then, still in VDub, check the colorspace used ( file -> file information, it must be YV12, else x264 won't work )

kalorx
16th July 2005, 16:51
The script opens in VDub just fine.

The video is RGB24.

EDIT: I had to remove ConvertToYV12(), though. VDub didn't like that.

Doom9
16th July 2005, 17:15
EDIT: I had to remove ConvertToYV12(), though. VDub didn't like that.You need a YV12 codec or VirtualDub won't open. Here's one that will do: http://forum.doom9.org/showthread.php?s=&threadid=56972

Now that you've finally said what you are trying to do, scrap VFAPI, scrap TMPG and scrap AVI. Here's the way to do it: IVTC in AviSynth using Decomb. Here's the guide: http://www.doom9.org/decomb.htm

Or a much quicker way: Use MeGUI. It'll create your DGIndex project, applies force film if applicable, creates your AviSynth script for you, adds the appropriate lines for resizing, IVTC, etc, and encodes the whole thing.. not only using x264 and not only supporting the MP4 container, but pretty much anything you need. Here's the link for MeGUI: http://forum.doom9.org/showthread.php?t=96032

This solution is a lot quicker, better quality (Decomb is the best choice for IVTC, and you don't have to suffer through any lossy RGB conversions). VFAPI is outdated and if there's no must critera for it (there's not in your case), you should not use it anymore.

kalorx
16th July 2005, 17:20
Wow... this... um... changes everything. I'm going to have to relearn how to do all this almost from scratch... um... I suppose I'll get on it right away...

I'll let you know the results.

EDIT: VDub, even after installing Helix, tells me that ConvertToYV12() isn't a function. Possible really dumb question: am I supposed to put something in the paranthesis?

EDIT: Which solution is higher quality? The slow or fast one?

Doom9
16th July 2005, 17:41
The slow or fast one?The fast one (AviSynth). Why? Because you have no lossy colorspace conversions, and because Decomb is better at IVTC than TMPG.

This is a fully working AviSynth script using converttoyv12.. it works here so if the syntax doesn't work for you, something is wrong with your avisynth installation. Are you using an old AviSynth version that doesn't support that function?

mpeg2source("D:\DVDs\DVDVolume\VIDEO_TS\residentevil.d2v")
crop(2,76,-2,-78)
LanczosResize(640,272)
ConvertToYV12()

kalorx
16th July 2005, 18:04
I don't think you understood my question. You offered me two alternatives, a slow one using just Decomb, and a fast one using MeGUI. Which one offers higher quality?

I'm using AviSynth 2.08 or 2.0.8, whatever the latest is.

On another note, when I preview my video in DGIndex, it doesn't tell me the percentage my frame types; it only says "FILM" and never changes. Does that mean 100%? If yes, they should have written that.

EDIT: On yet another note, your guides are dramatically outdated. Where am I supposed to get this "mpeg2dec.dll" file? It doesn't come with DGIndex.

EDIT: Whoa! I can't process WAVs independently with DGIndex! How am I supposed to account for audio delay, or does it do that automatically? Geez. I hate change.

EDIT: And where am I supposed to get the Lanczos resize software? Are mpeg2dec and lanczos integrated with the latest version of AviSynth or something?

Doom9
16th July 2005, 18:38
I'm using AviSynth 2.08 or 2.0.8, whatever the latest is.The latest is 2.55...

The process MeGUI uses is the same as when you do it manually.

A lot of your questions could've answered with a little more reading up so I'm stopping here now giving you some time to read up. Change does require a certain amount of learning.

kalorx
16th July 2005, 20:33
Okay, thanks.

Just one last question: does DGIndex actually adjust for the audio delay in automatically processed WAVs? I'd like to cut out BeSweet if I can.

Doom9
16th July 2005, 20:58
and how do you encode audio then if not with besweet? DGIndex doesn't have delay correction.. that's a job for an audio encoder and Besweet is the tool for the task.

kalorx
16th July 2005, 21:18
I encode WAVs using the command line tools oggenc, faac, or lame. I was just hoping to use as few tools as possible. Thanks for the info!

Doom9
16th July 2005, 21:24
well.. besweet can encode to mp3 using the lame dlls, encode to ogg using the vorbis library or aac using the nero aac encoder (which offers HE AAC that faac doesn't offer). And it takes AC3 as input so there's no need to waste space and time first converting the audio to an uncompressed format.. it's like your Huffyuv episode.. a step you don't need.

kalorx
16th July 2005, 21:37
Wow... um... you're absolutely right... I'm so freaking out of touch. I first learned how to backup DVDs many years ago (since not long after their inception), and I've barely changed my methods since. I suppose we all have to grow up sometime...

EDIT: Wait a minute. I can't find AAC functionality anywhere in BeSweet's GUI 0.6 b61.

Doom9
16th July 2005, 21:53
use BeLight as GUI for BeSweet: http://forum.doom9.org/showthread.php?t=85566 (I know, my guides need updating but it's hard to write new guides when you're developing a software and have to post news and run a forum every day)