How to replace mp4 video track with images?
December 4, 2012 1:14 AM   Subscribe

I need to replace the video track of an MP4 with a single image in one case and with a series of transitioning images in another case. In both cases I wish to leave the audio track intact. I have tried Virtual-Dub and Windows Movie Maker (the downloadable version does not allow editing of the video/audio separately). Any suggestions for which software to use. I thought it would be straightforward, it hasn't been.
posted by therubettes to Computers & Internet (9 answers total) 1 user marked this as a favorite
 
I accomplished the single image case by accident a couple of times recently while trying to use VLC media player to save a Youtube stream. So that's one approach, to experiment with the command line switches for saving streams in VLC and the output encoding and container formats. (I don't think that Youtube actually needs to be involved; I think the input stream can just be a file on your hard drive.)

I'd also expect that some of the command line tools out there for video file processing could do this, though I don't have a specific recommendation off the top of my head; maybe someone else does, or a bit of Googling could bear fruit. And maybe a Linux-based LiveCD designed to provide a video editing workstation might have some useful tools?

Or, could you use some sort of video screen capture tool to get the sequence of still images you want and add the audio via VirtualDub?

One thing VLC can definitely do, though, is strip the audio from a video out into a separate .mp3, if that's needed as an input with any of the other approaches; I came across many pages describing exactly how to do this while I was doing my own experimenting.
posted by XMLicious at 1:32 AM on December 4, 2012 [1 favorite]


Response by poster: Thanks for that XMLicious I will give it a go. I should have probably added to my question that the ultimate target of the videos is YouTube, in case that is relevant.
posted by therubettes at 1:56 AM on December 4, 2012


I did a quick search and from the first page of results got this link:
Creating a Slideshow

The Ogg Video Tools provide a command line tool called oggSlideshow to create slideshows from a series of pictures in JEPG or PNG format with different effects for the changeover and presentation.
The Ogg Video Tools are available for Windows. VLC can handle converting back and forth from the Ogg format if Youtube doesn't let you upload it.
posted by XMLicious at 2:28 AM on December 4, 2012


You need a convertor that will accept image(s) as input and allow you to specify the framerate of the outputted video. FFmpeg does this. See instructions on this blog, starting from the section "CREATE A Video from an Image file using FFMPEG". You can grab the latest 32 or 64-bit static builds as needed from here. There's no installation required. Just extract the archive to a directory, and you're ready to go. There is a good GUI for ffmpeg, Avanti, but you may still have to specify some parameters to get what you want.
posted by Gyan at 2:32 AM on December 4, 2012


Yeah, ffmpeg is the right tool for this job.
posted by pharm at 5:39 AM on December 4, 2012


Something like this should do the trick:
  ffmpeg -loop 1 -i image.jpg -i video.mp4 -acodec copy -vcodec mpeg4 result.mp4 -map 0.0 -map 1.0
Add a bitrate specifier to the video encoder if you want a low bitrate video stream. You'll need to put the right numbers into the map ids, you can get them from looking at the output of
  ffmpeg -i video.mp4
to make sure you're muxing the audio stream from the mp4 and not the video! As I understand it, the first number in the map is the index of the input file (0 is the first, 1 is the second and so on: we're computer scientists here!) & the second is the stream number in that file.

(Warning: totally untested :) )
posted by pharm at 5:54 AM on December 4, 2012 [1 favorite]


You can extract the audio using the free tool MPEG Streamclip... but re-reading your post it looks like you do not have a program that will let you drop stills on top of a piece of audio.
posted by omnidrew at 6:56 AM on December 4, 2012


Videohelp.com is the place to go for questions like these, and it's loaded with windows free- and trial-ware (and payware for that matter, but I havne't encountered an issue yet that couldn't be conquered by a combination of freeware and a trip up a learning curve).

Not that stripping the audio is hard, but VirtualDub can do that in a trice.

After that, go with pharm's command. FFmpeg is one of those great pieces of software, like emacs or sendmail-- powerful beyond your imagination, and commanding it is obtuse beyond belief, so people to go lengths to build mostly-useful front-ends and scripts for it. The ability to reel off a command for it like that is pretty impressive.
posted by Sunburnt at 7:21 AM on December 4, 2012


Creative use of Google combined with the relevant manpages can get you a long way Sunburnt ;) (There's no way I could just quote command line args like that for something I don't do on a daily basis!)
posted by pharm at 7:37 AM on December 4, 2012 [1 favorite]


« Older Pimp my laundry!   |   Sending myself a message Newer »
This thread is closed to new comments.