[FFmpeg-devel] Streaming to ffserver

ffmpeg-devel at ballcam.com ffmpeg-devel at ballcam.com
Thu Mar 14 20:08:18 CET 2013


Michael Niedermayer <michaelni at gmx.at> wrote:

> On Sat, Jan 19, 2013 at 03:44:58PM -0600, ffmpeg-devel at ballcam.com wrote:
> > What is the simplest method to stream to ffserver, with a minimal C program, or
> > Perl Script?
> > 
> > I looked at a stream with Wireshark, and likewise, ffserver output indicates
> > a GET/POST setup, but I am having trouble posting a file with wget. (It works
> > ok if I use ffmpeg).
> > 
> > I would like to write a simple sending program to ffserver, without having to call
> > ffmpeg to do it. Can you help?
> > 
> > User-Agent, and Content-Type likely have to be specified correctly, anything else 
>
> > I need to know? (The source and the Docs are not exactly clear).
>
> Patches to improve source & docs are welecome!
> That is once you figure out how to do it, please documengt it so
> future users dont need to research it again
>
> Thanks
>
> [...]
> -- 
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> I have often repented speaking, but never of holding my tongue.
> -- Xenocrates


OK, I was able to figure some things out.

Bsically I send an HTTP response with a content-type header followed
by an SWF formatted file, out from a socket program to Flash Player
in Firefox, and it works fine.

What is the trick to stream though? ffmpeg can encode frames live
from a webcam and send them this way, one after the other. If I generate
single-frame SWF files of each frame, and send them to the browser, only the first
will play.

How does the SWF format distinguish between a finite number of frames
in a single file, and a continuing stream?

I have built some of the code in the examples, so I have some knowledge 
of the code there.

Likewise I have looked at:
libavformat/swfenc.c 
and wonder if these have anything to do with it:
486     put_swf_tag(s, TAG_END);
487     put_swf_end_tag(s);

Or:
413     swf->swf_frame_number++;

I am using ffmpeg 1.0

Thanks.


More information about the ffmpeg-devel mailing list