Add JPG image before movie with ffmpeg

  1. Make intro.mp4: matching attributes of movie.mp4.

    ffmpeg -loop 1 -framerate 60 -t 8 -i image.jpg -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -filter_complex "[0]scale=1488:1116:force_original_aspect_ratio=increase,crop=1488:1116,setsar=1,format=yuvj420p[v]" -map "[v]" -map 1 -c:v libx264 -c:a aac -shortest intro.mp4
    
  2. Make input.txt containing:

    file 'intro.mp4'
    file 'movie.mp4'
    
  3. Concatenate with concat demuxer:

    ffmpeg -f concat -i input.txt -c copy -movflags +faststart output.mp4
    

See Resizing videos with ffmpeg to fit specific size if you want to pad instead of crop to fit the image to match the video.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top