Hi, I need to combine a single image and an audio file to get a video of the same duration as the audio. The reason is that the image is the waveform of the audio track and with this trick the playback bar of the videoplayer seems to follow the shape of the audio.
I'm perfectly capable of doing this with Premiere Pro but for convenience I'd like to do it with FFmpeg.
I tried but the video duration is always a few seconds longer than the audio. Always...
I used this script, what am I doing wrong?
Code:ffmpeg -loop 1 -i 01.png -i 01.wav -c:v libx264 -pix_fmt yuv420p -tune stillimage -c:a aac -b:a 256k -shortest -y output.mp4
01.wav is 7 s 249 ms long, the video obtained with this script is 9 s 200 ms long..
I attach the files of my test
01.wav
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 7 of 7
Thread
-
-
I think this may solve your issue https://ffmpeg.org/ffmpeg-filters.html#amovie
I think explicitly specifying frame rate may improve overall behavior.
(not sure as i can only assume where is the issue - to small framerate + too long GOP may lead to such behavior) -
I didn't understand how to use the information on that page. What should I use?
I've tried to add -framerate option but the result is still wrong
Code:ffmpeg -loop 1 -framerate 50 -i 01.png -i 01.wav -c:v libx264 -pix_fmt yuv420p -tune stillimage -c:a aac -b:a 256k -shortest -y output.mp4
https://stackoverflow.com/questions/55800185/my-ffmpeg-output-always-add-extra-30s-of-...04507#55804507 -
-
Great! Yes problem solved! The video duration is 7 s 400 ms while the audio duration is 7 s 249 ms. I think they can't really be coincident because of the difference between audio samples and frames. Anyway I'm totally satisfied! Thank you very much!
Similar Threads
-
Can't get FFMPEG Script to Remux to MP4 with Wav, It instead remuxes to MKV
By VideoFanatic in forum Video ConversionReplies: 3Last Post: 1st Aug 2021, 02:32 -
Convert 5.1 PCM WAV to Six Mono WAVs, Knowing Which WAV Goes to Which Chann
By koberulz in forum AudioReplies: 2Last Post: 28th Dec 2019, 12:53 -
Convert dts.wav to wav with foobar2000
By kirkmc in forum AudioReplies: 2Last Post: 4th Nov 2019, 20:59 -
Muxing wav&mpeg2 to ts using ffmpeg, losing audio :/
By Selur in forum Newbie / General discussionsReplies: 1Last Post: 22nd Sep 2019, 16:18 -
FFMPEG how to merge 2 stereo .wav audio files into one of 4 channels?
By marcorocchini in forum Newbie / General discussionsReplies: 4Last Post: 24th Jun 2018, 07:25