Log in

View Full Version : Avisynth, directshow, mencoder and mp4/h264/aac


malouf
23rd June 2008, 10:47
Hi,

I have a problem that I can't resolve, which is pretty complicated :
I'm developping an web interface that allows my coworkers to encode videos in a simple manner. It runs on apache/windows 2000, is developped in C (cygwin).

It takes videos encoded in .mp4, x264 and aac (encoded with mencoder in .avi, remuxed in .mp4 with mp4box). The videos plays perfectly fine in vlc.

My web interface launches an encoding script, that itselfs launches mencoder, which encodes the videos (and then uploads, etc), opening them through an avisynth script to do some treatment on it before compression.

But I have a problem: If I launch my encoding script, in command line, everything works.

If the encoding script is called via the web interface, a strange thing happens: avisynth opens a video without audio stream! If I add ".Info" to have debug info, it says "Audio stream: NO"... and of course, the resulting encoded file has no audio. The .avs script opens the .mp4 files with DirectShowSource()

The PC has Haali Media Splitter installed, to demux the .mp4 (without it I had an error saying that avisynth couldn't open the file), and ffdshow with aac and h264 enabled, to decode it.

Does anyone have an idea, why this works in one case, and not the other case? What is strange is that avisynth opens the file, but in one case, seems to "not see" the audio stream, and not in the other case !

Something even more strange: the same file, with the audio stream in mp3, instead of aac, encodes perfectly in both cases.

I need help :)

Leak
23rd June 2008, 14:03
I need help :)
I'm pretty sure the AviSynth script is getting opened by the SYSTEM (or some other dedicated) user if you're running Apache as a service that doesn't have ffdshow configured, so ffdshow will reject decoding most (all?) formats.

You could probably create a new user on the machine, set up ffdshow accordingly and then have Apache run under that user, but I'm not exactly sure what can of security problems that's going to open.

Have you tried using ffmpegSource instead of DirectShowSource? That should get rid of any configuration problem if it works, since ffmpegSource uses it's own decoders and splitters.

np: Thomas Brinkmann - Words (When Horses Die...)