[FFmpeg-devel] [Libav-user] MOV and custom IO

Michael Niedermayer michaelni at gmx.at
Tue Jul 24 22:38:15 CEST 2012


On Sun, Jul 22, 2012 at 02:01:02PM +0100, David Rodrigues wrote:
> Hi everyone.
> 
> I've written some code to change the video container from MOV to MPEG-TS using ffmpeg API successfully. I'm using physical files. 
> 
> Now i have to change my input from file to custom IO. I changed the code for use custom IO with a callback (read_packet_callback) to feed ffmpeg.
> 
> fmtCtx = avformat_alloc_context();
> 
> iformat = av_find_input_format(input_fmt);
> 
> ibuffer = (unsigned char *) av_malloc(BUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE)
> 
> fmtCtx->pb = avio_alloc_context(ibuffer, 
> 				BUF_SIZE, 
> 				0, 
> 				read_context, 
> 				read_packet_callback, 
> 				NULL, 
> 				NULL);
> 
> avformat_open_input(&fmtCtx, "in-memory", iformat, NULL)
> 
> When i run the code the function avformat_open_input blocks, it reads N chunks of data but don't terminate with or without error. This happens with MOV format. I've tried using MPEG-TS format and this code runs successfully.
> 
> There's a special trick for MOV format? Has anyone encountered this problem?

are your mov files streamable ? if not your custom IO needs to support
seeking

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120724/655617ef/attachment.asc>


More information about the ffmpeg-devel mailing list