How can I break a GOP up into segments, do whatever filtration I need to do with each segment separately, and rejoin them? Can someone post a sample script for this?
Thanks.
+ Reply to Thread
Results 1 to 10 of 10
-
-
I'm not entirely sure what you are asking
You can't "break up a GOP" using avisynth scripts, because avisynth frameserve uncompressed video , so the idea of GOP's no longer exist
If you are starting with MPEG2 video, you can use something like mpg2cut2 or avidemux to cut along GOP segments . So if there was a certain section that you wanted filtered (but you don't want to the re-encode other segments) , you could cut them with those tools, filter, re-encode, then rejoin -
I should rephrase. Imagine a frame, any frame of a clip, broken up into segments (the same way you would cut a picture into six squares with scissors). Work with those segments individually as I wish, then rejoin them to make the whole image again.
The reason I said GOP's (group of pictures) is because I would like to apply this same action to several pictures at once. -
So do you mean part of a frame in a sequence, e.g. like the top right hand corner over a range of certain frames?
If so, a general approach would be to crop() plus whatever filters, and overlay() using x,y coordinates . You can think of it as the filtered section "covering up" the old unfiltered section , leaving the other parts of the frame untouched
Another way would be to apply your filters through masks, either with masktools or overlay
There are other ways of doing this, but you have to describe more information on what filters and transformations and programs you plan using (e.g. photoshop ?)
(GOP has very specific connotation in video encoding, as you can imagine the confusion)
http://en.wikipedia.org/wiki/Group_of_pictures -
I accomplished the first portion of this goal with crop. For example, here are my steps:
1. I loaded the full clip.
2. I cropped off the RIGHT half part of the image, added the filter that I needed to the portion of the image left, then added a border to turn it back into the same size video it was. Saved it as clip 1.
3. I then loaded the original full image again, and this time cropped off the LEFT half of the image, added a filter completely different from the one in clip 1, then added the same size border that I cropped off in that area, and saved it as clip 2.
How do I put these halves together to form my new clip? -
For example:
Code:tl = Crop(0, 0, width/2, height/2) tr = Crop(width/2, 0, width/2, height/2) bl = Crop(0, height/2, width/2, height/2) br = Crop(width/2, height/2, width/2, height/2) # filter each StackVertical(StackHorizontal(tl, tr), StackHorizontal(bl, br))
-
jagabo, suppose I want to apply a different filter to tl, tr, bl, br. How would that script look? Can you please post a sample?
-
You just add the filter after with a period
eg..
Code:WhateverSource() tl = Crop(0, 0, width/2, height/2).SomeFilter1() tr = Crop(width/2, 0, width/2, height/2) bl = Crop(0, height/2, width/2, height/2) br = Crop(width/2, height/2, width/2, height/2) StackVertical(StackHorizontal(tl, tr), StackHorizontal(bl, br))
The potential problems with doing it this way (With stackhorizontal or stackvertical):
1) You get an abrupt demarcation. There is no gradual blending or "feathering". Think of where you have a noisy filter video, and you filter the top left quadrant, it might look completely different and "out of place".
2) Only square areas are filtered - it's difficult to filter non square regions. What if you need a circle area filtered?
With the overlay approach using masks, you can feather the mask and make it blend in better -
Or you can add the filters where I specfied:
Code:tl = Crop(0, 0, width/2, height/2) tr = Crop(width/2, 0, width/2, height/2) bl = Crop(0, height/2, width/2, height/2) br = Crop(width/2, height/2, width/2, height/2) tl = Invert(tl) br = Invert(br) StackVertical(StackHorizontal(tl, tr), StackHorizontal(bl, br))
-
Ok, it worked. You're right about those hard-to-reach areas.
I'll give overlay a shot. Not sure how it works, but I'll read up on it.
Thanks!
Similar Threads
-
How to detect and print I, B and P frames of a GOP frame
By pavithra_mdn in forum ProgrammingReplies: 1Last Post: 10th Mar 2011, 11:40 -
How to calculate single frame duration
By 8day in forum Newbie / General discussionsReplies: 4Last Post: 5th Dec 2010, 10:49 -
Joining Mixed Multi Angle Into Single VTS
By werdna1900 in forum Authoring (DVD)Replies: 1Last Post: 13th Jun 2009, 04:26 -
Videoredo Cut a Single Frame ?
By acestu in forum EditingReplies: 4Last Post: 3rd Sep 2008, 09:06 -
Saving a single Frame as a Jpeg
By acestu in forum EditingReplies: 0Last Post: 20th Aug 2008, 15:11