in

andy vt's tools & blog

Automating lazy

Transcoding video for the iPod

Last post 11-30-2007 5:05 PM by jelwood. 97 replies.
Page 3 of 7 (98 items) < Previous 1 2 3 4 5 Next > ... Last »
Sort Posts: Previous Next
  • 06-08-2007 11:06 PM In reply to

    Re: Adding transcoded videos to iTunes

    I installed ffdshow rev 601 dated 12/01/2006.  There appears to be a stable beta version that is much more recent, but since it's beta I wasn't sure.  Rev 601 didn't fix the problem.  It still hangs (loops) on convert with graph step... I assume it should be stopping at 100% conversion, for me it goes well past 100% and I cancel it.  Is there a log for ffdshow that I can look at to see what it is doing?  I've never used ffdshow before so I'm not familiar with it.  I also have the mixer set to 2/0-stereo.  I also reinstalled AVIVO

    Any other ideas?  I love your tool, but can't seem to get it to work anymore. 

  • 06-09-2007 4:56 AM In reply to

    • babgvant
    • Top 10 Contributor
    • Joined on 10-03-2006
    • Chicago, IL

    Re: Adding transcoded videos to iTunes

    the progress #s aren't gospel when using ffdshow
  • 06-09-2007 5:41 PM In reply to

    • Coyote
    • Top 10 Contributor
    • Joined on 10-10-2006
    • Maryland

    Re: Adding transcoded videos to iTunes

    They aren't, but I'ver never seen it go over 100% unless it was stuck. Most of my conversions hit complete around the 20% mark.

    If you're still getting stuck graphs, I'd recommend re-extracting the package. Delete all  files in the DTb install with "ipod" in the filename, then unzip  the .zip from this thread into the DTb program dir. That should replace the export_to_ipod profile with one that has my (known working) filter settings.

    Don't use the latest .zip in this thread unless you have DTb 1.1.0.5/1.2.0.7 (it needs the new version of RunExternal)
     

  • 06-13-2007 3:25 PM In reply to

    Re: Adding transcoded videos to iTunes

    I just donated to get access to 1.1.0.5.  hopefully after i install that and reinstall your package it will work.  I'll let you know.  FYI, I installed the "Fun with Avivo" download and that conversion with avivo.grf works fine.
  • 06-14-2007 10:57 PM In reply to

    Re: Adding transcoded videos to iTunes

    And there was much rejoicing.  I installed DTb 1.1.0.5, your zip from the top of the thread, ffdshow rev 610, and AVIVO and it works... most of the time.  I'm still getting a few errors in the graph, but those errors are specific to a few files.

    Here is the error I'm getting on these suspect files. 

    Convert DVR-MS with an explicit graph
    Loading C:\Program Files\DVRMSToolbox\avivo_ipod.GRF into IGraphBuilder
    Loaded .grf file
    Setting graph output file to 'C:\Documents and Settings\All Users\Documents\iPod TV\Gene Simmons Family Jewels_AETVP_07_05_2007_01_30_03.mp4'
    0%
    .07%
    .13%
    ...
    3.66%
    3.73%
    Error: Toub.DirectShow.DirectShowException: Error in Do Work - The operation completed successfully ---> System.Exception: Error in Do Work - The operation completed successfully ---> Toub.DirectShow.DirectShowException: The operation completed successfully
       at Toub.MediaCenter.Dvrms.Conversion.Converter.RunGraph(IGraphBuilder graphBuilder, IBaseFilter seekableFilter)
       at Toub.MediaCenter.Dvrms.Conversion.Converter.RunGraph(IGraphBuilder graphBuilder)
       at babgvant.AdvancedActions.GraphConvertor.DoWork()
       --- End of inner exception stack trace ---
       at babgvant.AdvancedActions.GraphConvertor.DoWork()
       at Toub.MediaCenter.Dvrms.Conversion.Converter.Convert()
       --- End of inner exception stack trace ---
    Converted file
    Duration = 00:00:56.1562500
    Delete the file in Context["CutDvrmsFile"]
    Duration = 00:00:00
    Run c:\windows\system32\cscript.exe "c:\program files\dvrmstoolbox\scripts\addToItunes.js" "C:\Documents and Settings\All Users\Documents\iPod TV\Gene Simmons Family Jewels_AETVP_07_05_2007_01_30_03.dvr-ms" 3 "Gene Simmons Family Jewels" "Snowblind" "2007-04-22T00:00:00.0000000-07:00"
    Microsoft (R) Windows Script Host Version 5.6
    Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
    Duration = 00:00:05.1875000
    Total Duration = 00:04:46.921875

    Also, the Add to iTunes script doesn't appear to be working.  iTunes opens up, but nothing gets added.  I'll review this thread and see if this problem has been discussed.

    Thanks for your help Coyote, your add-in is awesome.

    One suggestion - you might want to add links at the top of the thread to the ffdshow and AVIVO download sites.  Part of my original problem (I think) was using what I thought was current versions of these, but they weren't.

  • 06-14-2007 11:39 PM In reply to

    • Coyote
    • Top 10 Contributor
    • Joined on 10-10-2006
    • Maryland

    Re: Adding transcoded videos to iTunes

    Oops, you found a bug!

    AddToItunes is being passed a "filename.DVR-MS", not the .mp4 it actually has.
    I personally run a modified version, so I didn't catch it.

     I'll upload a fixed version and add the AVIVO/FFdshow links to the top post.
     

  • 06-16-2007 1:55 AM In reply to

    Re: Adding transcoded videos to iTunes

    Hey, I added value!  I hate being a sponge, now at least I contributed something.

    In your .zip I saw you updated the export_to_ipod.cmd file.  I ran the conversion again and the log still shows the "output.dvr-ms" file being passed to the script, which doesn't get added to iTunes.  The filename and directory are correct for adding the file to iTunes, but the file extension is still wrong.  I'm running 1.1.0.5 on XP and using the GUI.  Eventually I'll use FileWatcher to automate it.

     

  • 06-16-2007 8:16 AM In reply to

    • Coyote
    • Top 10 Contributor
    • Joined on 10-10-2006
    • Maryland

    Re: Adding transcoded videos to iTunes

    Did you place the export_to_ipod.cmd from the updated zip in c:\program files\dvrmstoolbox\scripts\ ?

    I just ran it myself and it works:

    Setting graph output file to 'd:\Users\Public\DvrmsToolbox\Output\\The Daily Show With Jon Stewart_COMEDY_14_06_2007_22_58_05.mp4'
    conversion complete
    Converted file
    Duration = 00:02:58.2288270
    Delete the file in Context["CutDvrmsFile"]
    Duration = 00:00:00.1132740
    Run c:\windows\system32\cscript.exe "c:\program files\dvrmstoolbox\scripts\addToItunes.js" "d:\Users\Public\DvrmsToolbox\Output\\The Daily Show With Jon Stewart_COMEDY_14_06_2007_22_58_05.mp4" 3 "The Daily Show With Jon Stewart" "" "2007-06-14T00:00:00Z"
    Microsoft (R) Windows Script Host Version 5.7
    Copyright (C) Microsoft Corporation. All rights reserved.
    

     

  • 06-17-2007 4:50 AM In reply to

    Re: Adding transcoded videos to iTunes

    I did.  I just copied it again to make sure and I'm still getting the dvr-ms file used when the script runs.

    Setting graph output file to 'C:\Documents and Settings\All Users\Documents\iPod TV\Real World-Road Rules Challenge_MTVP_16_06_2007_08_58_02.mp4'
    conversion complete
    Converted file
    Duration = 00:03:53.6562500
    Delete the file in Context["CutDvrmsFile"]
    Duration = 00:00:00.0156250
    Run c:\windows\system32\cscript.exe "c:\program files\dvrmstoolbox\scripts\addToItunes.js" "C:\Documents and Settings\All Users\Documents\iPod TV\Real World-Road Rules Challenge_MTVP_16_06_2007_08_58_02.dvr-ms" 3 "Real World/Road Rules Challenge" "Inferno 3" "2007-05-29T00:00:00.0000000-07:00"
    Microsoft (R) Windows Script Host Version 5.6
    Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

    The Run step in the profile is configured as:
    Process Name: c:\windows\system32\cscript.exe
    Arguments Context: "c:\program files\dvrmstoolbox\scripts\addToItunes.js" "%OutputFile%" 3 "%Title%" "%WM/SubTitle%" "%WM/MediaOriginalBroadcastDateTime%"

    I think that is correct. 

    The convert with graph step creates the correct output file, but when the run script step in the profile gets executed, the %OutputFile% is the correct directory and filename, but the wrong extension.
     

  • 06-17-2007 7:30 PM In reply to

    • Coyote
    • Top 10 Contributor
    • Joined on 10-10-2006
    • Maryland

    Re: Adding transcoded videos to iTunes

    OK, that's odd. Either 1.1.0.5/XP handles output filenames decidedly different than 1.2.0.7/Vista, or you' might not be running the same profile... Try replacing export_to_ipod.dpc with a fresh copy from the zip. Make sure it goes into the profiles dir of the DTb install.

    Try running that profile from the GUI, giving it a DVR-MS as in input and the same filename w/ a .mp4 extension as the output (can be in any dir). What happens? That should simulate the batch file.

    If that worked properly, edit the export_to_ipod.cmd to remove the @echo off line. That way you'll see the batch file being executed.

     
    BTW, nice user icon. Your cats?
     

  • 06-18-2007 11:24 AM In reply to

    Re: Adding transcoded videos to iTunes

    Those are my cats, Henry and Floyd.  Not the smartest animals in the world, but very adorable.

    I tested a bunch of different things and here is what I came up with.

    1) When running the profile from the GUI and setting the output file to filename.mp4, the whole process works correctly.

    2) When running the batch file export_to_ipod.cmd, the whole process works correctly.

    3) When running the export_to_ipod.dpc profile using FileWatcher, I still get the wrong filename in the java script step.  It seems like when running the profile using FileWatcher, the output file extension isn't getting updated after the graph conversion.

     

  • 06-18-2007 3:59 PM In reply to

    • Coyote
    • Top 10 Contributor
    • Joined on 10-10-2006
    • Maryland

    Re: Adding transcoded videos to iTunes

    That's because filewatcher always specifies a .DVR-MS extension for the output file. What's happening here is that the convert action is producing a file with the .mp4 ext specified in the action, but OutputFile still has a .DVR-MS extension.

     I never tested FileWatcher compatibility because you can't run this from FileWatcher in Vista (FW as a service can't interact with iTunes)

     I'll see if there's a workaround for the file ext problem, and I'll try running FW as a tray app to test it.

  • 06-18-2007 4:27 PM In reply to

    Re: Adding transcoded videos to iTunes

    I know a little bit of javascript programming and did a little hack to change the extension in the AddToiTunes.js file.  Here's my file.  It isn't the most elegant solution, but it does work.

    /*
        addToiTunes.js <filename> [video type: 1=movie 2=music video 3=tv show] [Show] [Episode Title] [Episode ID]
    */

    var    iTunesApp = WScript.CreateObject("iTunes.Application");
    var    mainLibrary = iTunesApp.LibraryPlaylist;

    var file;
    var videoKind;
    var show;
    var title;
    /*
       new vars to change the file extension
    */
    var filenamelength;
    var filename;

    if(WScript.Arguments.length > 0){
        file = WScript.Arguments(0); }
       
    if(WScript.Arguments.length > 1){
        videoKind = WScript.Arguments(1); }

    if(WScript.Arguments.length > 2){
        show = WScript.Arguments(2);
        title = WScript.Arguments(2); }

    if(WScript.Arguments.length > 3){
        title = WScript.Arguments(3); }

    if(WScript.Arguments.length > 4){
        epid = WScript.Arguments(4);
        if (title=="") {title=epid;} }

    /*
       find the index for the extension, truncate, than concatenate the correct extension
    */
    filenamelength = WScript.Arguments(0).lastIndexOf('.') + 1;
    filename = WScript.Arguments(0).substring(0,filenamelength) + "mp4";

    if (file) {
     var opStatus = mainLibrary.AddFile(filename);
     while (opStatus.InProgress){}  //wait until done
     track = opStatus.Tracks.Item(1);  //quick and dirty!
      if (videoKind){
        track.videoKind=videoKind; }
     if (show){   
        track.Show=show; }
     if (title){
        track.Name=title; }
     if (epid){
        track.episodeid=epid; } 
     iTunesApp.UpdateIPod();                
    }

  • 06-18-2007 7:45 PM In reply to

    • Coyote
    • Top 10 Contributor
    • Joined on 10-10-2006
    • Maryland

    Re: Adding transcoded videos to iTunes

    I fixed it in the profile: There's now an action to s/dvr-ms/mp4 in the context OutputFile

    Download the updated zip and extract /profiles/export_to_ipod.dpc to your profiles dir.

     

  • 06-19-2007 1:45 AM In reply to

    Re: Adding transcoded videos to iTunes

    Ufda.  Here's a new twist.

    I've been restarting FileWatcher while I've been testing the profiles and when I restart it, it runs under my account.  When I do that, everything works fine - files get converted, added to my iTunes library, the whole nine yards.  Perfect.

    However, since I'm not always logged on, FileWatcher should run as a SYSTEM service.  When I do that, the AddToiTunes.js script adds the file to iTunes under the iTunes user LocalService, which is an empty iTunes library.  My iTunes library doesn't get updated.  I looked through the iTunes Windows SDK for a user or account method that could be set when executing UpdateIPod(), but didn't see anything.  If there is a way to set the user account for iTunes it would be doubly cool, because then I could create profiles to add some files to my wife's iTunes library, some to mine, and some to both of ours.

    I'll look around the SDK some more tomorrow, but now I need some sleep.
     

Page 3 of 7 (98 items) < Previous 1 2 3 4 5 Next > ... Last »
@2008 andy vt
Powered by Community Server (Non-Commercial Edition), by Telligent Systems