|
|
| roeselpi |
| Posted: Jan 10 2013, 09:43 AM |
 |
|
Newbie

Group: Members
Posts: 2
Member No.: 35951
Joined: 10-January 13

|
hey there, i have been using virtual dub for a long time and have come to find it a useful tool. there is a site in the internet where i can record tv-programs that are broadcast in europe and partly in the usa. if you are a registered member you can click on record the tv-show and several hours after it has been recorded you can download it as a encrypted file. the encrypted file requires a decrypter that is available from this site (the whole service is free). after the decryption you have a *.avi file.
a movie will be anything between 600 and 900 MB in filesize (including commercials)
i open the file in virtual dub (current stable version) and hop from keyframe to keyframe looking for the commercials in order to mark the beginning of the commercials and the end of the commercials because i wish to cut them out of the file and then just basically re-save it as a smaller file because it is shorter and thus smaller.
i find the direct stream copy mode very usefull because it is fast, easy and usually is good enough.
sometimes however the beginning or end of a commercial just before the tv-show starts again will be inbetween keyframes. i then only have the option of cutting the keyframe before the commercial starts (the last few seconds of the tv-show) or just after the commercial has started (the first few seconds of the commercial are included). this is a bit of a bother because my intent was to cut the commercials out.
i know that i could use any other mode and that would do the trick but the downside is the filesize. a 3.5MB file turns out to become 650MB after a fast recrompress or full processing mode. that is just to large. just imagine a tv-show that is 600MB large would be recompressed then you would end up with a file that would be about 100TB large and that is just not an option for me. ... all i would like to do is cut out the commercials and save the same file without the commercials.
it must be possible to somehow make a plugin or and extension that allows you to shorten a tv-show ignoring the keyframes. where i just mark the beginning of the commercials and the end of the commercials by individual frames and then just execute the delete button and save the shortend version as a new avi file in the direct stream copy mode.
since it is not possible yet, i would like to ask all the great and clever developers to find some way of making this possible because it would be a great addition to such a great program like virtual dub.
i would upload a small testfile if required for developers to test on, or i would even test myself if someone would try to write some addition to make this work.
if you should have further questions or anything should be unclear about what i wrote just ask and i will try to elaborate.
bye. |
 |
| dloneranger |
| Posted: Jan 10 2013, 02:36 PM |
 |
|
Moderator
  
Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07

|
Ah, well there are a few things in your post that we should address
Using any other mode than direct stream copy, requires you to pick a codec from the list of installed codecs If you don't then the result is uncompressed video which as you've seen is very large Two of the most common codecs are x264 and xvid
You can in fact cut between keyframes but it's not as simple as direct stream copy mode To do that you have to a) pick a mode different from direct stream copy mode
tick 'smart rendering' in the video menu c) choose the same codec that's already used for the file d) configure it as closely as possible to match the existing file e) save the file f) check that the joins haven't come out all garbled
I'll just explain the why's of the limits on keyframes so you'll get an understanding of the process (and for anyone who googles)
In the video the images are made up from one complete starting picture - this is called a keyframe It's a complete picture, like a jpeg etc After that, every one of the following frames are just the changes from the frame before - until the codec decides to make a new keyframe So, each frame in between the keyframes are just little pieces of the picture, like a head moving slightly to the left They do it like this because it saves a lot of disk space to only record the changes
And that's where the cutting problem comes in In between the keyframes there isn't a complete picture to begin with
Smart rendering tries to get around this by working out what the first frame should be, and then recompressing everything up to the next keyframe - where it just starts copying the file You've got to match the origional compression settings though because the codecs have to think the entire video is the same when played back (Otherwise it's like a book that suddenly changes to a foreign language at page 3)
And that's also the reason why you can finish on any frame you like You've already got all the pieces needed to reconstruct the image up to that frame, and the rest can just be thrown away
If you can't match the origional codec, then you've got no choice but to recompress the video
There's information on x264 here if that's any use (where to get it and decent settings) http://forums.virtualdub.org/index.php?act...1157&hl=x264vfw
Hope that's of some help to you
-------------------- MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask Windows7/8 Codec Chooser All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3 |
 |
| roeselpi |
| Posted: Jan 11 2013, 10:54 AM |
 |
|
Newbie

Group: Members
Posts: 2
Member No.: 35951
Joined: 10-January 13

|
hi, first i would like to say thanks for all the information, i can understand why it does not work but would like to ask a further question to something you wrote:
| QUOTE | So, each frame in between the keyframes are just little pieces of the picture
|
if i use virtual dub and skip one single frame ahead (not a keyframe) then i can see a full picture and a not just half or a part of a picture. if i were to use total commander and have the avi plugin, then i could even extract individual images from within that avi. i know this to work for a fact because i once tried it myself.
now to come to the point i am trying to make: since there is a full picture even inbetween keyframes that is visable there must also be a way to teach virtual dub to just take the current image that is visable and rename or remark it to become a keyframe. this then would be a partial processing mode where only those frew frames would be processed that need it and the rest left the way it was.
there must be some way to get this done. it would be like making a screenshot of the idividual frames in question and just reorganizing them until the next keyframe comes along.
i really hope that somebody will try to find a way to make this possible. it should not be the goal of development to say 'it is not possible' but rather more to say: 'we will give it a try and find some kind of solution sooner or later' they say that the last thing to die would be 'hope' and so it means waiting and having a lot of hope
bye.
EDIT: aimone cutter & joiner claims on their homepage that it can be done. i quote: AVI editor to cut&join AVI files in direct fast cutting&joining clone algorithm, without re-encode. ... An AVI cutter to cut AVI files into various clips accurately by mark in and mark out time pint.
i will not submit the link to the homepage because that would be commercials!
if their homepage is telling the truth (which i do not know) then it would mean that it is possible and then it would only be a matter of time till virtual dub finds a solution. |
 |
| Abrazo |
| Posted: Jan 11 2013, 11:38 AM |
 |
|
Advanced Member
  
Group: Members
Posts: 775
Member No.: 28995
Joined: 5-November 10

|
dloneranger explaned it very well, but all these things are not always easy to understand at the beginning.
A key-frame is in fact a 'complete' image and all the following frames (untill a new keyframe) are only the changes towards the previous one. In that way a codec ( and especially the 'encoder' part of it ) can 'compress' a large file to a smaller one.
The reason why you can walk through the AVI in VirtualDub and really see 'all' the images completely, is thanks to the 'decoder' part of the codec that did his work to restore/remake each individual image by using the starting keyframe and rebuilding each following image thanks to the changes to it that have been recorded during the 'encoding' time.
So, when you cut out a keyframe and some of the following frames, it is not anymore possible to rebuild the images that should follow.
What you should do, when the original AVI is opened in VirtualDub, is look into File > File Information... and verify with which codec the file has been encoded and what was the 'data rate' being used. Then set that same compression codec and settings, via Video > Compression... Set the Video-menu to 'Fast recompress' and also check (in the Video-menu) the 'Smart rendering' option. In the Audio-menu you can choose 'Direct Stream Copy'.
In that way only the parts that really need compression will be handled by the codec and all the rest will be handled via 'direct stream copy'.
I hope that dloneranger can agree with this.
Regards. |
 |
| dloneranger |
| Posted: Jan 11 2013, 11:40 AM |
 |
|
Moderator
  
Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07

|
Abrazo states it correctly
I checked out that program you mentioned - it only cuts at keyframes as well when drect copying You can pick any point, but it does the same as virtualdub, and actually starts at the previous keyframe
| QUOTE | | now to come to the point i am trying to make: since there is a full picture even inbetween keyframes that is visable there must also be a way to teach virtual dub to just take the current image that is visable and rename or remark it to become a keyframe. this then would be a partial processing mode where only those frew frames would be processed that need it and the rest left the way it was |
Nope, there isn't a full picture anywhere between keyframes And the second part of that is exactly what I said in the previous post "smart rendering" Use smart rendering, it just re-encodes the part from your selection start up to the next keyframe and then start direct stream copying But you have to match the existing codec and settings
-------------------- MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask Windows7/8 Codec Chooser All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3 |
 |
| -vdub- |
| Posted: Jan 11 2013, 07:41 PM |
 |
|
Advanced Member
  
Group: Members
Posts: 613
Member No.: 27087
Joined: 24-February 10

|
A web search for these may help you further understand this..
IPB frames Intra frames Predictive frames Bi-directional frames
AVI uncompressed (lossless) has only I frames with no P or B frames it is possible to cut anywhere you like. Though would need to encode the video to uncompressed avi (raw, lagarith, huffyuv etc). Once the video is avi uncompressed no picture quality is lost unless apply filters or other to do so. With uncompressed avi you could edit the file with direct copy as much as you like, for as long as you like. Many people work with avi uncompressed video to retain the picture quality (preferred) later will encode and save to another format for the final video. |
 |