[FFmpeg-devel] ffmpeg or ffserver to stream?

Luca Abeni lucabe72
Fri Aug 31 17:02:05 CEST 2007


Hi,

Claudio Bertozzi wrote:
[...]
>  Luca Abeni told me to use this command line to stream something:
> "ffmpeg -re -i $1 -vcodec copy -an -f rtp rtp://127.0.0.1:10000 -vn
> -acodec copy -f rtp rtp://127.0.0.1:20000 -newaudio" now that the RTP
> functionality has been fixed. I looked the ffmpeg.c code but I didn't
> understand well the entire streaming mechanism (I can only stream some
> frame every time watching it with VLC but with many sincro error after
> changing "fmt = guess_format("mpeg", NULL, NULL);" in "fmt =
> guess_format("rtp", NULL, NULL);") and now my question is...

This is almost everything you need to do... The only other important 
thing is that you must send the frames at the correct time (look at the 
DTS). And remember to always pass a valid PTS to av_write_frame() (if 
you are reading frames from a file by using libavformat, you need the 
AVFMT_FLAG_GENPTS flag).

> I should
> continue to study ffmpeg code or it's better to study ffserver.c code

I think ffmpeg.c's code is cleaner, and easier to understand.


				Luca




More information about the ffmpeg-devel mailing list