On Mon, 2010-07-19 at 17:58 +0100, Smart, Gary wrote:
> I have access to a h264 TS file growing on disk.  I cannot connect to
> the stream from which the file is being created. 
> 
> If I connect my video player code (libav based) to such a file (i.e. a
> growing one) then I can decode and display all frames in the file up to
> the point at which the file was opened.  However, I cannot ever display
> frames beyond the point at which it was opened.  If I close the player
> and reopen the file, I can of course play more frames from the file.
> 
>  
> 
> I really don't want to have to keep closing and reopening the file.  Is
> there a way to enable the Libav to detect additional frames which have
> been added to the file post-opening?

Linux does not support reading growing files in a blocking manner. Or
maybe it does, but I spent a couple of days fiddling around before
having to resort to hacks (streaming via a special HTTP server).
Something like "ffmpeg -i - ... < file" would work on BSD. POSIX has
such behaviour as "undefined" IIRC.

You could try writing a small program that reads a file until EOF,
checks if the size of the file changed, then reopens and outputs the
rest until the file size no longer changes over the course of a couple
of seconds. Write the data to stdout and pipe the program's output to
ffmpeg.

/Tomas

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to