[FFmpeg-devel] ffmpeg attached picture

Владислав Гаврилов vladislav.gavrilov.ru at gmail.com
Tue Nov 26 11:23:10 EET 2019


Hi,

 

I try to insert image picture to m4b as cover of the file.

I can read picture like this:

 

QPixmap pixmap;

if ( avformat_find_stream_info( fmt_ctx, nullptr ) >= 0 ) {

for ( int i = 0; i < fmt_ctx->nb_streams; ++i ) {

AVStream *stream = fmt_ctx->streams[ i ];

if ( stream->disposition & AV_DISPOSITION_ATTACHED_PIC ) {

AVPacket pkt = stream->attached_pic;

 pixmap = QPixmap::fromImage( QImage::fromData( ( uchar* )pkt.data, pkt.size
) );

break;

}

}

 

}

I change my pixmap for example.

But I can't find information how I can insert new picture in a new
AVFormatContext:

 

 

Best regards,

 

Vladislav Gavrilov

 



More information about the ffmpeg-devel mailing list