[Ffmpeg-devel] [Ffmpeg-devel-old] rtp mpeg4 packetize problem
Wed Jul 20 09:06:16 CEST 2005
On Wed, 2005-07-20 at 12:19 +0800, mike lee wrote:
> Dear all
> I am now trying to use ffmpeg library to stream data and test with
> videolan player thought rtsp/rtp/udp .
I wrote a similar application some time ago (a very simple one,
streaming only video).
> But i found that error occur
> whenever a frame is sent with multiple packets which is likely to be the
> key frame. Final image is a mess at the bottom but ok at the top. And i
> have checked that the marker bit is properly set on the last packet.
What I did is pretty simple, and works ok:
1) send only 1 frame per rtp packet (no more than 1 frame)
2) if a frame does not fit in a single rtp packet, split it in more
packets, setting the M flag to 1 only on the last one. It is important
that the last packet contains only the end of the frame (and not the
beginning of the next one, for example).
This simple strategy maybe is not fully 3016 compliant, but it works ok
(tested with MPEG4 streams up to 4Mbps). Both videolan client and
quicktime player can receive the video stream without problems and
without showing any artifact.
Another option would be to use live.com libraries (but it seems a little
bit overkilling, if you have to stream only MPEG4 video).
> Also, according rfc3016, mpeg4 rtp payload may include specific
I did not double-check, but I do not remember rfc3016 asking for
specific headers in the payload (I think it simply cites some standard
MPEG4 headers). The only "strange thing" that you can do is to put the
MPEG4 "global headers" in the config line in the SDP, and remove them
from the MPEG4 video stream (use CODEC_FLAG_GLOBAL_HEADER).
Email.it, the professional e-mail, gratis per te: http://www.email.it/f
ShopMon: la rete che fa bene!
* Con la tua opinione ShopMon dona 1? ad Amref ed Unicef
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3670&d=20-7
More information about the ffmpeg-devel