[FFmpeg-user] Live transcoding to an rtp stream is unreliable.

Alexandre Ferrieux alexandre.ferrieux at orange-ftgroup.com
Thu Apr 7 13:39:05 CEST 2011


On 07/04/2011 13:14, David Pottage wrote:
> Hello
>
> I am attempting to transcode and re-stream a live TV channel using
> ffmpeg under linux. My command line is:
>
> ffmpeg -loglevel verbose \
> -pix_fmt yuv422p -s 720x576 -i http://david-laptop:8000/4228 \
> -vn -sn -acodec libfaac -ar 48000 -ab 64000 -ac 2 -async 1 -flags
> +global_header -f rtp rtp://david-laptop:9022 \
> -an -sn -vcodec libx264 -s 320x240 -fpre
> resources/ffpreset/libx264-hq.ffpreset \
> -fpre resources/ffpreset/libx264-ipod320.ffpreset -vglobal 1 -f rtp
> rtp://david-laptop:9020 -newvideo
>
> In the command line above, http://david-laptop:8000/4228 is connected to
> a DVB capture card, and streams a raw DVB transport stream of a live TV
> channel.
>
> The outgoing stream is sent as two seperate elementary streams (audio
> and video) over rtp.
>
> My problem is that the streaming process is very unreliable. ffmpeg will
> often hang on start-up, (before it emits the SDP file), or it will
> start-up normally, but then crash after about a second of transcoding.
>
> The reliablity appears to depend on the uptime of the machine, and the
> number of times it has run before. It usually works if it is the first
> time that ffmpeg is invoked after a reboot, but becomes less reliable
> after that.
>
> I have tried varying the network port numbers of the outgoing streams in
> case something is not being cleaned up, but it does not make any
> difference.
>
> Has anyone experienced any symptoms like that. Can anyone suggest what
> might be going on, or give me any clues for further investigation.

First, give the ffmpeg output  (giving the version, detected container and codec, stream mapping etc.).

Second, better characterize "crashes": open the corefile with gdb and give the stack of every thread.

Also, I'd try to decorrelate depayloading/decoding/encoding/repayloading, and see which (if any) crashes. To do so, use 
several ffmpeg processes connected by pipes, and -[av]codec copy (and explicit -f values).

-Alex



More information about the ffmpeg-user mailing list