VideoHelp Forum




+ Reply to Thread
Results 1 to 9 of 9
  1. issue:
    i have a CD collection and want to import them into a database on cd pc to be able to print labels
    Manually inputting my CDs would be too much work :P So I look for a way to automate this.

    I want an applescript (with cocoa app if necessary) which appends info of a move to a text file when a CD is inserted:
    so
    - look for CDs with 1 big avi
    - extract codecs used (this is what I cant get done without opening QT/VLC and playing/opening the movie)
    - lookup info on IMDB based on title
    - enter info into "database" (could be a text file)

    So what Im looking for now is
    a) a complete solution (advice appreciated)
    b) an automated (non-gui) way to extract codecs used !!!

    Thanks for any help,
    Regards,
    Dominik
    Quote Quote  
  2. Member terryj's Avatar
    Join Date
    Sep 2002
    Location
    N35°25.24068, W097°34.204
    Search Comp PM
    Ok,
    I'm not understanding because you are kinda talking about
    CDs, wich i assume are Video CDs? or Audio CDs?
    and then you switch to talking about AVIs?

    If all you want is a way to:

    -Catalog your CD collection
    -Print label containing all the information stored on the discs
    on the label
    -A simple few clicks ( and a drag and drop) to catalog

    then I would reccommend Disktracker 2.3 from Portents,
    avaialble here.

    You can with it:
    create a catalog, drag and drop the disk onto the catalog,
    it will scan it, give you a complete listing of what's on it,
    and then you can print a label for the cd with that info
    on it.

    If you want to know what codecs are used on each file
    of an avi, and create a database of that, well AFAIK,
    that still is a (somewhat) manual labor process.

    Informator may be a way, Grabby MP maybe another,
    but both cost $$$ so I really don't know....
    "Everyone has to learn, so that they can one day teach."
    ------------------------------------------------------
    When I'm not here, Where can I be found?
    Urban Mac User
    Quote Quote  
  3. I don't know of any complete solution, but your b):

    ffmpeg -i /path/to/file

    (note that this will case an applescript error because ffmpeg wants to convert out to something, so it errors, and so will your applescript. You can write it out a text file and read that in - something like "ffmpeg -i /path/to/file &> ~/Desktop/vidEval.txt") ffmpeg is available embedded in a lot of shareware products - you can use those binaries easily to do it. You'll get something like this:

    Input #0, avi, from '/path/to/file':
    Duration: 00:25:37.8, start: 0.000000, bitrate: 1068 kb/s
    Stream #0.0: Video: mpeg4, yuv420p, 352x288, 25.00 fps
    Stream #0.1: Audio: mp3, 44100 Hz, stereo, 111 kb/s

    The other program that would work is tcprobe (part of transcode - I don't think its available in pre-compiled form, but I compile from source, so I don't really search out for it):

    tcprobe -i /path/to/file
    [tcprobe] RIFF data, AVI video
    [avilib] V: 25.000 fps, codec=DX50, frames=38445, width=352, height=288
    [avilib] A: 44100 Hz, format=0x55, bits=0, channels=2, bitrate=111 kbps,
    [avilib] 38102 chunks, 21337120 bytes, CBR
    [tcprobe] summary for /path/to/file, (*) = not default, 0 = not detected
    import frame size: -g 352x288 [720x576] (*)
    frame rate: -f 25.000 [25.000] frc=3
    audio track: -a 0 [0] -e 44100,0,2 [48000,16,2] -n 0x55 [0x2000] (*)
    bitrate=111 kbps
    length: 38445 frames, frame_time=40 msec, duration=0:25:37.800
    (where 0x55 actually represents which audio codec is used - which must be mp3)
    ---------------------------
    You can see from the above examples: ffmpeg makes the video codec a generic mpeg4 (DX50 is a divx 5 codec), whereas you'd have to convert 0x55 (I think the others are 0x20 for aac and 0x50 for mp2) with tcprobe. Any attempt I made to use mplayer or VLC to get the info caused the file to actually start playing, but I didn't try to hard either; mencoder happily started to convert to my $HOME folder.
    Quote Quote  
  4. thanks for the extensive help!
    Not as easy as I wished but ok
    Quote Quote  
  5. I think there may be another shortcut. You use ffmpeg to get at the audio codec. That's relatively easy. Comes ready to use after you parse it out.

    You can do this to get at the video codec with nothing readily available: "head -1 /path/to.avi" in Terminal.app, and you'll see all kinds of ugliness, but you can parse it out. This command isn't perfect (it butchered 1 file as lhXV), but if you chop off the last part of the command then you can use Applescript's:

    ignoring case
    if some_thing contains "xvid" then --matches "XviD", "lhxviDJUNK"...
    set my_codec to "xvid"
    else if (some_thing starts with "DX") or (some_thing contains "DX") then
    set my_codec to "divx"
    end if
    end ignoring

    here is the heinous shell script:
    head -1 /path/to.avi | tr -cd "[:alnum:]" | awk -F "strf" '{print $2}' | sed 's/^[0123456789]//g' | awk -F "LIST" '{ print $1}' | colrm 5 -1

    Note: you'll have to escape the quotes in applescript when you try to "do shell script" on that line.

    It's still not easy, but you'll eventually pick up the knack.
    Quote Quote  
  6. ok. had exams last week so couldn't test it before.
    Now that I did serveral problems arose:

    a) ffmpeg does not write the info to file using the > "file":
    It does write its version number etc. but the info about the file is just on the console (using build from ffmpegX)

    b) the head | sed command also fails as it does not print either DX or XVID - it shows 0XVI so maybe it is just the offset?

    thanks really appreciate the help!
    Quote Quote  
  7. look for "bunch of output" http://developer.apple.com/technotes/tn2002/tn2065.html
    ---------
    no, I said to leave off the last bit (so drop the colrm 5 -1). okay, so try transcode - seems that ffmpegX has a pre-compiled tcprobe binary inside. You can use:

    /path/to/transcode -i /path/to.avi
    Quote Quote  
  8. thanks got it all working now!
    I wrote an applescript to run as a folder action and detect codecs/title of avis on cds inserted.
    The question is: can In which 'DVD database software' can I easily import it? (Any recomendations on this would be awesome, too. It should offer IMDB lookup and custom fields AND !export as CSV to be able to print using neooffice/j.)

    Thanks,
    Dominik
    Quote Quote  



Similar Threads

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