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

Michael Niedermayer michaelni at gmx.at
Fri Jan 4 03:47:46 CET 2013


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

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No snowflake in an avalanche ever feels responsible. -- Voltaire
-------------- 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/20130104/e59bc3c2/attachment.asc>


More information about the ffmpeg-devel mailing list