[x264-devel] Re: Method to get avi in via stdin

Loren Merritt lorenm at u.washington.edu
Fri Oct 13 20:10:57 CEST 2006


On Thu, 12 Oct 2006, Foxy Shadis wrote:

> I was thinking about this a while ago, but shelved it because I wasn't sure 
> how to implement, but I thought I'd ask here. How about implementing 
> something in muxers.c/open_file_yuv to detect an AVI (if the first four bytes 
> are 'RIFF' and some joker isn't passing in a wav or midi, it's extremely 
> unlikely to not be one), and in that case pass control to open_file_avis 
> instead.
>
> What I'm unsure about is how to leave the stream in condition for 
> open_file_avis to read, without closing the stream. I thought about ungetc, 
> but I don't know how well it'd work cross-platform, or whether fseek works on 
>
> The point of this is to allow ffmpeg or mencoder decoded video to be piped 
> into x264 without having to specify dimentions and that other good stuff.
> stdin. Any pointers?

fseek does not work on stdin unless stdin is aliased to a file (i.e. '<' 
redirection in the shell). ungetc only allows ungetting one byte (you 
can't call it multiple times).
Even if you fix this (using an explicit buffer?) it only allows piped 
yuv4mpeg, not avi. The api currently used for avi takes a filename, not a 
filehandle.

There was a patch some time ago by Mukund to allow libav* input. It didn't 
do stdin either, but libavformat at least has an api that would work.

--Loren Merritt

-- 
This is the x264-devel mailing-list
To unsubscribe, go to: http://developers.videolan.org/lists.html



More information about the x264-devel mailing list