Hi guys and gals!
First off let me say, this is a great community! Long time reader, first time poster.
Ok, here's my question:
I have a series of sequentially named images (Slide01.jpg, Slide02.jpg, ...), and sequentially named wave files (Slide01.wav, Slide02.wav, ...).
What I'd like to do is build a video where the images are synced with the audio, so Slide01.jpg is displayed the whole time Slide01.wav is playing, then Slide02.jpg is displayed while Slide02.wav is playing, etc.
I have a directory which contains both the images and the wav files.
I've been monkeying around with ffmpeg, and can get it to build a video from the sequence of images w/o audio just find by doing:
The %02d means "for each file in this directory named Slidexx.jpg (where xx is a 2 digit number).Code:ffmpeg -i Slide%02d.jpg -r 15 output.flv
The -r switch sets the framerate
I've tried to add the audio in as a mapped stream with this line:
Seems like it should work, however, ffmpeg barfs telling me that it can't find "Slide%02d.wav".Code:ffmpeg -i Slide%02d.jpg -i Slide%02d.wav -map 0:0 -map 1:0 -r 15 output.flv
I haven't been able to find any infos on the iwebs regarding adding audio to a video being created from images. I KNOW this has to be possible....
Any ideas gang? I'm open to using a tool other than ffmpeg, and don't care about platform as we do an equal amount of work in both Windows and Linux.
Thanks in advance,
Sean
+ Reply to Thread
Results 1 to 14 of 14
-
-
i know dvdslideshowgui can sync multiple slides to one audio, don't know about many but it may be worth trying. as it's free anyway.
http://download.videohelp.com/tin2tin/
if you had no other choice you could use it to do each slide/song individually and then join all the resultant vobs into one dvd.--
"a lot of people are better dead" - prisoner KSC2-303 -
Thanks for the info!
The video I'm intending to create is not destined to become a DVD. It's going to ultimately be a .flv (flash video).
I had the same thought about creating separate clips for each audio/image pair, then joining, and am currently fighting with a Windows batch script to do this for me. I think I'll move over to my Linux box as Batch makes me want to rip my hair out by the handful!
I'd also like to stay in the command line as this process will need to be scripted.
Any other thoughts? -
Ok, so after more playing around with things, what I've been doing is this:
I have a shell script that loops over a directory. Here's my script:
Code:#!/bin/sh for f in /home/boyer/VideoTest/*.wav do { wav=`basename $f` name=`basename $f .wav` jpg="${name}.jpg" output="${name}.avi" convert $jpg -resize 656x492\! -quality 100% $jpg ffmpeg -i $wav -i $jpg $output } done; for f in /home/boyer/VideoTest/*avi do { file=`basename $f` files="${files} $file" } done; mencoder -ovc copy -oac copy -o joined.avi $files
An avi (I've also tested with mpg and flv) is outputted.
For whatever reason, the video files produced with ffmpeg are corrupt. The avi's have broken headers and can't seek and won't combine), and the mpgs won't play video at all...
Then I'm attempting to combine (in this case the avi's) using mencoder, but it tells me my source videos are broken, and thus my output video is broken.
It's clear that something is going wrong from the very beginning. Should I be including some -map options on my ffmpeg call?
Advice?
Thanks!
Sean -
"Quality is cool, but don't forget... Content is King!"
-
Here's an avisynth script that will create a video of your image at your desired frame rate for the duration of the length of your wave file.
Just feed the AudioNImage function the location of the wave file, the location of the image file, and the required frames per second of the video.
Example:
Code:audio="D:\video\Captures\rocky_mountains.wav" picture="D:\video\Captures\firstframe.bmp" AudioNImage(audio,picture,15) #spline32resize(640,480) function AudioNImage(string wave, string image, float fps) { aud=Wavsource(wave) length=audiolengthF(aud) rate=Audiorate(aud) frames=Int((length/rate)*fps) vid=ImageSource(image, end=Int(frames), fps=fps) return audiodub(vid,aud) }
You can then feed ffmpeg like this: ffmpeg -i avsfile.avs outputfile.flv -
Last edited by Rotsujin; 27th Feb 2010 at 20:31.
-
Oddly enough the same thing was happening to me too!
All I did was flip my images before hand using image magick. This was ok, since I was resizing the images explicitly first anyway. Here's my line:
Code:imgconv image.png -resize 656x492! -flip imagesmall.png
-
Hey guys!
Back again with another question regarding this issue.
I've had to abandon using avisynth, as for the live of me (and our IT team) we cannot get avisynth to build on Linux (which is ultimately where this stuff has to run).
Using ffmpeg, I can create a video from a png image, and a wave file.
The problem is, that the video stream is only 34ms long where the audio stream is 4:43 let's say.
On Windows, this avi will play/seek just fine, but on Linux, it is totally broken.
My question is, is there a way to sync the length of the video stream (in this case the input is a png image) to the length of the audio stream, without knowing the length of the wav at runtime?
If worse comes to worse, I could find a tool to extract the runtime of the wav, then manually put that into the ffmpeg command, but I'd rather avoid that if possible.
Any ideas? -
PS - the solution for creating a piece of video from a still image with audio is using the -loop_input switch on the image input side.
Code:ffmpeg -loop_input -r 1 -i image.png -i audio.mp3 output.avi
Similar Threads
-
TMPGEnc Video Master Works audio problem creating bd25
By necron99 in forum Video ConversionReplies: 0Last Post: 29th Apr 2012, 20:52 -
Images to video
By cyberlion in forum EditingReplies: 0Last Post: 5th Oct 2010, 03:17 -
Creating video with sound from multiple images
By caio1985 in forum ffmpegX general discussionReplies: 1Last Post: 5th Aug 2010, 17:23 -
Creating Animated Menu images
By DesertAvenger in forum Authoring (DVD)Replies: 4Last Post: 16th Sep 2009, 00:30 -
flash images -- Howto: copy-to-clipboard, and also creating them ?
By vhelp in forum Video Streaming DownloadingReplies: 12Last Post: 30th Mar 2008, 22:11