1

based on this post

How do I add a custom thumbnail to a .mp4 file using ffmpeg?

Using ffmpeg 4.0, released Apr 20 2018 or newer,

ffmpeg -i video.mp4 -i image.png -map 1 -map 0 -c copy -disposition:0 attached_pic out.mp4

As in version 4.2.2...See Section 5.4 in FFmpeg documentation

To add an embedded cover/thumbnail:

ffmpeg -i in.mp4 -i IMAGE -map 0 -map 1 -c copy -c:v:1 png -disposition:v:1 attached_pic out.mp4

how can i do that using ffmpeg_python library https://github.com/kkroening/ffmpeg-python/tree/master/examples

thanks

alexia
  • 11
  • 1

1 Answers1

1

Even if the OP might not need a solution anymore, I came here to find it.

I found an example in the issues of the ffmpeg_python GitHub repository:

import ffmpeg

video = ffmpeg.input('in.mp4')
cover = ffmpeg.input('cover.png')
(
    ffmpeg
    .output(video, cover, 'out.mp4', c='copy', **{'c:v:1': 'png'}, **{'disposition:v:1': 'attached_pic'})
    .global_args('-map', '0')
    .global_args('-map', '1')
    .global_args('-loglevel', 'error')
    .run()
)
Qubitza
  • 23
  • 6