[FFmpeg-devel] Splitting an MPEG{1,2} frame in slices

Luca Abeni lucabe72
Tue Aug 21 16:41:55 CEST 2007


Hi Michael,

Michael Niedermayer wrote:
[...]
>> I can parse the video frame "by hand", searching for "0x000001" 
>> sequences, but I want to avoid replicating some already existing code, 
>> so I am wondering if libavcodec already provides functions for splitting 
>> MPEG{1,2} video frames in slices.
> 
> ff_find_start_code() could come in handy

Thanks for the hint: this is what I needed.
Only one question: it seems that the "state" parameter is both an input 
and an output parameter. How should I set it before calling 
ff_find_start_code()?
I see that it is sometimes set to -1... I assume this is what I want.
BTW: I also noticed that libavcodec/cavsdec.c:cavs_decode_frame() calls 
ff_find_start_code() without initializing such parameter... Is this safe?


> also AVCodecContext.rtp_callback() should be called at the begin of
> slices by the encoder, but that obviously wont work if you want to
> stream an existing mpeg compared to encode+stream

In fact, I am trying to stream pre-encoded files... So, I cannot use 
rtp_callback()


			Thanks,
				Luca




More information about the ffmpeg-devel mailing list