ffmpeg-python
ffmpeg-python copied to clipboard
How do I add a custom thumbnail to a .mp4 file using ffmpeg-python
how to do this with ffmpeg-python
ffmpeg -i video.mp4 -i image.png -map 1 -map 0 -c copy -disposition:0 attached_pic out.mp4
or
ffmpeg -i in.mp4 -i IMAGE -map 0 -map 1 -c copy -c:v:1 png -disposition:v:1 attached_pic out.mp4
find the proper ffmpeg command to add a .png or .jpg image to a .mp4 video as a thumbnail with ffmpeg-library
thanks
(
ffmpeg
.output(video, audio, '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()
)
thanks its working
import ffmpeg
stream = ffmpeg.input('test.mp4')
thumbnail = ffmpeg.input('test.png')
(
ffmpeg
.output(stream, thumbnail, 'test_thumbnail.mp4', c='copy', **{'c:v:1': 'png'}, **{'disposition:v:1': 'attached_pic'})
.global_args('-map', '0')
.global_args('-map', '1')
.run()
)