VideoHelp Forum




+ Reply to Thread
Results 1 to 10 of 10
  1. Hi,

    we have about 5.000 different jpeg-files and 5.000 different audio-files (wav, vox and mp3). Each audio-file takes 30 seconds. Now we want to combine picture and audio to have a 30 seconds avi-file which we can broadcast.

    I think there are a lot of programmes to do it manually. But we are looking for a solution to automate the process. That is: jpeg.xyz gets the wav.xyz and will be the xyz.avi.

    Any ideas?

    Thank you very much.

    Klaus
    Quote Quote  
  2. Member
    Join Date
    Dec 2004
    Location
    Triptonia
    Search Comp PM
    Sounds interesting.

    It doesn't sound that easy either.

    You'd certainly need to be very specific about your goal before even starting to devise any sort of plan. If indeed you have a set of jpegs with a xyz.jpg name, each jpeg has it's corresponding audio file with the exact name xyz.mp3, your goal is to assign only a single picture to each audio and each audio is 30 seconds long, then this batch might constitute a very crude core to a solution using mencoder:

    FOR %%A IN (*.jpg) DO (mencoder mf://"%%A" -mf fps=1/30:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:aspect=4/3 -audiofile "%%~nA".mp3 -oac copy -o "%%~nA".avi)

    Of course there are certain problems.
    They may not be so conveniently named. Although I think you could batch rename. Maybe with ascending numbers or something.
    Do you really only want one frame for 30 seconds of audio?
    Creating an avi with 1 fps, i'd say, is far more attractive. Perhaps 1 frame per 2 seconds or 2fps. When doing that one problem that arises is having jpegs of various dimensions. You'd have to sort them to sets with similar dimensions, or batch crop/batch resize (probably both sort and process). There's plenty of software for that, I guess, but I think avoiding manual processing would be difficult or unwise.
    So then you actually have to create 5000 sets of jpegs. Perhaps someone could script something to randomly create the sets.
    Then there are 3 different audio formats. You'd probably want to convert all to mp3. For avi you'll need to.
    Then there is audio length. Are they all 30 sec exactly? Because video length sets avi runtime.
    I suppose one could script something so audiolength is read and is used to set framerate for each separate audio.

    Anyway.
    I don't script, I'd say I'm the manual type.
    If it were me I'd try and automate sections, still doing most of the work manually though to get exactly what I wanted.

    gl
    Quote Quote  
  3. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    I think Avisynth might be the way to go on this one. Will post a script in a bit.

    45tripp's idea is a good one, however.
    Quote Quote  
  4. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    Required:

    Avisynth 2.56 or later

    Your Source JPG Dimensions should be multiples of 4, preferably 8 or 16

    1) Download and Unzip http://www.wikiupload.com/download_page.php?id=122872

    2) Put files in same folder as your .JPG and Audio Files


    3) After Transcoding


    This is just a first try. Test it out with the enclosed JPG and MP3. Unless every audio track is exactly 30 seconds, it'll be more difficult to match the video frames.
    Quote Quote  
  5. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    EDIT - Updated to V2

    1) Higher Bitrates for the XVID encode
    2) Makes certain there is always at least 1 frame more Video than Audio.

    http://www.wikiupload.com/download_page.php?id=122872
    Quote Quote  
  6. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Since I kinda resurrected it, I'm partial to (S)VCD Stills w_Audiohttp://www.cornucopiadm.com/goodies/svcdstlnew.zip.

    I would do:
    1. JPEG --> MPEGstill using VCDEasy's Stills tool, which can batch a folder
    2. Audio --> MP2 using Audio2VCD tool (same site as VCDEasy) or -->MP3 using one of many tools (lame, etc). Also batchable.
    3. Mux -->MPG using TMPGEnc (no way to batch mux that I know of, though ) It'll be easier if they're both named the same...Use 1-4-All renamer, etc.
    4. Fix --> MPG Still+Audio using abovementioned tool (can be batched)

    No need for "video", much savings on filesize, compatible with MANY/MOST players. Audio can be any length.

    ********edit: only downside I see...can't easily FF/RW***********

    Scott
    Quote Quote  
  7. Member
    Join Date
    Dec 2004
    Location
    Triptonia
    Search Comp PM
    Nice.
    I wonder if the target audience is still around.

    Originally Posted by Soopafresh
    EDIT - Updated to V2
    1) Higher Bitrates for the XVID encode
    2) Makes certain there is always at least 1 frame more Video than Audio.
    1 second.

    Nice addition of wavinfo.
    I was about to suggest using the wave file size to set avi file length.

    Any idea why the resulting video shows borked runtime in media players?
    Were you trying to fix that with mencoder in v1, forcing idx?
    I think if encoding with super plain vanilla settings you get a lower bitrate, under 100kbps,
    but runtime is correct.
    How do you achieve target bitrate anyway?
    I've tried a few things but bitrate is never what you set it to.
    Setting seemed to be ignored.

    How difficult is it to create random subsets of 30-40 jpegs for each audio file and create an avi file with some motion; so you don't have to stare at the same babe or car for all 30 seconds of audio?
    Or perhaps add some style of visual effect on the single frame?

    ty
    Quote Quote  
  8. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    V3 Allows you to have input files up to six minutes in length. Also slightly resizes the image to be compatible with YV12 encoders.

    http://www.wikiupload.com/download_page.php?id=123826



    45tripp - Yeah, small issue with the muxing, although MPC reports correct playing time. I'll figure that one out next - maybe be the ffmpeg version? Yeah, 1 image over 30 seconds is pretty snoozy Sure, you can set it up to choose 3 pics at ten seconds each. Might have to change the logic (or lack of ) at the start of the script. At that point, a regular slide show app might be more fun, as the image transitions can be easily chosen.
    Quote Quote  
  9. Member
    Join Date
    Dec 2004
    Location
    Triptonia
    Search Comp PM
    Originally Posted by Soopafresh
    maybe be the ffmpeg version?
    I don't think so.
    Anyway. Going to loseless before xvid solves it.
    Also going straight to mpeg2.

    There seems to be a bitrate roof with this type of source.
    With xvid it won't go much over 400kbps. Also I find bitrate is just not customizable.
    Even with mpeg2 try as i may it tops out at ~2200kbps.

    Originally Posted by Cornucopia
    3. Mux -->MPG using TMPGEnc (no way to batch mux that I know of, though ) It'll be easier if they're both named the same...Use 1-4-All renamer, etc.
    soopafresh uses mplex command lines.
    should be able to batch with that.
    Quote Quote  
  10. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    Thanks a ton for figuring that one out! I'll mod it and post an updated script in a bit. Kinda wish the original poster was still around to try this thing out in real life.
    Quote Quote  



Similar Threads

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