[FFmpeg-devel] [PATCH 4/5] ffmpeg: copy the attached_pic from input to output streams

Peter Ross pross at xvid.org
Sat Jan 5 12:36:58 CET 2013


On Fri, Jan 04, 2013 at 03:47:46AM +0100, Michael Niedermayer wrote:
> On Fri, Jan 04, 2013 at 01:39:51PM +1100, Peter Ross wrote:
> > On Thu, Jan 03, 2013 at 06:49:39PM +0100, Michael Niedermayer wrote:
> > > On Sun, Dec 30, 2012 at 11:39:03PM +1100, Peter Ross wrote:
> > > > ---
> > > > This permits the 'attached_pic' field to be accessed by muxers.
> > > > 
> > > >  ffmpeg.c | 3 +++
> > > >  1 file changed, 3 insertions(+)
> > > > 
> > > > diff --git a/ffmpeg.c b/ffmpeg.c
> > > > index 977218f..1bfaa25 100644
> > > > --- a/ffmpeg.c
> > > > +++ b/ffmpeg.c
> > > > @@ -2026,6 +2026,9 @@ static int transcode_init(void)
> > > >              ost->st->disposition          = ist->st->disposition;
> > > >              codec->bits_per_raw_sample    = icodec->bits_per_raw_sample;
> > > >              codec->chroma_sample_location = icodec->chroma_sample_location;
> > > > +
> > > > +            ost->st->attached_pic          = ist->st->attached_pic;
> > > > +            ost->st->attached_pic.destruct = NULL;
> > > >          }
> > > 
> > > this should not be needed, other muxers like mp3/id3 work
> > > fine without it as well (at least they should, i did not try now)
> > 
> > The approach taken by other muxers is to receive the attached picture through
> > AVOutputFormat.write_packet. That will work for the wtv too, but the muxer
> > would need to cache/copy the picture until it gets around to write_trailer.
> > The above patch saves having to perform that copy.
> 
> above code would not work if the input was a jpeg file instead of an
> attached pic

Understood. (How did I miss that!). Thanks,

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- 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/20130105/568225e5/attachment.asc>


More information about the ffmpeg-devel mailing list