Results 1 to 5 of 5

Thread: ffmpeg command to make a video from one mp3 and one png

  1. #1
    Join Date
    Aug 2008
    Beans
    3

    ffmpeg command to make a video from one mp3 and one png

    is there a command to create a video from a mp3 and a png suitable to upload on youtube if anybody knows?

  2. #2
    Join Date
    Jul 2006
    Location
    Lancashire
    Beans
    Hidden!
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: ffmpeg command to make a video from one mp3 and one png

    Hi

    This is one way to do it.
    If you have a png file with name picture.png.
    And a mp3 file with name soundtrack.mp3.

    First make a silent video with the correct length of time.
    So if your mp3 track lasts for 198 seconds the command is:-
    Code:
    ffmpeg -loop_input -i picture.png -t 198 silent.mp4
    Then add the soundtrack:-

    Code:
    ffmpeg -i silent.mp4 -i soundtrack.mp3 -vcodec copy -acodec copy movie.mp4
    This gives you a mp4 file named movie.mp4 suitable for YouTube.
    Last edited by ron999; June 6th, 2010 at 04:09 AM.

  3. #3
    Join Date
    Aug 2008
    Beans
    3

    Re: ffmpeg command to make a video from one mp3 and one png

    that's great, thank you

    finally a lossless conversion

    ---

    by the way this is what i used and it worked really well:

    Code:
     ffmpeg -i image.jpg -loop_input -t 206 -vcodec mpeg2video silent.mp4
    use mpeg2video codec instead of default mpeg4, better supported by youtube according to http://www.google.com/support/youtub...&answer=132460

    Code:
     ffmpeg -i silent.mp4 -i input.mp3 -acodec copy -vcodec copy -acodec copy -vcodec copy output.mp4
    copy both sound and video strems
    Last edited by bcqdan; June 7th, 2010 at 12:38 PM.

  4. #4
    Join Date
    Sep 2006
    Beans
    3,713

    Re: ffmpeg command to make a video from one mp3 and one png

    Here's a similar thread: Convert mp3 to avi. I give a FFmpeg example showing how to do everything in one step.

  5. #5
    Join Date
    Jul 2006
    Location
    Lancashire
    Beans
    Hidden!
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: ffmpeg command to make a video from one mp3 and one png

    @FakeOutdoorsman
    That -shortest option is useful. We learn something new every day.

    So the new improved version is:-
    Code:
    ffmpeg -loop_input -i picture.png -i soundtrack.mp3 -shortest -acodec copy movie.mp4
    Last edited by ron999; June 8th, 2010 at 12:16 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •