[Live-devel] Stream FFMPEG packets using subclassed OnDemandServerMediaSubsession

Matthew Czarnek mczarnek at edge360.com
Tue Feb 25 11:49:27 PST 2020


I need to be able to have trick play over RTSP for Matroska files. It works
in FFMPEG alone, but I cannot get it to stream it out over RTSP. Live555
also happens to be much more efficient than FFMPEG but seemed hard to
manipulate individual frames, and that piece already works in FFMPEG.

I have created a FfmpegMediaSubsession class that has been subclassed
from OnDemandServerMediaSubsession as well as FfmpegFileReader, subclassed
from FramedSource.

I'm using av_read_frame to read AVPackets from the file. I'm using the
AV_CODEC_FLAG_TRUNCATED and AV_CODEC_FLAG2_CHUNKS flags which seems to be
leading it to correctly read one NAL unit at a time from the file.

I then memcpy the AVPacket contents to fTo, and it is streaming it to
openRTSP and storing it to a file. However, I cannot get that file to play.

I suspect it has something to do with the NAL start codes.
Primarily because VLC's error log is telling me: h264 module discarded (no
startcode)

I've looked at the bytes of the AVPacket, every packet does seem to have
the first few bytes used for a NAL Unit Header. I've tried cutting those
off, thinking they were the start codes, I've tried
creating H264VideoStreamDiscreteFramer with includeStartCodeInOutput set to
true.

I can't seem to find a version that works or figure out the issue. Can you
please help point me in the right direction?

Thank you,
Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20200225/365515d1/attachment-0001.htm>


More information about the live-devel mailing list