[MPlayer-users] combining a still with an audio file
Miriam English
mim at miriam-english.org
Wed Jul 25 18:51:24 EEST 2018
Find the length of the audio file in seconds and use that instead of the
"443" below.
Replace "Sunset.jpg" and "Mirage.mp3" with your own files.
seconds=443; for x in `seq $seconds`; do cat Sunset.jpg; done | mencoder
-o out.avi -fps 1 -ovc lavc -demuxer lavf -lavfdopts format=mjpeg
-audiofile Mirage.mp3 -oac copy -
Note that the example above is a bash shell script, so requires Linux.
It won't work on MSWindows without alteration. The command "seq
$seconds" outputs a list from "1" to the number of seconds stored in the
variable "$seconds". The for... do... done loop cycles "$seconds"
number of times to output the image file (in this case "Sunset.jpg")
through a pipe (|) to the mencoder command. Notice the final "-" in the
mencoder command. that takes its input from the standard input, which is
in this case the pipe (|).
There are some other ways to do this that use just a single image once,
but you can't seek within the resulting file, can't resize the window
without losing the image, and can't see the seconds ticking by if you
use "o" in mplayer to display it. Using the loop to input the original
image over and over again fixes all those problems, and since it is
stored as mjpeg the size remains extremely small, since the difference
between two successive identical images is zero.
Hope this helps,
- Miriam
arthurpeabody wrote:
> I have an audio file I want to publish on YouTube. YouTube
> requires a video file. I want to combine a still with the audio file
> to make a video file. How do I do that? (Linux)
> _______________________________________________
> MPlayer-users mailing list
> MPlayer-users at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users
--
What is the most important thing in the world you could be working on right now, and if you are not working on that, why aren't you?
-- Aaron Swartz (internet genius, philanthropist)
More information about the MPlayer-users
mailing list