I have 480x360 PNG image and a 128Kbps MP3 file as sources. I need to make FLV (Sorenson h263) video with PNG image as a static video (1fps, keyframes every 5 frames), and with mp3 as a soundtrack. how can i do such in ffmpeg/mencoder/or maybe other cli tool? i'm writing a php script that would take user's png/mp3 and output flv for download. file size doesnt matter, max quality is the key here.
here are the source file just in case:
http://golosmira.com/sources.rar
Thanks in advance!
PS: directly muxing mp3 audio into flv without re-encoding would be a definite plus
+ Reply to Thread
Results 1 to 10 of 10
-
-
couldn't do it in a single step nicely with ffmpeg.
could be my version
Code:ffmpeg -loop_input -i video.png -r 1 -i audio.mp3 -acodec copy -vcodec flv -qscale 2 -ab 128k -g 5 -cmp 3 -subcmp 3 -mbd 2 -flags trell frifox.avi -shortest ffmpeg -i frifox.avi -vcodec copy -acodec copy frifox1.flv del frifox.avi
Code:mencoder mf://video.png -mf fps=1/45:type=png -audiofile audio.mp3 -ovc lavc -oac copy -vf harddup -lavcopts vcodec=flv:vqscale=2:keyint=5 -ofps 1 -of lavf -o Fri.flv
-
btw here's resulting video produced by ffmpeg script above. imho its as perfect as anyone can get it...
Lossless upload:
http://www.youtube.com/watch?v=ZhCwOyvMcSw
and
Lossless 320Kbps VBR MP3 + 480x360 hifi pic:
http://www.youtube.com/watch?v=i7DM3wMViMA -
Originally Posted by 45tripp
-
so far ffmpeg is doing a very good job, here is the command that i was using:
Code:ffmpeg -loop_input -f image2 -i pic.png -r 1 -vcodec flv -i audio.mp3 -acodec copy -qscale 2 -g 5 -cmp 3 -subcmp 3 -mbd 2 -flags trell temp.avi -shortest ffmpeg -i temp.avi -vcodec copy -acodec copy video.flv
so my question is, how to accomplish the above with MENCODER (aka, mux 1 PNG file with an MP3 file)?
here's what i've been trying with mencoder. my goal is to loop png file along the duration of the mp3 file., but currently mencoder just cuts everything off @ 1 second
Code:mencoder mf://video.png -mf type=png:fps=1 -ovc lavc -lavcopts vcodec=flv:vqscale=2:keyint=5 -oac copy -audiofile audio.mp3 -vf harddup -ofps 1 -o video.flv
Thanks for the help! -
I already showed it to you in mencoder:
Originally Posted by 45tripp
you need to know the clip duration though,
you don't have ffmpeg looping,
so 45 sec was the duration of the first audio clip you provided.
change that number to the duration of each clip in seconds.
there were couple of mp3 files which ffmpeg couldnt handle, it would simply crash with no warning.
tripp -
Originally Posted by 45tripp
Originally Posted by 45tripp -
you can use mencoder if you want.
just got to be a bit inventive.
Code:@echo off mp3info -p "%%S" v.mp3 > t.txt set /p d= <t.txt mencoder mf://video.png -mf fps=1/%d%:type=png -audiofile v.mp3 -ovc lavc -oac copy -vf harddup -lavcopts vcodec=flv:vqscale=2:keyint=5 -ofps 1 -of lavf -o Fri.flv
http://www.ibiblio.org/mp3info/
not gonna look for the other thread,
but you can do autoscaling with ffmpeg if you plan the calc externally and use an aiding program or two
probably better to use some other language than dos batch
but there's the basic stucture of something like that here:
https://forum.videohelp.com/topic349222.html#1836387
tripp
Similar Threads
-
Add mp3 to flv ...
By AshleyQuick in forum Newbie / General discussionsReplies: 2Last Post: 23rd Oct 2011, 17:18 -
Converting flv to mp3
By Jsiers in forum ffmpegX general discussionReplies: 5Last Post: 28th Apr 2011, 13:18 -
Trouble converting AVI(divx)+MP3 to FLV+MP3
By BLboy in forum Video ConversionReplies: 7Last Post: 21st Jul 2009, 04:36 -
FLV to MP3 on a Mac
By neko_chan in forum MacReplies: 9Last Post: 2nd Jul 2008, 10:45 -
Mux a FLV AVI + MP3 -> FLV with ffmpeg or mencoder?
By Colmino in forum Video ConversionReplies: 9Last Post: 29th Mar 2008, 22:11