Page 1 of 70 1231151 ... LastLast
Results 1 to 15 of 1041

Thread: MUX'ing, VSplit, and MPG2 files.

Hybrid View

  1. #1
    Join Date
    Jan 2002
    Posts
    4,809

    MUX'ing, VSplit, and MPG2 files.

    Ok. This is the second new Thread I am going to create. This thread is most definately a discussion of how to produce to mux'ing/working/finished/finalized/ready-to-use MPEG2 files.

    Further it is to be a place where we can all trade ideas, discuss code and applications, be it for the Tivo or just for MPEG2 in general. However there are some rules for this thread.

    Just like before these are rules for this thread, not the forum. If you want to discuss things deemed off limits here make your own threads and set your own rules. But if you decide to participate here then please follow the guidelines.

    So the rules for this thread are:

    1- Leave the flames and arguments elsewhere... Again I am interested in getting things working better and moving forward, not a re-hash of the problems covered in other threads. So here be nice or stay out.

    2- We discuss ANY tools dealing with mux'ing or viewing or editing MPEG2 files or TyStreams... But let's focus on things that are built for TiVo output as this is a Tivo Forum. I am not the only one working on this, and while I intend to have my discussions of things here I have no arguments again others doing the same. If you find a tool that is better that any you have seen before, then share.

    3- NO DISCUSSION OF EXTRACTION. This thread is about MUX'ing and making working MPEG2 files. To do that you have to have elementary streams. So no matter how you get them you have to have them before coming here with ideas or problems.

    4- Feel free to discuss various OS wishes/desires. At some point we should support all of them or at least as many as is possible.

    5- Let's limit the discussion of VSplit to how it interracts with MUX'ing rather than usability or general feature set. We have to discuss VSplit as it is the core of my current MUX'ing engine. Also in the works is a MUX'er for exisitng VSplit output that will stitch it all back together as appropriate for a tivo file that can be done long after the a/v split has been done.

    6- Feel free to ask for features but be aware that I am making no promises except to work on things in general... I mean it. Ask. But don't hound me or any other author, that accomplishes nothing. If you think of something that would be cool let me know. I will add it to the list.

    I would like this thread to be about the previously mentioned "technical amazement" rather than usability in my tools, ExtractStream, etc... That is what the other thread and this forum is for. Here if you find something sweet dealing with MUX'ing/editing then let's all talk about it and move forward in getting to that "perfect" point where everyone is happy.

    The technical discussion of the mux'ing and what is going on behind the scenes will be held in here. Some don't care about it. If all you want to discuss is tools for extraction/splitting then go to the other threads.

    So if anyone has things on their wish list for MUX'ing now is the time and this is the place.

    --jdiner

  2. #2
    Join Date
    Feb 2002
    Posts
    363
    Obviosly everyone wants muxing in a hope that it will eliminate audio/video sync problems. Has any progress been made with the timestamps and how the tivo handles them?
    Last edited by RxMan; 08-22-2002 at 07:24 PM.

  3. #3
    Join Date
    Jan 2002
    Posts
    4,809
    Yes. I have had timestamps perfected for a long time. That is why the A/V split via my VSplit code works "perfectly".

    There are some having problems with it, but as I explained before, that is an issue with the mux'ing mechanism getting off rather than problems with VSplit.

    Once before I mentioned some facts. I have not kept up on them so they are old. But I have had right around 20,000 prefectly split streams reported to me. I myself have done about 300 since January that were perfect.

    I use this information in my mux'ing and things stay just as expected. Sync'ed all the way through. Right now I just have to fix the PES streams I am generating and the first cut at mux'ing should be usable.

    --jdiner

  4. #4
    Join Date
    Dec 2001
    Location
    Seattle, WA
    Posts
    174
    I have been playing with burning SA extracted files to DVD. My goal is to cut out the commercials so that I can fit 4 "1 hour" 3,500kps episodes on a single 4.7Gig DVD.

    I've been using DVDMaestro for authoring. I can extract elementry stream using vsplit. That works great. If I use those streams and go strait to DVD, everything stays in sync. If I run them through and editor (M2edit has been what I use most) the audio always drifts.

    The last stratagy I tried was triming out 5 pieces which represented the show without the commercials. Then I placed the 5 clips back to back to form a single move in Maestro. Maestro will create a single audio file from a group of clips (and even has a switch to keep them in sync). This function only works on AC3 files.

    So I used BeSweet to convert the .m2a files from vsplit into 48k ac3 files. That worked, but the sync was hopelessly lost. Loading the m2a file and the ac3 file into an editor (Goldwave is my favorite) showed they were clearly a different length (even after accounting for the 32k to 48k upsample).

    It seems like a simple trim using M2edit should produce a single file with good sync. I'm not sure why it doesn't.

    So my question is this: What should I expect from muxing? Will the fabled muxing version of vsplit add some kind of information to the program stream which will let m2edit (or mpeg-vcr or whatever) not get out of sync? I'm starting to wonder if I've been waiting for the wrong tool.

    Comments?

  5. #5
    Join Date
    Jun 2002
    Location
    Silicon Valley, CA
    Posts
    199
    Everybody seems to be looking to muxing as the holy grail of A/V Sync. But as far as I can see it's really only going to introduce additional unnecessary steps.

    While the basic entry-level packages will accept multiplexed MPEGs, most of the high end stuff requires elementary streams. So having split our streams and multiplexed them we have to demux again before we can use them, with all the hassle that entails.

    On the other hand there are plenty of perfectly good tools that will take elementary streams and multiplex them to form program streams. If we have good, synched elementary streams we will get good synched program streams. GIGO.

    We all want accurate sync God knows how many times I've tried to make perfect Max Headroom discs but is muxing really the best/only way to do it? Would it not make more sense to improve the way that the splitter tools handle the raw tystream so that hopefully we don't get bad sync in the first place? And at the same time maybe we can fix some of the other stream handling problems. I've got several instances of streams that I can't use but play fine on the TiVo. I'm getting about a 90% success rate on extraction.

    So in my opinion it would be a more sensible use of resources to try and better understand and decode the tystream.

    BUT having said that I'm not the custodian of the knowledge and the tools, so if this is the direction that development is heading then I'll be happy to help if I can.
    Last edited by scarabus; 08-22-2002 at 09:07 PM.
    SVR 2000 running 3.0 with 1x160Gb and Lifetime Sub
    SAT-T60 running 3.1 with 1x250Gb and Turbonet over 802.11

  6. #6
    Join Date
    Dec 2001
    Location
    Montreal, Canada
    Posts
    288
    The reason why we are all waiting for the muxing is because a lot
    of us have edited commercials out of shows we recorded with a
    capture card and we never had any A/V Sync problems after editing
    out commercials. So we are inclined to think that maybe the way
    we mux right now is not perfect.

    If i transcode the streams with TMPGEnc and i check the box that
    says to create a GOP structure suitable for editing, i have no
    problems. But obviously i don't want to waste TIME and QUALITY
    transcoding the streams i get off the TiVo... It beats the purpose
    of me getting a TurboNet to not have to record from TiVo to
    my capture card.

    So i will continue to hold my breath for a perfect Muxed stream
    that can be edited by ANY MPEG-2 editor.

    Pr.Sinister

  7. #7
    Join Date
    Jan 2002
    Posts
    4,809
    Originally posted by FreydNot
    I have been playing with burning SA extracted files to DVD. My goal is to cut out the commercials so that I can fit 4 "1 hour" 3,500kps episodes on a single 4.7Gig DVD.
    That pretty much sums up my goals as well. Pretty much perfectly in fact.


    I've been using DVDMaestro for authoring. I can extract elementry stream using vsplit. That works great. If I use those streams and go strait to DVD, everything stays in sync. If I run them through and editor (M2edit has been what I use most) the audio always drifts.
    The problem is, as I mentioned a long long time ago in thread far away, that MPEG-2 is a very very... forgiving spec. Things that are perfectly legal are honestly... a bad way to do it. The much tighter specs used for a DVD force limits that make recovery after bad data much much easier.

    For instance. In MPEG-2 it is possible and strictly speaking legal to have hundreds of Frames (I, B, or P) in a single Group-Of-Pictures (GOP). For a DVD standard spec is fixed at either 16 or at 18 if I remember the spec correctly. Anything other than the exact number is just plain not in the DVD spec.

    Now since most modern DVD players are also built to play VCD and SVCD disks this is not a problem. For most as long as it is a valid MPEG-2 file, not just a DVD spec file, it is playable. In my slightly modified APEX-600a player you can play just about anything right up to and including muddy-water.

    Back to the point... The drift most people are running into is a simple matter of "assumptions". The MPEG-2 editors I have tested all have assumptions about not only what is legal but what form and layout it will be in. The output of a tivo TyStream is NOT INVALID, make no mistake about that. But for whatever the reason it is seriously "non-standard". When the assumptions get in the way you get errors.


    It seems like a simple trim using M2edit should produce a single file with good sync. I'm not sure why it doesn't.
    While I can't answer this definatively having not written this tool... I hope I have provided some answer to this questions.


    So my question is this: What should I expect from muxing? Will the fabled muxing version of vsplit add some kind of information to the program stream which will let m2edit (or mpeg-vcr or whatever) not get out of sync? I'm starting to wonder if I've been waiting for the wrong tool.
    Yeah. Once you build all of the absolutely correct information into an mpeg stream m2edit appears to edit it perfectly. At the moment the size of the file has bloated a bit to get to this stable point but it does work.

    Now all the normal caveats... It works for me. Your mileage may very right up to the point of complete failure. But since it does work for me on what I am doing it is reasonable to expect that at some point soon it will work for you.

    As for waiting for the wrong tool. Keep in mind that this is all steps:

    Step 1 - Getting a good mux produces files that can be played on a PC without errors.

    Step 2 - Expand this fix so that it can be played on a DVD/VCD player either as a VCD/SVCD disk or a DVD disk.

    Step 3- Add the promised, and somewhat fabled, visual GOP editor. This will allow the cutting of commercials and other things from the Tivo streams. The output of this will either be a single mpeg-2 file that is everything but what is cut, or a set of files broken on each cut point...

    Step 4 - Extend the mux'ing output file format to be a DVD... crap. I forget the name of the DVD record format for a single "block" on the disk. Anyway, so that what is produced is directly burnable with no processing by other programs needed.

    This is what I intend to do. If this fits your needs, then someday soon you will have what you need. If not, then keep looking elsewhere or suggest to me another step that will work for what you need.

    --jdiner

  8. #8
    Join Date
    Jan 2002
    Posts
    4,809
    Originally posted by scarabus
    On the other hand there are plenty of perfectly good tools that will take elementary streams and multiplex them to form program streams. If we have good, synched elementary streams we will get good synched program streams. GIGO.
    If you have a stream that VSplit does not produce a good split on then send me a copy of it. And I will fix vsplit. But please before we get to that point prove to yourself that it is really not splitting correctly.

    Do the following as exactly as possible since it is what I do to prove such things:
    1- Grab VirtualDub's latest version. Grab WinAmp's latest version.

    2- Grab DVD2AVI version 1.74. And the related VFAPIConv program.

    3- Get Vsplit. The latest version is old now but still the latest.

    4- Run the TyStream through VSplit.

    5- Check the size of the audio and video to make sure you really have a file for each of about the right size. Video+Audio file size should be 95% or so of the size fo the TyStream itself. Also check the output VSplit to make sure no "real" errors were reported.

    6- Check the audio file in WinAmp by playing part of it.

    7- Check the video file in WM or some other player to make sure it is playable.

    8- Reconfigure WinAmp to play to an output file and send the output there.

    9- Load the video file into DVD2AVI and with NO configuration changes save a project with it.

    10- Convert the project to a "fake avi" with VFAPIConv.

    11- Load this "fake avi" into VirtualDub. Set the video compression to RGB uncompressed. This is technically "no compression". Since we won't be making a output AVI this is fine if we were the file size would be massive.

    12- Open the audio file. And set the sync with the Audio Interleaving option.

    13- Play it at very start of the file and make sure A/V lip-sync is correct.

    14- Then seek to whatever location in the files you wil and play starting there. And watch for sync. I have done this countless times with tons of test clips. (Each of the 300 clips I have done for my own archives I have done exactly this with to remove commericals...)

    That's it. For me sync is perfectly maintained.

    What can can sync to get off in the above process:

    1- The biggest culprit is the audio compression. For some unknown reason, unknown to me because I have never ever looked into and have no plans whatsoever to do so, if you compress audio into MP3 format to make it smaller (which I do) it gets off. The playback speed of the MP3 audio stream is actually off. You can correct for this and maintain sync.

    2- If you use a video compressor depending on the type and strength of compression the sync can be lost as well. Frames sizes to large? I have no idea I just know that it happens. Neither DivX nor XVid have ever gotten off for me, but some of the others have during testing...

    These are the only 2 culprits I know of.

    I meant it when I said use the above. I know there are a ton of other tools that can be used at each step. But I can't predict the interraction of the programs or any bugs/problems they might introduce. So use the above, if it is still off you have found a problem I have not seen before. If it is on you are suffering from the same problem as everyone else when it comes to dealing with the elementary streams themselves and having the software MUX them.



    We all want accurate sync God knows how many times I've tried to make perfect Max Headroom discs but is muxing really the best/only way to do it? Would it not make more sense to improve the way that the splitter tools handle the raw tystream so that hopefully we don't get bad sync in the first place?
    If you have found a problem in a TyStream not related to a bad extraction directly, i.e. you got it all or to an emu/hack card that once before was just randomly dropping chunks and VSplit fails on it then I can fix it once I get the TyStream itself.

    So run the above and we can decide on a direction to move in at that point.

    --jdiner

  9. #9
    Join Date
    Jun 2002
    Location
    Silicon Valley, CA
    Posts
    199
    Originally posted by jdiner
    If you have a stream that VSplit does not produce a good split on then send me a copy of it. And I will fix vsplit.
    I have several. See my response in your other thread.

    I'll be happy to snail-mail the streams to you on DVD - send me a PM with an address to mail to.

    Alternatively I can FTP them if you have a site with enough storage. It'll probably take the same length of time :-/


    Originally posted by jdiner
    So run the above and we can decide on a direction to move in at that point.
    I will do that thing.
    SVR 2000 running 3.0 with 1x160Gb and Lifetime Sub
    SAT-T60 running 3.1 with 1x250Gb and Turbonet over 802.11

  10. #10
    Join Date
    Jan 2002
    Posts
    4,809
    Originally posted by scarabus

    I have several. See my response in your other thread.

    I'll be happy to snail-mail the streams to you on DVD - send me a PM with an address to mail to.

    Alternatively I can FTP them if you have a site with enough storage. It'll probably take the same length of time :-/
    Yeah. That is why I want you to use the TyFileSplit tool I wrote. It will let you identify a single small block that has a problem. 20 meg is easy to upload if you have a decent link. If not then dvd is probably best.

    --jdiner

  11. #11
    Join Date
    Jun 2002
    Location
    Silicon Valley, CA
    Posts
    199
    For the benefit of everyone else you can find TyFileSplit
    HERE
    SVR 2000 running 3.0 with 1x160Gb and Lifetime Sub
    SAT-T60 running 3.1 with 1x250Gb and Turbonet over 802.11

  12. #12
    Join Date
    Feb 2002
    Posts
    363
    I guess I am a little confused. Is TyFileSplit different than using TyTool in VSplit mode? I have one file that has sync issues. I still have the file on my Tivo so I can extract again and follow the steps above if necessary. Just let me know if there is a difference and I will proceed.

  13. #13
    Join Date
    Jan 2002
    Posts
    4,809
    Ah ok. To try and clear that up as people might get confused.

    All that TyFileSplit does is split a TyStream file into a smaller valid TyStream file. I.e. it stays on the byte-count correct boundries etc...

    It does not do the A/V split just cuts something that can then be processed later. Namely by me when looking for problems.

    Using split in both names might have been a bad idea...

    --jdiner

  14. #14
    Join Date
    Jun 2002
    Location
    Was Frozen North now Sunny South
    Posts
    351
    Originally posted by jdiner
    ...
    14- Then seek to whatever location in the files you wil and play starting there....That's it. For me sync is perfectly maintained.

    What can can sync to get off in the above process:

    1- The biggest culprit is the audio compression.
    Uff da! 14 steps, wow. Here are 4+ steps that work for me, noting I have an SA and need to convert audio (you're right of course about audio compression as a key problem):

    1. Mux the m2a and m2v files using MPEG2VCR. If the streams are "off" it may take a couple tries to get the AV sync right (quick though, as a "try" need only take 10-20secs to output enuf program to check sync), but it's done here, right up front.

    2. If there's any trimming to do, I use MPEG Cutter from Canopus, remember my audio is still 32kHz.

    3. Import the resulting trimmed mpg to MPEG2VCR again, this time use "Record" and set Audio to 48kHz (if for DVD) or 44.1kHz (if for SVCD), and change audio bitrate also if you like, but this results in the export taking a little longer.

    4. Test! Done! Burn w/Nero or import to SpruceUp to author a DVD. This whole process takes only a few minutes for an hourlong program; MPEG2VCR is really fast, fast, fast both for muxing and for transcoding audio. Still, for a movie I do walk away from it and do something else for a while.

    Note that MPEG2VCR has mpg-cutting ability, but altho I have waxed eloquent about this tool in another thread, alas I've discovered that if you use IT to cut it results in audio drift. I can only think that while Canopus' tool cuts on I-frames, and MPEG2VCR appears to NOT, that this somehow is hosing the audio. Also note that converting the audio before cutting doesn't work--sync is lost again. So I leave the audio alone until the very end.

    It is the case for me now that the lengthiest part of the creation process is the transfer from Tivo-to-PC over my 10baseT Tivonet board. These other steps have become almost trivially easy, tho occasionally I find a pair where it's difficult to find the audio "sweet spot" especially for the music programs I'm archiving.

    A final caveat is that while the above allows front-and-back trimming, it does not allow (or I have not found out how to do) excising from within e.g. to cut commercials. But an easy thing for me to do, if for example I want to save two songs from a Sat. Nite Live, is to cut each song out of the same muxed (again 32kHz) file and save them separately, and import each separately to MPEG2VCR to transcode the audio.
    Philips Standalone v3.01 w/2-80G drives and Tivonet.

  15. #15
    Join Date
    Dec 2001
    Location
    TV Shows!
    Posts
    159
    Originally posted by laserfan
    Uff da! 14 steps, wow. Here are 4+ steps that work for me, noting I have an SA and need to convert audio (you're right of course about audio compression as a key problem):
    The 14 steps is to prove the sync from vsplit was perfectly maintained. It's not the process that we usually would do.

    I've never have sync problem with my SA. I only have the sync problem very occasionally with my DTivo. (This is a DTivo forum, not SA. Please don't compare apple and orange here. )
    Last edited by Wes; 08-23-2002 at 03:58 AM.

Posting Permissions

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