Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: Extracting streams with VLC

  1. #1
    Join Date
    Feb 2002
    Posts
    285

    Extracting streams with VLC

    Now that we have some fantastic ty and vstream modules for VLC (thanks, Neal!), we can now use vlc to give us an mpeg fit for DVD, VCD and SVCD use!

    To convert a ty stream from the tivo via vstream, first download and install the ty and vstream modules for vlc on your platform. (Currently Win32, Mac OS X, and Linux x86 binaries are available, as well as source code.) Next, open a command prompt use the following command:
    Code:
    $ vlc -I rc tivo://tivo/123456 ':sout=#transcode{acodec=mpga,ab=224,samplerate=48000}:std{access=file,mux=ps,url=stream.mpg}' vlc:quit
    The #transcode part is the key. This example will give you a nice, standard mpeg-II audio track at 224kbps and a DVD-friendly 48kHz sample rate. For (S)VCD, you'll want to change that to ab=192,samplerate=44100. Want a nice AC3 stream? No problem! Use {acodec=a52,ab=384,samplerate=48000}. If you don't want to do any transcoding, just use 'sout:std{access=file...}'.

    To break it down:
    • the "-I rc" tells vlc to use the "remote control" interface, but really all we want to do is not start the gui.
    • tivo://tivo/123456 is the link to the stream you want to convert. If you don't have vstream, you can load a ty file (your_program.ty) or possibly even use an mfs_ftp link as well (ftp://tivo:3105/ty/123456.ty for example; this is untested).
    • The "sout:#..." line tells vlc what to do with the stream, and it's important to keep this line in quotes.
      • transcode tells vlc how to convert the audio (or video if desired)
      • std (or 'standard') tells vlc what to do with the stream, in this case save it to a file
    • "vlc:quit" tells vlc to, well, quit.

    You can even do full transcoding by specifying a video codec, ala vcodec=xvid,vb=800 (don't forget to change the muxer, too). This will obviously take a lot more processor time, though, whereas just transcoding the audio is pretty easy stuff for most pcs. For more transcoding options, check out http://www.videolan.org.

    Note for Mac OS X users: To use vlc from the command-line, you need to use the file that is burried within VLC.app. If you have VLC in your main Applications folder, your command-line will look like this:

    Code:
    $ /Applications/VLC.app/Contents/MacOS/VLC -I rc test.ty ':sout=#transcode{acodec=mpga,ab=224,samplerate=48000}:std{access=file,mux=ps,url=stream.mpg}' vlc:quit
    Now you can extract and convert streams to mpeg on the Mac! Thanks to tx413 for not only creating the necessary vlc modules, but also the idea to use vlc for converting the streams to standard mpegs with transcoded audio. My next project will be to create a java-based gui so that you can point-and-click extract your programs on any platform supporting Java and VLC.

    - Stealth Dave

  2. #2
    Join Date
    Jan 2004
    Location
    n.h. usa
    Posts
    958
    the first one didn't seem to work for me.. at least I couldn't find the file stream.mpg anywhere on my disk. Maybe you have to let it finish all the way.. also this seems impractical becuase it opens a player window and converts at actual speed so it will take forever to convert a movie this way.

  3. #3
    Join Date
    Feb 2003
    Location
    Texas
    Posts
    76
    Quote Originally Posted by lgkahn
    the first one didn't seem to work for me.. at least I couldn't find the file stream.mpg anywhere on my disk. Maybe you have to let it finish all the way.. also this seems impractical becuase it opens a player window and converts at actual speed so it will take forever to convert a movie this way.
    If it opens a player window, then something's not right on the command line. It should NOT open a player window, and the file should be produced quickly. My transcodes go anywhere from 10x to 60x the speed of the program, depending on what I'm doing.

    On windows, try using double-quotes around that big argument instead of single-quotes.

    Of course all of this can be done via the GUI if you like, but if you use the command line, it's easier to work it all into some sort of batch scripting. I think stealthdave's working on something in that direction.
    Last edited by tx413; 04-08-2005 at 12:48 PM.

  4. #4
    Join Date
    Jan 2004
    Location
    n.h. usa
    Posts
    958
    ok I changed single to double quotes
    now it start up.. creates an empty file and then crashes.. below is my crash log.

    here is the current batch file:

    D:\vlc>cat bs.bat
    vlc -I rc tivo://tivo1/187343 ":sout=#transcode{acodec=mpga,ab=224,samplerate=48
    000}:std{access=file,mux=ps,url=godfatheriii.mpg}" vlc:quit

    D:\vlc>
    Attached Files Attached Files

  5. #5
    Join Date
    Feb 2003
    Location
    Texas
    Posts
    76
    Quote Originally Posted by lgkahn
    ok I changed single to double quotes
    now it start up.. creates an empty file and then crashes.. below is my crash log.
    It's easier to tell what VLC was doing from one of its own log files. Can you add this into the command line
    -vvv --extraintf=logger
    before your "tivo" argument. It will generate a vlc-log.txt file. Send me that.

  6. #6
    Join Date
    Feb 2002
    Posts
    285
    Quote Originally Posted by lgkahn
    ok I changed single to double quotes
    now it start up.. creates an empty file and then crashes.. below is my crash log.

    here is the current batch file:

    D:\vlc>cat bs.bat
    vlc -I rc tivo://tivo1/187343 ":sout=#transcode{acodec=mpga,ab=224,samplerate=48
    000}:std{access=file,mux=ps,url=godfatheriii.mpg}" vlc:quit

    D:\vlc>
    So, I guess you're using Windows then?

    Okay, first, have you verified that you have vserver installed on your TiVo and that it's running properly? You can verify whether or not it's running by telnetting to your tivo and running "ps x | grep vserver".

    Once you've verified that vserver is running, can you play the stream from the gui? Try that, and also try running vlc with -vv as tx413 suggested.
    - Stealth Dave

  7. #7
    Join Date
    Jan 2004
    Location
    n.h. usa
    Posts
    958
    yes as I mentioned previously vserver works and I can do plist and play streams fine.. I will attach the logging info later tonight and post

  8. #8
    Join Date
    Jan 2004
    Location
    n.h. usa
    Posts
    958
    I figured out what was wrong your post is wrong on post 1 of this thread..
    it is missing the /ty

    the command should be this:

    start /wait vlc -I rc tivo/ty://tivo1/187343 ":sout=#transcode{acodec=mpga,ab=224,samplerate=48000}:std{access=file,mux=ps,url=godfatheriii.m pg}" vlc:quit

    not

    start /wait vlc -I rc tivo//tivo1/187343 ":sout=#transcode{acodec=mpga,ab=224,samplerate=48000}:std{access=file,mux=ps,url=godfatheriii.m pg}" vlc:quit

    then it works fine

  9. #9
    Join Date
    Jan 2004
    Location
    n.h. usa
    Posts
    958
    spoke too soon.. now it gets farther but freezes after a certain point 58 meg done ,with my godfather iii stream and just consumes close to 100% of the cpu here is the log
    Attached Files Attached Files

  10. #10
    Join Date
    Feb 2003
    Location
    Texas
    Posts
    76
    Quote Originally Posted by lgkahn
    spoke too soon.. now it gets farther but freezes after a certain point 58 meg done ,with my godfather iii stream and just consumes close to 100% of the cpu here is the log
    The log looks good; can't tell what makes it lock up. It could be the vstream or the demux. Can you extract the program using another tool and see if VLC will play / transcode the TY file?

    Sorry I can't give you any other help. If it's the stream, and I could take a look at it, I could fix that.

  11. #11
    Join Date
    Nov 2004
    Posts
    263
    $ vlc -I rc tivo://tivo/123456 ':sout=#transcode{acodec=mpga,ab=224,samplerate=48000}:std{access=file,mux=ps,url=stream.mpg}' vlc:quit
    That works on my SD-DVR40 running 4.0.1b to my XP Pro box but it locks up around 17mins when encoding. It actually locks up my PC and I have to reboot. The video is encoded up to 17mins but thats all I can do. Also the only way I can get this to run is within VLC.
    SD-DVR40/160GB/4.0.1b/superpatch/usb2/tytool/ms_ftp/tivowebplus
    HR10-250 (stock) as of 12-9-05
    HR10-250/superpatch/usb2/tserver/tivoweb
    DirecTivo R10 (stock)
    "Test drive"60GB/6.2/superpatch/usb2/tytool/hmo/extracted scrambled shows with kernel & tools found here.

    94Supra formerly TT now one T

  12. #12
    Join Date
    Jan 2004
    Location
    n.h. usa
    Posts
    958
    ok will pull the stream off using mfs_ftp

  13. #13
    Join Date
    Jan 2004
    Location
    n.h. usa
    Posts
    958
    same problem with stream on local disc so it must be the demuxer..
    here is the last part of the log..
    same as when on tivo notice the short PES there must be a problem in the
    error handling for that case..

    you want to look at it or you want me to post the stream on an ftp server somewhere .. it is 2.6 gig


    [00000269] ty demuxer debug: parsing ty chunk #428
    [00000269] ty demuxer debug: parsing ty chunk #429
    [00000269] ty demuxer debug: parsing ty chunk #430
    [00000269] ty demuxer debug: parsing ty chunk #431
    [00000269] ty demuxer debug: parsing ty chunk #432
    [00000269] ty demuxer debug: parsing ty chunk #433
    [00000269] ty demuxer debug: parsing ty chunk #434
    [00000269] ty demuxer debug: parsing ty chunk #435
    [00000269] ty demuxer debug: parsing ty chunk #436
    [00000269] ty demuxer debug: parsing ty chunk #437
    [00000269] ty demuxer debug: parsing ty chunk #438
    [00000269] ty demuxer debug: parsing ty chunk #439
    [00000269] ty demuxer debug: parsing ty chunk #440
    [00000269] ty demuxer debug: parsing ty chunk #441
    [00000269] ty demuxer debug: parsing ty chunk #442
    [00000269] ty demuxer debug: parsing ty chunk #443
    [00000269] ty demuxer debug: video rec type 0x0b has short PES
    [00000269] ty demuxer debug: parsing ty chunk #444

  14. #14
    Join Date
    Dec 2004
    Posts
    9
    Same as mine. Well, close. Reproducable every time.

    Output:
    [00000250] ty demuxer debug: parsing ty chunk #254
    [00000250] ty demuxer debug: Invalid record type 0x20
    [00000250] ty demuxer debug: Invalid record type 0x20
    [00000250] ty demuxer debug: Invalid record type 0x20
    [00000250] ty demuxer debug: Invalid record type 0x20
    [00000250] ty demuxer debug: Invalid record type 0x20
    [00000250] ty demuxer debug: parsing ty chunk #255
    [00000250] ty demuxer debug: Invalid record type 0x20
    [00000250] ty demuxer debug: Invalid record type 0x20
    [00000250] ty demuxer debug: Invalid record type 0x20
    [00000250] ty demuxer debug: Invalid record type 0x20
    [00000250] ty demuxer debug: Invalid record type 0x20
    [00000250] ty demuxer debug: video rec type 0x0b has short PES
    Segmentation fault
    Last edited by konfoo; 04-14-2005 at 12:35 PM.

  15. #15
    Join Date
    Dec 2004
    Posts
    9
    I looked at the ty demux source and it appears that p_block_in is being freed @ line 514 but reused @ 548, causing the segfault. I may be mistaken since I've spent about 2 minutes looking at the source.

    Edit see here for a fix:
    http://www.dealdatabase.com/forum/sh...936#post219936
    Last edited by konfoo; 04-14-2005 at 06:28 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •