[FFmpeg-user] Android encoded video Demux and Mux again

Dmitry Monakhov dmonlist at gmail.com
Mon Nov 14 12:07:47 CET 2011


I want grab video stream from android device
There are two ways are possible
1) Stream container with a single stream(only video) to socket,
   and later parse it, and grab raw h264 stream similar to
   sipdroid(parse h263) or http://code.google.com/p/spydroid-ipcamera/

2) Use Camera.PreviewCallback to grab raw YUV images and 
   later encode it via ffmpeg (bambuser) or to mjpeg similar to

Second one is simpler, but not optimized and has horrible performance.
That's why i want use first alternative. So i've done simple proof of
concept test demux and mux container again:
Save several samples for different containers (mp4,3gp with) with one
stream (video only) to regular files, so all container's data on it's
paces(See links at the end of the letter).
Now i want to demux my container in order to get raw h264 stream,
#ffmpeg -i h264sample.mp4 -vcodec copy 264sample.h264
raw h264 stream is that i will have after my runtime stream parser.

And now i want to check that resulted stream are usable and it is
possible to mux it again to container
#ffmpeg -i h264sample.h264 -vcodec copy 264sample-out.mp4
But i always get an error.
Question #1 How i can mux raw h264 stream to container.
Question #2 I'm not good in encoding standards so can you please
describe me. Does individual frame of h263's or h264's raw stream
contains any timings information pts or dts?


More information about the ffmpeg-user mailing list