View Full Version : ? Re-encoding Just Part of a Video


Synetech
23rd January 2008, 02:48
Hi,

I’ve got a bunch of videos that just barely fit on a disc, so I need to cut them down by just a little. I cannot cut anything out, but the beginning and end of each video is unimportant, so I would like to re-encode those parts to a lower quality/bitrate. Is this possible? How?

Thanks.

20-40
23rd January 2008, 10:49
Such cutout I do on three ways:
1. In case if I use Avisynth I put a line at the end of avisynth script
Trim (1500,3000)
for example, to re-encode just range of frames 1500-3000.
If I need exact part, I fed such .avs in VirtualDubMod and after SetSelectionStart and SetSelectionEnd I open Tools>ScriptEditor and choose InsertFramesAsTrims under Edit tab.

2. I use plain VirtualDub and do SetSelectionStart & End part. Delete that section. The rest I re-encode to avi.

3. I use any video editing tool at my disposal (depending on platform I use), or directly tell to encoder which frames (-ss and -endpos switch /time based/ in mencoder or similar in many encoders).

Not to forget, I sometimes use VirtualDubMPEG2 to do the same case of some mpeg2.

At last, regarding your question (previous part was for wandering lurkers&newbies); same as you've said, I do not usually cutout the beginning (audio synch. problems), but I usually cutout the very end. If I don't want cut the latter, then I add Zone 1 in Xvid VfW codec options (using the start frame-number previously discovered), and choose some low quality higher Quant ratio (5 or 7) for specific zone (frames range).

Synetech
23rd January 2008, 19:28
I do not usually cutout the beginning (audio synch. problems), but I usually cutout the very end.

That’s the first time of heard of that. Is it common? Instead of cutting out the beginning, could I just save the part I want using the set beginning/end markers without sync problems or is that effectively the same thing?

20-40
23rd January 2008, 22:39
In such case, I recompress the audio in PCM, then make it sure that this avi with PCM audio is in perfect sync (sometimes play with +/- audio delay helps)… after that, any editing goes well…

Anyhow, I am the cause of such troubles, because four, five years ago I was stupid enough to use VBR mp3 as audio, and combined with Fraunhofer "chunk" bug, few audio tracks cannot be "repaired", edited or properly cut. Some clips I left "as is", but with hard work and additional effort anything could be done.

Synetech
23rd January 2008, 23:14
I find that when VirtualDub warns about a sync problem I can just use Nandub to cut it instead without problem.

20-40
24th January 2008, 09:54
Rarely, I use Nandub too, when I need just cutting and not any processing and/or re-compression. Nandub was first VDub mod with workaround for mp3.
I also use some older version of vdub-mp3-freeze.exe that someone has written in early days of SBC encoding… nowadays pretty obsolete, as Nandub is…

blizard
24th January 2008, 15:59
Hi,

I’ve got a bunch of videos that just barely fit on a disc, so I need to cut them down by just a little. I cannot cut anything out, but the beginning and end of each video is unimportant, so I would like to re-encode those parts to a lower quality/bitrate. Is this possible? How?

Thanks.


Your problem seem more adequate to use AVIDemux (http://forum.doom9.org/showthread.php?t=126164). This link point to a section on doom9 which pretty much explains what it is and how to use it. I recommend to mark start with A and end with B and then set Copy for both audio and video, set container to AVI or MP4 (MKV is still not stable from what I have heard).

With copy mode there is no need to re-encode an already compressed video and audio. AVIdemux create an IDX (index) file where you can cut out section (use start point A and end point B - cut - and now you have only those section left that you want to save (this is change made to an index file -file with extension idx in created in same folder as your media file - will be read for encoding, original video is still the same).

I think you will find AVIDemux is more easy to use then VirtualDubMod as you don't need to use vfw interface and it contains most tool for encoding and filter in one package. It does not have problem with some type of mp3 audio like VDM. You will need to download DTS library as that have to do with some licences restriction which make it hard to include in an open source package for AVIdemux.

If AVIdemux crashes there is a possible way to avoid to re-set everything each time, by use of project file. Create one before you want to start your encoding process and all change in filter, encoding and editing are kept after a crash. (Look in menu for file>project and what is below that point!)

Synetech
25th January 2008, 20:26
Your problem seem more adequate to use AVIDemux (http://forum.doom9.org/showthread.php?t=126164). This link point to a section on doom9 which pretty much explains what it is and how to use it. I recommend to mark start with A and end with B and then set Copy for both audio and video, set container to AVI or MP4 (MKV is still not stable from what I have heard).

With copy mode there is no need to re-encode an already compressed video and audio. AVIdemux create an IDX (index) file where you can cut out section (use start point A and end point B - cut - and now you have only those section left that you want to save (this is change made to an index file -file with extension idx in created in same folder as your media file - will be read for encoding, original video is still the same).

I think you will find AVIDemux is more easy to use then VirtualDubMod as you don't need to use vfw interface and it contains most tool for encoding and filter in one package. It does not have problem with some type of mp3 audio like VDM. You will need to download DTS library as that have to do with some licences restriction which make it hard to include in an open source package for AVIdemux.

AVIdemux sounds pretty good. I’ll give it a try now. Thanks.