I have the following files:
1. a jpeg image
2. an mp3 file of some length say (3 minutes)
I want to convert this to a .3gp video. How do I do it?
I've tried the following:
Created a video of zero length(time) using the jpeg image:
ffmpeg -f image2 -i temp_img.jpg temp_video.mpg
Then, I tried to mix the video and audio streams as:
ffmpeg -i temp_sound.mp3 -i temp_video.mpg -vcodec mpeg video_finale.mpg
On doing this I get: some error message like "Codec could not be determined(Video:0x000)"
Please help.
Thanks.
Creating a video slideshow of images with FFmpegFFmpeg is an open source command line tool that can be used to process video, audio, and other multimedia files and streams.
http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs
A love these commands but have not used them in a while so looked it up for you as it should be help full.
Try creating the video from the still image using:
ffmpeg -loop_input -vframes <num_frames> -i <input_image> <output_file>
This allows you to repeat the frame as many times as you want to make a video that is not zero duration. You can also use -t <duration>
to give the length of the video in seconds instead of number of frames.
Also, the -f
argument specifies the output format, which is not image2, but is output format you want to use, like "3gp".
You can match the length of the video file up to the length of the mp3 file and then use the second command you wrote. Also, I would use -vcodec copy
in the second command so that it just copies the video data from the first step without performing a decode/encode step causing some quality to be lost.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With