[Live-devel] MediaSubsession SDP description to NAL
Chris Richardson (WTI)
chris at gotowti.com
Thu Nov 17 14:39:52 PST 2011
Hi James,
It is fairly straightforward to read the fmtp line and convert it to
something FFMPEG can use. First, read the SPS and PPS from the SDP using
MediaSubsession::fmtp_spropparametersets(). Then you will split the
returned string at the comma, if present. The first half will be the SPS
and the second half will be the PPS. Base64 decode both of these strings
(using Live555's base64Decode function if you wish), then write them to a
buffer, with start codes, in the following order:
Start Code (00 00 01 or 00 00 00 01)
SPS
Start Code (00 00 01 or 00 00 00 01)
PPS
A couple notes:
1. I can't recall if I had to use 00 00 01 or 00 00 00 01 to make FFMPEG
happy. I would expect to use 00 00 00 01, but my code currently has 00 00
01, so you may have to try both.
2. I feed the extradata to FFMPEG using a buffer that is padded with
'FF_INPUT_BUFFER_PADDING_SIZE' extra bytes. I can't recall if this is
necessary or not.
3. You must malloc the AVCodecContext::extradata buffer with av_malloc, if I
recall correctly.
These are the basic exact steps of what my implementation does and it works
fine, though my streams also have SPS, PPS and IDR NALs embedded in them.
Good luck,
Chris Richardson
WTI
-----Original Message-----
From: live-devel-bounces at ns.live555.com
[mailto:live-devel-bounces at ns.live555.com] On Behalf Of James Norris
Sent: Thursday, November 17, 2011 12:13 PM
To: live-devel at ns.live555.com
Subject: [Live-devel] MediaSubsession SDP description to NAL
Hey all,
This is a long shot, but does live555 contain any code that might
convert the fmtp line from the SDP description of the
MediaSubsession::savedSDPLines (), back into a NAL, in the same data
format as the one which was parsed to create the line.
I would like to feed it into ffmpeg in the form of
AvCodecContext::extradata, seems like the only way to get it to parse
the SPS/PPS without the NALs being inline.
Cheers,
James
_______________________________________________
live-devel mailing list
live-devel at lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel
More information about the live-devel
mailing list