[Live-devel] Suggestions on the proper way to deal with frame size changes in the middle of H264 stream
Matt Schuckmann
matt at schuckmannacres.com
Mon Nov 17 10:12:42 PST 2008
I'm looking for suggestions on the proper way to signal to the client
that the frame size has changed in an H264 stream.
What I have actually works about %80 of the time.
Here is what I have.
1. Server is encoding camera data in real time using X264 and serving
the data via Live555 RTSP server based application.
2. I believe I've setup X264 to make all I frames IDR frames (I think
this means that all I frames will have enough information for the
decoder to figure out the frame size, etc simply from the stream)
3. Client connects (using Live555 RTSPClient based application) and
starts to receive the H264 stream.
4. Using FFMPEG the client application is able to start decoding and
displaying the video.
5. At anytime the client can request that the frame size be changed by
sending a SET_PARAMETER RTSP command to the server.
6. The server reads the SET_PARAMETER command validates that the
requested frame size ok and modifies it to next bigger valid size if
neccessary.
7. The server then restarts the encoder with the new frame size and
continues to send the video data with the new frame size over the same
stream RTP stream as before.
8. Here is where the 80% comes in. Most of the time it the FFMPEG
decoder sees the new frame size and correctly handles it and everything
is good but about 20% the time it doesn't and FFMPEG crashes.
It seems like what I'm doing should be ok I'm thinking that this is just
a untested "feature" in FFMPEG (how many people actually create videos
where the the frame size changes mid stream) and I'm just going to need
to get setup on a Linux box to debug FFMPEG. I'm not sure and I'm
wondering if there is a better way to do this or if there is something
that the server should insert in the stream to signal this event to the
client so that it can better prepare the decoder for the change in frame
size or? I thought the just the presents of the changed IDR frames would
be enough.
Thanks for a suggestions, you've been a great help so far.
Matt S.
Any suggestions?
More information about the live-devel
mailing list