Answer the question
In order to leave comments, you need to log in
Why doesn't ffmpeg stretch the image?
You need to put the picture on the music. The picture is square 1080x1080. It needs to be stretched to 1920x1080. I use filter_complex because I will add more filters in the future.
ffmpeg -y -i "music.mp3" -loop 1 -i "img.jpg" \
-filter_complex "[1:v]scale=1920:1080[out]" \
-map "[out]" \
-map 0:a \
-shortest -acodec copy \
-c:v libx264 -b:v 6M -minrate 6M -maxrate 6M -bufsize 12M \
-preset medium -r 30 -pix_fmt yuv420p -tune stillimage -crf 19 -movflags faststart \
"out.mp4"
ffmpeg version N-98692-ga5ac819 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
configuration: --prefix=/home/lexx/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/lexx/ffmpeg_build/include --extra-ldflags=-L/home/lexx/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/lexx/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
libavutil 56. 58.100 / 56. 58.100
libavcodec 58.100.100 / 58.100.100
libavformat 58. 50.100 / 58. 50.100
libavdevice 58. 11.101 / 58. 11.101
libavfilter 7. 87.100 / 7. 87.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
libpostproc 55. 8.100 / 55. 8.100
Answer the question
In order to leave comments, you need to log in
I tried it on a fresh ffmpeg master, it jars.
ffmpeg -i logo.png -filter_complex "[0:v]scale=1920:1080[out]" -map '[out]' out.png
. It was a square logo, it became rectangular. However, the display aspect ratio remained at 1, while the pixel aspect ratio changed to 0.56:Width : 1920
Width : 1 920 pixels
Height : 1080
Height : 1 080 pixels
Stored_Height : 1088
Sampled_Width : 1920
Sampled_Height : 1080
Pixel aspect ratio : 0.562
Display aspect ratio : 0.999
Display aspect ratio : 0.999
Original display aspect ratio : 1.000
Original display aspect ratio : 1.000
-aspect 1.7778
solves the problem.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question