in

andy vt's tools & blog

automating lazy

Slow Mencoder encoding

Last post 04-04-2009 3:08 PM by babgvant. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 03-29-2009 1:13 PM

    Slow Mencoder encoding

    I've set up a profile based on the  "Microsoft's WTV to DVRMS Converter for FW" profile.  My steps are:

    WTV to dvr-ms using WTVconverter
    dvr-ms to mpeg using ffmpeg
    scan the mpeg commercials using comskip and write an edl
    run mencoder to convert to avi, telling it to auto-skip commercials.

     So far, everything actually works perfectly as far as the step-by-steps go.  However, using mencoder I am only getting  3-5 fps on the encode.  It took about 6 total minutes for the whole profile to convert a 12 second clip.  Extend that to a whole show, and I'm looking at around 6 hours to encode a 30 minute show.

    Is this because I'm using mencoder to encode from an mpeg instead of a dvr-ms file, or something else entirely? I think I remember reading this was a specialized mencoder build.  Would just replacing the mencoder .exe with fix this?  I've tried to run comskip on the dvr-ms files spit out by the converter, but it always hangs, hence why I am converting to mpeg first.

    For reference, using handbrake or autogk on a normal DVD usually takes about 1.5 times the length of a movie on my computer, so I don't think its a horse power issue.

     

    Aside from that, would it be easier to use mencoder to cut out commercials and convert mpeg to mpeg, then just call an external program, and if so, any advice on how to do that?  I think I could figure it out over time, but any help from the crowd would be appreciated.

    Filed under: , , , ,
  • 03-30-2009 11:30 AM In reply to

    Re: Slow Mencoder encoding

    How fast does mencoder run from the command line?
  • 03-30-2009 11:53 AM In reply to

    Re: Slow Mencoder encoding

    Is ffmpeg any faster?
  • 03-30-2009 12:19 PM In reply to

    Re: Slow Mencoder encoding

    Actually, I'm just an idiot.  I forgot to click "quiet" mode for mencoder.  That made everything blaze.

    However, it did freeze when I left it on overnight.  I told it to skip commercials using mencoder during the encode, but it locked up dvrmstoolbox at some point.  I'm going to try it with commercial skipping off and seeing if it makes it all the way through.

    But right now, I have everything working up until that point.  I'm thinking about calling mpgtx after I run comskip, ripping out the commercials, then encoding that using mencoder, but that may require regex, which I am quite unfamiliar with.

    The steps so far are:
    Throttle
    Get Video information
    Set context of input and output
    Rename WTV to processingfile
    Convert WTV to dvrms using WTVconverter
    Rename WTV and dvrms to Show - Title
    Delete WTV
    Set Context of dvrms and resulting tempmpeg
    Convert dvrms to mpeg using ffmpeg
    Delete dvrms
    Scan tempmpeg using comskip
    Write to xml
    Mencoder to AVI, good quality, using edl file
    delete tempmpeg

    I guess I could delete the "write to xml" and replace it with calling mpgtx, but would I have to set the context again?  The way mpgtx works, it reads the comskip .txt output, then renames the non-cut mpeg to "mpegname_original.mpg" and saves the resulting cut file as "mpegname.mpg".  Would I need to use the set context in that instance, since the file name I encode using mencoder stays the same?

  • 04-02-2009 10:18 AM In reply to

    Re: Slow Mencoder encoding

    First a question: is there a list of metadata kept in dvr-ms files?  Like there is %Title%, %WMOriginal...%... I ask because I want to know if it is possible to rename files to "Title - Season#Episode#" 

     Second, Just an update. I now have a batch file that does just about everything outside of dvrmstoolbox. I'll post it here one of these days, but I'm having some weird no-sound issues every few files.

    Steps I have (I run it on my recorded TV folder using task scheduler at 11:15 every night):
    Convert .wtv to .dvr-ms
    Delete .wtv
    Throttle dvrmstoolbox, get video info, rename .dvr-ms to %Title%, convert .dvr-ms to .mpg using ffmpeg
    Delete .dvr-ms
    Scan .mpg using comskip, output .txt and .edl
    Cut commercials using comclean - mpgtx edition (I think this is where the audio issue is coming from, going to try cutterman)
    Delete *_original.mpg files
    Delete .edl
    Delete .txt
    Convert .mpg's to .avi files using handbrake's ffmpeg commands (using xvid by itself gave me extreme file sizes)

    I tried mencoder, but even using a newer build optimized for my CPU, the converting was excrutiatingly slow.  Handbrake does it almost real-time on my computer (fairly old)

    I'm pretty sure that cutting the commercials causes weird things to happen with my audio.  I ran it on some 2 minute clips, and it worked great (although the audio seemed a little out of sync but it was a kids show... so I never know about the audio with those).  I ran it on LAO: SVU Tueday night before adding in the handbrake stuff, and there was no audio in the resulting mpg.  I ran it last night, and Better Off Ted ended up disappearing altogether at some point, I think one of the delete commands was a little over-zealous.  And on the Lost recording, I think it missed some commercials, because the resulting .avi was an hour and 2 minutes,.  However, I didn't hear any sound.  Turns out I had the speakers on the wrong output, but I deleted the file, thinking the same thing happened as happened on Tuesday night.

     I'll post the batch and more detailed instructions once I get everything working near 100%.  Right now it's slightly over 50% good.

     

  • 04-02-2009 10:48 AM In reply to

    Re: Slow Mencoder encoding

    This is the most useful tool I've found to play with dvr-ms metadata. http://blogs.msdn.com/toub/archive/2005/05/12/416874.aspx
  • 04-02-2009 11:31 AM In reply to

    Re: Slow Mencoder encoding

    You seem to have a lot of extra steps in there, but I have to confess, I'm not entirely sure what your end goal is.  I think it's that you want to take a WTV input file, cut out the commercials and create an AVI.  Is that right?

    If so, I would just use DTb and ffmpeg.

    1. Convert WTV->DVR-MS
    2. Scan DVR-MS for commercials
    3. Have DTb remove the commercials from DVR-MS
    4. Use ffmpeg to convert to AVI

    If you need to use Handbrake, then you could convert the commercial-free DVR-MS file to MPEG first, but I don't think that's going to save much time.

  • 04-02-2009 12:31 PM In reply to

    Re: Slow Mencoder encoding

    That is right.  WTV to AVI

    I agree its a round-a-bout way of doing it, but for some reason, comskip always fails when I run it on the dvr-ms file I create using the wtvconverter.exe.  It didn't matter if I used the version in the dtb setup package or an external version, it always just freezes/fails.  I assume it is specific to my machine.

  • 04-02-2009 12:38 PM In reply to

    Re: Slow Mencoder encoding

    Interesting - did you report it to Erik?

    http://www.kaashoek.com/comskip/index.php

  • 04-04-2009 3:08 PM In reply to

    Re: Slow Mencoder encoding

     why not convert to mpeg?  the audio streams from wtv are non-standard, so they can cause problems.

Page 1 of 1 (10 items)
@2008 andy vt
Powered by Community Server (Non-Commercial Edition), by Telligent Systems