Log in

View Full Version : edit m2v files


Russell
10th June 2009, 10:25
I have been muddling along converting my VHS to AVI files, then to mpeg2 (m2v).
I am using Virtual Dub having overcome my initial concerns about scripting for frame serving.
The project is basically topping and tailing episodes of a favorite show.
In order to edit the precise beginning and end of the episodes I have been editing the avi files in Virtual Dub, and to save the changes I have to save a new avi which often takes longer than the original capture.
What I would like to do is edit the m2v files, as these are smaller than the avi files it should (easy for me to say) be quicker to save the edited m2v files.
So is there an app out there which will edit an m2v file and save it back to m2v?
I am doing a sort of random selection depending on what VHS cassette is next in line, so until I know what I have got I am holding off converting to vob, so I can do that in some sort of order. I hope

Vitos
10th June 2009, 14:17
Google search for "mpeg cut" provided me with links to some programs in few seconds. I downloaded and tested one of them - Free Video Dub (http://www.dvdvideosoft.com/products/dvd/Free-Video-Dub.htm) - and it cut m2v file nicely. And I think it was faster than writing such long post... ;)

But remember that cutting mpeg stream won't give same precision you have when cutting uncompressed, huffyuv or DV compressed AVI file - you can only cut on keyframes (which for DVD compatible m2v files are inserted each 12-15 frames).

Russell
10th June 2009, 14:25
Hi Vitos,
Thanks for the link, and the advice.
Appreciated :D

setarip_old
10th June 2009, 18:58
@Russell

Hi!In order to edit the precise beginning and end of the episodes I have been editing the avi files in Virtual Dub, and to save the changes I have to save a new avi which often takes longer than the original capture.If you use the following procedure, saving the changes should take literally only a minute or two:

1)Load your original (DivX-compressed or otherwise) .AVI into VirtualDub
2) Set BOTH "Video" and "Audio" to "Direct Stream Copying"
3) Move slider to the starting point of the scene you wish to delete
4) From the "Edit" dropdown menu, select "Go to next keyframe"
5) From the "Edit" dropdown menu, select "Set Selection Start"
6) Move slider to the ending point of the scene you wish to delete
7) From the "Edit" dropdown menu, select "Go to next keyframe"
8) From the "Edit" dropdown menu, select "Set Selection End"
9) From the "Edit" dropdown menu, select "Delete frames"
10) Save with a new filename

Russell
11th June 2009, 02:03
Hi there,
Thanks for the advice, saved it to a notepad file for when I complete the next file.:goodpost:
Vitos,
I followed your link and was not impressed. The app could not see my m2v file and the download page was full of links for AVS software. Those people are dodgy. No offence intended, but I have had this computer locked once by one of their apps, and have found a lot of negative comments about their products and practices.

Russell
12th June 2009, 07:44
Hi setarip_old,
I tried the method you suggested and it took the same long period of time to save the avi.
One thing that is not working as described by the tutorial I am following is that despite setting Virtual Dub to create spill files it is creating one mammoth avi file, hence the time taken to save the edited files.
Perhaps it is because I am using NFTS instead of FAT 32, but whatever the reason I am creating one huge (around 35gb) avi file, instead of several smaller files. If it was splitting the files into no more than 2gb, editing the beginning and end and needing to re save only the first and last files would save some time, I think.
I give the app instructions on the size of the files, and where to put spill files but it doesn't do it. :confused:

setarip_old
12th June 2009, 09:09
The project is basically topping and tailing episodes of a favorite show.The directions I provided were based on the (logical) assumption that you had individual .AVIs for each episode. If that were the case, as I said previously, the desribed editing would take only one or two minutes per episode.

I have no idea what tutorial you are following, but I suspect you're either misintepreting some portion of it, or you are using a tutorial that's not applicable to what you're trying to accomplish...

CWR03
12th June 2009, 13:40
Perhaps it is because I am using NFTS instead of FAT 32, but whatever the reason I am creating one huge (around 35gb) avi file, instead of several smaller files.
Are you certain that you've set VirtualDub to direct stream copy mode? It sounds like you may have it in "Full proccessing mode," which outputs a larger file than the original in an uncompressed format. It should only take a few seconds since you're only copying a portion of the data from an existing file into a new file.

Russell
13th June 2009, 11:40
Okay, it seems some clarification is required, and another long post, so here we go ...
The tutorial I am following is this one http://dvdguide.ennik.com/ The writer suggests settings that work for him and does not go into long explanations of every possible menu choice in Virtual Dub, otherwise it would be enormous.
Virtual Dub is a capable little app which is very compact, but it would nice for a neophyte like me if it came with a pdf set of instructions. As it doesn' I am following the steps in the tutorial because dealing with video files is new to me and there is a whole new suite of jargon to be taken on board and comprehended.
The problem I am having with the time taken in saving edited files is from following instructions on the Doom 9 guide to post processing with Virtuual Dub where it mentions removing commercials. I don't have any commercials to remove but I do need to trim the beginning of each episode. The Avisynth script (and I initially found having to edit a script a little intimidating) that comes with the files that the tutorial is linked to allow me to trim the end of an episode, but not the beginning.
And yes I do have one single avi file per episode, as setarip_old suggests. The tutorial says avi files cannot be larger than ~2gb, and shows steps to save avi files in sizes no larger than 1.9gb. I have followed the steps, and created a path for the spill files (that is just one of many terms I had not heard of 2 weeks ago) but I get one avi file per episode, around 35gb. Once I trim the redundant opening frames I have to save as a new file, otherwise I can't save the changes. Or is there something wrong with my logic there?
It is entirey possible I may have Virtual Dub set in the wrong mode, as CWR03 suggests; but hard for me to know as I don't know what a lot of these settings mean. The editied file does end up being bigger, and takes longer to save, than the original capture, so this may be the mistake I am making. Perhaps CWR03 can suggests a series of steps to set up Virtual Dub for editing, and saving changes in a more efficient manner.
I am posting in the newbies section after all (Doom 9 was recommended in the tutorial I am using) so constructive suggestions would be appreciated.
I hope this has clarified what I am trying to do, and soothed any offence I may unintentionally caused.:confused:

TinTime
13th June 2009, 13:52
Once I trim the redundant opening frames I have to save as a new file, otherwise I can't save the changes. Or is there something wrong with my logic there?

There's something wrong with your logic :)

All you need to do is amend the Trim statement in your avs script, as per =3= step 3 in those instructions you're following. Where it says "save the file" it means the avs script and not a new avi.

Russell
14th June 2009, 05:47
Hi TinTime,
Sometimes it is good to be wrong :)
So, baby steps here, if I trim 100 frames from a file that is 32333 frames, I only need to edit the avs file to 32233 frames, and save that?
Seeing you seem to be able to cut through the chaff, you may be able to help with another problem I am having with that tutorial. I have successfully encoded a dozen files by the method described, using HC0.18.0.0. The last two avi files I have attempted to encode produce the following error message: "failed to start encoding, can't create process."
My script is fine, the save to locations fine, I am stumped. Another failure in logic somewhere?

setarip_old
14th June 2009, 06:06
@Russellbut I get one avi file per episode, around 35gbAgain, in VirtualDub:

Set BOTH "Video" and "Audio" to "Direct Stream Copying"

Vitos
15th June 2009, 13:06
Guys, you do realize that using Huffyuv codec will make even one episode enormous...? It takes so long to save such file not because VirtualDub is recompressing, but because HDD performance is the bottleneck. Unfortunately there is no "reference movie" in AVI Windows world, as in QuickTime MOV - but there is Avisynth.

Russell, make individual .avs scripts for each episode and use Trim function as TinTime suggested (entering in and out frames looking them in VirtualDub). You don't have to save trimmed clip to AVI file if you wan't to compress it with HCEnc - just feed the encoder with .avs file.

About that AVS software - I did not impress me either to recommend it to somebody, but it just popped up as one of the first search results - I hadn't used it earlier.

Russell
15th June 2009, 13:49
HI Vitos,
Thanks for the post.

Yes Huffyuv does make very large files, and all the tips on how to save edited files have not seen any reduction in the time taken to save edited files. HDD Performance may be the reason.

Presently I am trying out TPMGEnc and that allows me to set the trim frames in a way that seems to work better than AVISynth.

And yes AVS are best avoided. :)

Vitos
15th June 2009, 13:55
HI Vitos,
And yes AVS are best avoided. :)

But .avs quite the opposite, IMHO. :)
Meaning - I love Avisynth - of course.

Russell
15th June 2009, 13:59
Lol :)

TinTime
16th June 2009, 10:59
Hi TinTime,
Sometimes it is good to be wrong :)
So, baby steps here, if I trim 100 frames from a file that is 32333 frames, I only need to edit the avs file to 32233 frames, and save that?

Sorry, a bit late in replying here as you seem to be using TPMGEnc to trim. But yes, if you wanted to trim 100 frames from the beginning of your video then adding Trim(100,0) to your .avs script would do it.

Seeing you seem to be able to cut through the chaff, you may be able to help with another problem I am having with that tutorial. I have successfully encoded a dozen files by the method described, using HC0.18.0.0. The last two avi files I have attempted to encode produce the following error message: "failed to start encoding, can't create process."
My script is fine, the save to locations fine, I am stumped. Another failure in logic somewhere?

Can't help here I'm afraid - I've never used HCenc. An avs script error would be my first guess but as your script is fine I'm out of ideas.

Ghitulescu
16th June 2009, 11:42
I have been muddling along converting my VHS to AVI files, then to mpeg2 (m2v).
I am using Virtual Dub having overcome my initial concerns about scripting for frame serving.
The project is basically topping and tailing episodes of a favorite show.
In order to edit the precise beginning and end of the episodes I have been editing the avi files in Virtual Dub, and to save the changes I have to save a new avi which often takes longer than the original capture.
What I would like to do is edit the m2v files, as these are smaller than the avi files it should (easy for me to say) be quicker to save the edited m2v files.
So is there an app out there which will edit an m2v file and save it back to m2v?
I am doing a sort of random selection depending on what VHS cassette is next in line, so until I know what I have got I am holding off converting to vob, so I can do that in some sort of order. I hope

Cutting RAW capture is easier than cutting MPEG files. When the AVI is based on a intraframe codec, the cuts can be made with frame accuracy (the audio should also play along ;)). MPEG files couple a set of frames into one GOP and the simpler cutting programs cut the file at GOP ends. A "smart" software would decode and reencode the afected parts if you want to cut also within a GOP (like Womble MPEG).

There are also exceptions :p: an AVI might contain GOP-based codecs like MPEG-4 or a MPEG file has only I frames (some capturing programs do this).

Now, if you used a scene analyser that placed an I-Frame at scene changes, you can easily cut a MPEG file, because the cuts will always (actually it depends on how good the scene analyser was) be at GOP limits.

Unless you have I frames only m2v or at least one having markers at cut points, it is advisable to cut the captured AVI file and not the MPEG one.

Russell
16th June 2009, 16:12
Thanks to TinTime and Ghitulescu.:thanks:
The HC encoding error message is a bit or a worry. I readily admit to making the odd error in avs script, but it tells you when this is the case, when everything appears fine and it just won't do it then it is a puzzle. Though TPMGEnc is easier to use I am not convinced it is better overall. I am presently recording and converting animation and using that as my learning curve. Once done I want to move on to something with real people. and that will require better quality control.
May I ask TinTime what you use for encoding?
Ghitulescu, yes I think you are right in suggesting the cuts be made in the avi stage.

TinTime
16th June 2009, 21:32
May I ask TinTime what you use for encoding?

I encode to either AVC or VC1 using x264 and AVS2AVI respectively. Neither of which is particularly useful to you if you're making DVDs though.

You said that trimming frames with AVISynth wasn't working as well as using TPMGEnc. In what way? It should be flawless using AVISynth's Trim function. You could try an AVISynth editor such as AvsP (http://avisynth.org/qwerpoi/) to help with scripting.

CWR03
17th June 2009, 14:04
It is entirey possible I may have Virtual Dub set in the wrong mode, as CWR03 suggests; but hard for me to know as I don't know what a lot of these settings mean. The editied file does end up being bigger, and takes longer to save, than the original capture, so this may be the mistake I am making. Perhaps CWR03 can suggests a series of steps to set up Virtual Dub for editing, and saving changes in a more efficient manner.
This is probably the simplest setting to set: after you have made your cut-in and cut-out selections, click File > Save As..., and at the bottom of that window will be a drop-down menu that contains "Direct Stream Copy." From there you need only provide a filename.

TinTime
17th June 2009, 15:22
Russell, possibly you were opening your avs script in VirtualDub and saving as "Direct Stream Copy"? That would result in a large, uncompressed file. If this was the case you should open your source avi instead, not the avs script, if you wanted to save a new avi.

But this step is unnecessary if you use AVISynth to feed your encoder because Trim can top and tail your source on the fly.