Log in

View Full Version : Executing Avisynth scripts without re-encoding?


Marin85
27th October 2011, 11:56
The title might sound slightly misleading, so let me explain what I mean. I have a 500 MB H.264 sample for which I would like to do some basic manipulations via Avisynth like cropping or color adjustment. However, I do not want to do any further manipulations to the video in the sense of x264 lossy compression. Here are the problems I am facing:

1) Lossless encoding with x264 makes a 3 GB file out of my 500 MB sample, no matter if I use ultrafast or placebo preset!

2) Using the "copy codec" of Avidemux 2.5 to create MKV does not work for me because the software outputs the infamous error about keyframe, even though the first frame of my sample is in fact an I-frame!

3) This bug appears to have been fixed in Avidemux 2.6 (which is still in testing), but trying to connect to the avs proxy results in a runtime error every time. So I am not able to use my Avisynth script with Avidemux 2.6 at all at the current stage of development (which is fine by me since v2.6 is still in the testing stage).

4) Saving to AVI with VirtualDub(mod), Avidemux or AvsP(mod) produces an unusable file, let alone the fact that H.264 should not be really put in AVI, but this is a different matter.

So, what are my options?

I was thinking of something like a dummy profile for MeGUI, but I am not even sure if that makes any sense. I guess it cant get any dummier than lossless encoding...

mbcd
27th October 2011, 12:47
You cant do such things without full recode of your video.

For Colorcorrection it is absolutely a mustbe, even for cropping.
There are no things you can do without reencoding.

Even only correcting some parts/scenes of your video is not really possible.
You dont have a chance, you must fully reencode the file. Everything else will end up in problems.

Lossy first decompresses the video and saves the decompressed quallity, so you cant get the filesize back when using lossless.
Lossless results always in a bigger filesize.

Groucho2004
27th October 2011, 12:51
Your thread title reads "Executing Avisynth scripts without re-encoding?". That's certainly possible, you just open your script in a media player.

Otherwise, there is no alternative to re-encoding, lossless or not.

hello_hello
27th October 2011, 13:08
If you want to run filters on the video then you're going to have to re-encode it so I'm not sure what you're asking there. I guess you'll just have to find a quality you're happy with, without the file size getting out of control. A CRf value of around 18 should be pretty transparent.
If you're only wanting to apply the filters on playback and not re-encode then you should be able to create your script and simply open it with Media Player Classic Home Cinema, assuming it's not too CPU intensive to play in real time.

The only way I can think of to create a new file (AVI) without re-encoding and also while applying filters to it, is to create your script, then wrap that script into an AVI. It's kind of like having a dummy AVI file which applies the script and points to the original video.

Do you have ffdshow installed? If so, look for makeAVIS in ffdshow's start menu folder. It'll wrap your script into an AVI. The new AVI can then be opened with VirtualDubMod (or any program which can play AVIs), you can add audio streams as usual, even edit the video and save the output using Direct Stream Copy (depending on the filters used in the script, I think). You'll still end up with an AVI which is only the size of the audio stream, plus a few extra MBs. If course you can also re-encode the new AVI using any GUI which can open them. Even Avidemux should be able to re-encode the video that way as it won't be decoding it itself.

I don't use makeAVIS much myself. I use AVS2AVI (http://hmage.net/files.html) It's just a little utility which wraps scripts into an AVI via the Explorer right click menu.

Any of that any help?