VideoHelp Forum
+ Reply to Thread
Results 1 to 3 of 3
Thread
  1. Member
    Join Date
    Oct 2007
    Location
    United States
    Search Comp PM
    My input source is PNG image (image.png) and MP3 audio (audio.mp3). Currently I loop PNG input to make the video and stream-copy the audio, into the final video (final.avi):

    Code:
    ffmpeg -loop_input -f image2 -i image.png -r 1 -vcodec flv -i audio.mp3 -acodec copy -g 10 -qscale 2 -cmp 3 -subcmp 3 -mbd 2 -flags trell final.avi -shortest
    if the image for example is 1024x768, the encoding speed is sub 1FPS! I want to improve the total encoding time by first encoding 5 frames (1 keyframe with the following 4 frames), and then loop copy that video stream into final AVI, say 5 minute video. How can I achieve this?

    Thanks in advance!
    Quote Quote  
  2. Member
    Join Date
    Dec 2004
    Location
    Triptonia
    Search Comp PM
    Not with ffmpeg alone.

    you'd need to find a command line tool to concatenate avi's:
    create the section of video with ffmpeg,
    concatenate X amount of times based on audio duration (script it),
    mux audio and video.

    not exactly simple

    gl
    Quote Quote  
  3. Member
    Join Date
    Nov 2009
    Location
    United States
    Search Comp PM
    Use Mencoder.

    Concatenating / appending is super easy with Mencoder, check out the following example (for linux or mac):

    Code:
    mencoder -oac copy -ovc copy -o 'output_filename.avi' 'clip1.avi' 'clip2.avi' 'clip3.avi'
    Of course, in your case you would be appending the same thing over and over, in which case I would recommend either using a script to generate an appropriate Mencoder command, or using an Avidemux script.

    For more on appending clips with Mencoder (including a script example) check out this post:
    http://backstar.com/blog/2009/11/10/append-videos-with-mencoder/

    Explaining Avidemux scripting is really not in the scope of this reply, but basically you'd just need to use a simple Javascript loop. For example (this will concatenate a clip of 1000 frames 100 times):
    Code:
    for(var f = 0; f < 100; f++) {
      app.addSegment(0,0,1000);
    }
    To use the above code, do the following:
    • open the clip you want to repeat in Avidemux
      save the project file
      open the project file with a text editor
      add the for... code around the app.addSegment() part of the code
      delete the markerA=; and markerB=;
      save the project file
      open the project file in Avidemux
      save the video

    That might seem like a lot, but trust me, it's much easier than appending the same file 1000+ times, and much quicker than letting ffmpeg take its sweet time to convert every frame from the original image.

    EDIT: oh yeah, then you'll have to mux the audio and video. you can do this with a whole lot of programs, but i'd suggest using ffmpeg if you're willing to deal with the command line (which you probably are if you followed the above instructions)
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!