View Full Version : Video Editing (preferrably .MPG)

12-10-2002, 03:17 PM
I suppose the answer to my question is buried in another thread but I thought I'd start new thread to cover this topic specifically so that other users could find answers to this specific issue in the future more easily without sifting through some of these long MUXING threads.

I've gotten some great results using TyTool, VSplit, and MPLEX to arrive at a clean .MPG file. Now, I'm looking for a way to edit the video.

I'm not so concerned with editing out the commercials as much as trimming the front and tail end of the recording. TiVo doesn't always start/end on time so the editing I'm most concerned with involves cleaning up the beginning and ending of my clip(s),

The software I've tried for editing is total crap.

MovieShaker (which came bundled with my SONY VAIO) says that my .mpg files cannot be used. No further info is givien.

ArcSoft ShowBiz (which came bundled with my HP DVD burner) allows me to pan through my video but I don't think it will actually let me delete portions of it.

What is the best editor out there for editing video clips, preferrably .mpgs?

12-10-2002, 04:46 PM
If all you want to do is trim the beginning and end of the extracted tystream, you don't need an editor. Tytool provides options for setting the initial jump point in a tystream to begin the extraction/splitting process. You can also set the length of the extracted file. I do this all the time if I have multiple shows that are just a bit too large to fit all of them on a single DVD. I tend to start my recordings at least a minute or two early so as not to miss the beginning of the show. Sometimes the total lengths exceed the capacity of the disc so some trimming is required to make them all fit.

The best way to do this is to extract the entire show in tystream mode. Once you've got the show extracted to your drive, select the parse file option and split the entire show. You will need the txt file that is generated to estimate where your trim points will be. I use SpruceUp and DVD Patcher for viewing the extracted files. The process can get a bit tedious but it does work and, with a bit of practice, can be quite accurate. I will assume that your recording was set to start one minute early for this example. Adjust the values for longer or shorter durations of video to be trimmed.

Since the show has been split when the txt file was produced, patch the 1st header to 720X480 using DVD Patcher and import the m2v file into SpruceUp. You'll get the error message indicating a problem with the last segment of audio. Ignore this message and close the message window. A 2nd error message may be displayed (this will occur in most cases) indicating that an error has occurred and SpruceUp will then close. If it doesn't and the file shows up in the movie window, go ahead and close SpruceUp anyway. Repatch the 1st header back to 480X480. Open up SpruceUp and import the m2v file back into SpruceUp. Right-click on the video file and select clip properties. Use the slider under the preview window to move along the time line and see where you want to clip the video. The slider will move in large segments of about 15 seconds if you try to move it with the cursor. Use your cursor arrows to move it in 1-second increments in either direction. Note the amount of time from the beginning of the clip that you want to make your cut. Then, note the amount of time from the beginning that you want to make your 2nd cut. Finally, note the total time of the clip by moving the slider all the way to the right.

At this point you can delete the m2a, m2v and the two .prv files, but do not delete the .txt file. You may want to rename the txt file to something else to prevent any conflicts because you're going to do some further extractions and tytool will try to generate a new txt file with the same name. The easiest thing is to move the txt file to your desktop or some other directory other than the one being used for extraction. Now we're ready to begin the trimming process.

Open up Tytool and set the initial jump point (Options menu, Set Initial Jump option). Enter a value in chunks and close the window. Start with a value of about 150. Select the Parse File option and select the tystream to be split. The splitting process will begin but the counter will not increment in the window until you get to chunk #150; the file size counter, in MB, will increment normally. Let the counter get to about 200 chunks and then close Tytool. Patch the m2v file, import into SpruceUp, let it crash, repatch, and import it again. Check the results using the clip properties to see how close you came to your trim point. You'll probably still be a bit short but much of the beginning of the file will have been trimmed away. Note how much more time you need to trim and, doing a little math, calculate how many chunks correspond to how many seconds you need to trim. Delete the split files, including the new txt file, and do it again, this time using the new jump point you just calculated. Check your results and see how close you came. Repeat as many times as necessary until you get it as close as you want it. Record the final jump point as you will need this for the final extraction.

12-10-2002, 04:47 PM
I couldn't fit the entire post in one window so here's the rest of it. Using the values calculated for the initial jump point, calculate a value, in chunks, to trim the time off the end of the file. Check the original txt file and note the total number of chunks extracted for the entire show. Subtract the value you just calculated for the amount to be trimmed off the end from this total number of chunks. Open up Tytool and set the initial jump point to the value you previously determined. Now, select the Set Length option from the Options menu. Enter the length of the clip (total length minus trim length at end) in this window and close the window. Select the Parse File option and select the show to be split. This part gets tedious as you will have to extract the entire show each time you need to check it until you get it where you want it. Split, patch, import, etc., and then check the results to see where your trim points occurred and make any necessary adjustments.

Trimming the beginning of the file is relatively quick and easy since you only have to split a small portion of the show to check your work. Hopefully, if your math is good and the amount of compression used for the show is somewhat consistent for the entire file, you shouldn't have to go through the entire process too many times. It's not as neat as using an editor but it does work and no multiplexing is required. I've gotten to within 1 second at the beginning of the clip and could have gotten it finer but I felt it was close enough for what I needed at the time. You should be able to get it even closer with one or two more passes. You can still multiplex the finished file but you will have eliminated the extraneous video from both ends of the clip.

12-11-2002, 01:17 PM
I know that jaja was "not so concerned with editing out the commercials as much as trimming the front and tail end of the recording", but just in case someone else whose reading this is....

here's another way if your wanting to cut commercials....

Use tytool to extract the raw ty file.

Use jdiner's newest vsplitmux,
...currently vsplitmux-1n,
and convert just the first 100 chunks.
(vsplitmux1n -l100 "yourvid.ty" "yourvid.mpg" "temp.m2a")

Play the resulting mpeg in your favorite software dvd player and see if the point where you want to cut is within the first 100 chunks.
If not, grab the next 100 chunks:
(vsplitmux1n -j100 -l100 "yourvid.ty" "yourvid.mpg" "temp.m2a")
...btw, this will overwrite the first file.

Play the resulting mpeg in your favorite software dvd player and see if the point where you want to cut is within that 100 chunk section.
If it's not in that section, move on to the next:
(vsplitmux1n -j200 -l100 "yourvid.ty" "yourvid.mpg" "temp.m2a")
...and so on until the part you want to cut is within the 100 chunk mpeg section.

Once you find your first point, note on the player slider where it is in the 100 chunk mpeg file. ie. if the point where you want to make the cut is half way through, then make the next conversion start point +50. Let's say you found the first point halfway through the second 100 chunk pass, then start the next conversion at 250. ie:
(vsplitmux1n -j250 -l100 "yourvid.ty" "yourvid.mpg" "temp.m2a")

If you still see video before the point where you want to make the first cut then add 10 or so chunks and try again. ie:
(vsplitmux1n -j260 -l100 "yourvid.ty" "yourvid.mpg" "temp.m2a")

..or if you've gone past the point where you want to make the cut, take 10 off. ie:
(vsplitmux1n -j240 -l100 "yourvid.ty" "yourvid.mpg" "temp.m2a")

Once you've found the starting point, then you can process more than 100 chunks to find the end point. Let's say the point where you want to start the cut is at 243 chunks, then:
(vsplitmux1n -j243 -l1000 "yourvid.ty" "yourvid.mpg" "temp.m2a")
..and play the resulting mpeg to see if the point where you want to end the cut is within the next 1000 chunks. If not, add 100 or so chunks and try again.

If the point where you want to end the cut is within that 1000 chunk section, reduce the amount of chunks processed until you find the end point you want.
I've found that I can get it to make the cuts within one half of a second or better in most cases.

Once you get the cuts where you want and have the first section complete, then rename the resulting mpeg to "yourvid1.mpg" and do the same procedure to get the second section, starting after the point where you stopped the last time, and so on...

For most shows that have commercials you won't find a section between commercials that's more than 2000 chunks long, so the 2000 chunk limit of vsplitmux-1n does not matter.

Once you have all the sections you want, you can play them in a playlist or use tmpegenc to join them together.

I did the first 7 episodes of Enterprise perfectly this was the other day on a amd 1800+ and could do one complete in about 20min. YMMV

As both camps are working on editing in a future release, I hope that this will be a moot point very soon. I hope!

12-11-2002, 03:06 PM
Fugg's method outlined above is basically the same as the one I use but instead of using DVD Patcher and SpruceUp to view the extracted segments, he's using vsplitmux to allow it to be viewed using a different codec. It's pretty much a matter of deciding where to begin the actual splitting of the tystream and bypassing the unwanted video at the beginning or the end of the recorded show. The rest is determined by how you want to process and view the results. Try them both and see which one works best for you. There are probably other methods for doing this that others have developed. I haven't had a chance to experiment with vsplitmux yet, mainly because I'm waiting for jdiner's final version that will permit editing of the tystream using a commercial editing program or one that he has developed.

12-11-2002, 03:14 PM
Well it sounds like I was right about editing out the commercials ... it's almost not worth the trouble. Fugg, a seasoned professional, spends 20 minutes editing each hour of Enterprise. That's not counting the TyTool, MUX'ing and Burning times!

This process of zeroing in on certain points can be referred to as binary interpolation (half of half of half, etc...). Even computer programmers agree that this is probably the simplest but slowest way to perform sorts and searchs.

Aren't there any easier/faster ways to do this editing?

For example, suppose the VSplit program marked points in the ty stream where black levels and sound levels went under certain thresholds. You could even say that these low levels must be maintained for a certain period of time to be considered a check point.

WOW! When making a DVD, this would help us with all kinds of things ... especially scene starting points for movies! Heck, with this type of process, why even cut out the commercials? When watching the DVD, you could simply hit the next scene button on the remote!

Sometimes, when I watch a really old video tape, I love watching the commercials. You can see what was on the local news year's ago. I actually have an OJ Simpson Hertz commercial on one of my original Next Gen tapes from the late 80s. Nickleodeon invented a channel called TV-Land where old shows aired with some of their original commercials.

To be honest, the primary reason we all want to put this stuff on DVD is for historical purposes anyway. How often are you going to watch those eipsodes of Mary Tyler Moore? The only time I've ever pulled out that tape was to show someone that Hellen Hunt once appeared as Murray Slaughter's 8 year old daughter! I wish I had that on DVD so I could jump straight to that scene instead of FF-ing and RR-ing the tape to death using binary interpolation.

12-11-2002, 05:12 PM
This is how I cut commercials.


I use vplsit, then mplex. Then over to TMPGEnc, using File->MGPTools, and use the cut and merge option.

The slowest thing about this is waiting for the new mpg to be created.

(Just to be clear, at this point I'm only doing SVCDs, but this should work any MPG)

hope this helps,

12-11-2002, 06:15 PM
Well... I do this ALLL the time, but .... viewer beware.

you didn't mention what source you are using. I NEVER try to edit anything from my DTiVo streams. Not because it's im possible, but time permitting it's impossible for me. I hate to say this for fear of being flamed.. I have a real life, that my wife controls. Anyway ...

I extract streams from my SA (Sony SVR2000) - modified record format to 480x480 - 2600bitrate 32khz audio - with Tytool5 - vsplit13c and upsample to 41khz audio using besweet, mplex to .mpg

then load into MPG2VCR 3.12 GOP fixer - 1st level, and record.

back into MPG2VCR and edit out commericails or trim left-right. Record again to .mpg and burn to SVCD using Nero, disable SVCD compliant. Play on Apex or compatible player.

you may want to do all this to DVD-R(W) me too. wait for jdiner to get editting tools working.... that's my plan.

I have other solutions for DTiVo -> DVDR(W) using IFOEdit , different thread.

12-11-2002, 06:55 PM
If you are dealing with SA Tivo and have resized it with Tivoweb to 720x480 use Maestro...It's Easy...



12-12-2002, 02:33 AM
Hey Fugg,

I do the same thing as you but before i test every 100 chunks,
i sift through the full mpeg to see what times the commercials
are at. Then i divide the number of total chunks by the total
seconds for the show and it gives me an approximate chunk
number to start at and an amount of chunks to mux. Makes
it easier to find what i want.

It's explained in detail with screen caps here :

How-To Remove Commercials from DirecTiVo shows (http://www.pailliere.com/jackknows/howto/commercialediting.html)


12-12-2002, 03:00 AM
Uh....somewhat off-topic plug for my links lists.

See the URL in my signature? Go there and browse the links lists.

The most applicable are probalby VirtualDub, AVISynth and the plug-ins to include stuff from Donald Graft (if you're wanting to clean up stuff) and the MPEG-2 "driver" at http://nic.dnsalias.com IF you are going to transcode. Sometimes this is a very good idea if the source is animation. See the filters at Donald's site for an explanation.

AFAIK, there are very few tools which will non-destructively edit MPEG-2 (meaning they don't change unaltered GOPs.) This is true even of the high-end pro stuff. jdiner has talked about intra-GOP conversion to a series of I frames (my fingers are crossed in anticipation.)

12-13-2002, 03:41 AM
I forgot to mention an offshoot fo VirtualDub that handles YV12 colorspace.

Combine it with MPEG2 loading (a la AVSynth) and you've got everything except the re-encoder.

Yes, I know this means you'll alter the original data. Sometimes that's a good thing.

In any event, there's lots more info here:


It's very possible (if not probable) complete MPEG-2 support will be completely available very soon.