VideoHelp Forum




+ Reply to Thread
Results 1 to 5 of 5
  1. Member mats.hogberg's Avatar
    Join Date
    Jul 2002
    Location
    Sweden (PAL)
    Search Comp PM
    I'm trying to create an AVI with basically one still, and a 1.30 hrs audio track.
    If I load the jpg into AviDeMux, and the audio (as wav or MP3) and save, i get a 1 frame long AVI (1/25 s).
    Any simple way to have the still "duplicated" to fit the audio length, or to create an AVI of a specific length (from the still) to use together with the audio?

    /Mats
    Quote Quote  
  2. Member oldcpu's Avatar
    Join Date
    Aug 2005
    Location
    Europe
    Search Comp PM
    I found this information here on this "relatively old" (but still very good) post:
    http://gecius.de/linux/dvd.html
    ... however last I looked that web site URL was down.

    So the following is a quote from that site:
    Photos

    Now, I wanted to add all the digital pictures to that DVD, as there was plenty of space on the disc. But it also needs additional steps to convert the images to a DVD-compatible format, which, you're right, is mpeg.

    To change the images to the correct aspect-ration for tv (pal, in my case), I did

    montage -geometry 720x576 -background black -quality 100 inputimage.jpg convertedimage.jpg

    If there are borders to cover, e.g. for a portrait image, these will be black (-background parameter). If you want to do this for a whole batch of images, try a little more complex shell command

    for i in *.JPG; do montage -geometry 720x576 -background black -quality 100 $i conv-$i; done

    This will get every *.JPG file in the current directory (think of case matters!), convert it and write the newly generated image to the file conv-(original-image-name). Hence you keep the original, but also have the target.

    Now we need to convert the jpeg to a proper mpeg-stream. This is done with the command

    jpeg2yuv -n 25 -I p -f 25 -j conv-image.jpg |mpeg2enc -f 8 -o image.m2v; mplex -f 8 -o image.mpg image.m2v silence.mp2

    Edit: the above is all one line.

    This makes a 1 second yuv-stream (25 frames/second [-f 25], 25 [-n 25] frames total) of the image using progressive interleave (-I p). The second part encodes this yuv-stream to an mpeg stream, using the DVD-format [-f 8], putting the results in the file image.m2v (as this is video only, so far). Finally, we add some audio (silence.mp2) to the stream, again, using the DVD-format [-f 8]. As you would have guessed, silence.mp2 is a mp2 with silence. You can generate one yourself like this

    arecord -f dat -twav -d 1 silence.wav

    mp2enc -r 48000 -o silence.mp2 < silence.wav

    I had some trouble piping the m2v directly into mplex, so I did the step with the intermediary m2v as a file. Use the same logic with the for-loop above for generating some more files in one step.
    Quote Quote  
  3. I do this with VirtualDub. Open the single frame of video then go to the Video -> Frame Rate dialog. In the "Source rate adjustment" section enable "Change frame rate to (fps):" and set the rate to 1/duration (in seconds). Doing simply this will get you a single frame that lasts for the duration of the audio. For example, for a 180 second duration enter 0.005555 (1/180).

    Some players might have problems with that though. You can change the output frame rate by enabling the "Convert to fps" option in the "Frame rate conversion" section. Pick a frame rate your are happy with (15, 23.975, 25, etc) and VirtualDub will duplicate the one source frame enough times fill out the running time at the desired rate. Combining that with some inter-frame compression codec like Divx or Xvid will get you a reasonably sized file.
    Quote Quote  
  4. Member ks47's Avatar
    Join Date
    May 2007
    Location
    United States
    Search Comp PM
    I’m not sure this is what you had in mind. I just tried it with Avisynth using ImageWriter filter and combined with it some music. Then I load it into VirtualDub and save it as avi.

    TS
    Quote Quote  
  5. Get Slack disturbed1's Avatar
    Join Date
    Apr 2001
    Location
    init 4
    Search Comp PM
    ffmpeg -loop
    http://ffmpeg.mplayerhq.hu/ffmpeg-doc.html

    doing what oldcpu posted is great for short slide shows, but the process is long and tedious. IMO mpeg2enc is higher quality than ffmpeg, but ffmpeg is 5x quicker.
    Linux _is_ user-friendly. It is not ignorant-friendly and idiot-friendly.
    Quote Quote  



Similar Threads

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