[FFmpeg-user] Streaming MP4

Mike Scheutzow mjs973 at optonline.net
Sat Jun 4 16:12:41 CEST 2011


Baptiste Coudurier wrote:
>  On 05/30/2011 06:33 PM, JULIAN GARDNER wrote:
> > I was wondering if anybody has managed to get ffmpeg to stream out
> >  MP4 video/audio.
> >
> > I have a working system using mpeg-ts and h264/aac and i now need
> > to dual send some channels in MP4 as well, but when i change the
> > output format to mp4 i get
> >
> > "could not write header for output file #0"
> >
> > Anybody have any ideas to why this does not work or a way of
> > getting it to work.
>
>  MP4 is not a "streamable" format by essence. There are features that
>  can make it streamable, the muxer don't support them currently.


The usual way to send mp4 video over a network is to wrap it in RTP. 
rfc3984 describes one way to do this.

One huge problem of rfc3984 is that it relies on an SDP file to tell the 
client how to interpret the RTP content. So rfc3984 isn't really useful 
for broadcast-style use, because the bitstream is not self-contained (it 
does not contain all the information necessary to decode the bitstream.)

A second problem is that FFmpeg (the library) implements only a tiny 
subset of rfc3984, and it has many bugs.

If you want to experiment with rtp streams using ffmpeg (the app), 
specify '-re' to slow down the output rate, specify an output format of 
'-f rtp' and an output filename of 'rtp://client:clientPort' e.g. 
'rtp://127.0.0.1:5000'.

If you use vlc as the client, you must give vlc a valid .sdp file.

The FFmpeg library currently supports only 1 AVStream in an rtp output, 
so audio and video will have to be sent as separate bitstreams.

Be prepared to do a lot of debugging with wireshark.

 
Mike Scheutzow



More information about the ffmpeg-user mailing list