Log in

View Full Version : How do erase a part of a video completely?


Chengbin
26th July 2009, 16:54
I have a video from my (rather my friend's) DVR, and it is a 4:3 video in 1080p, and the channel logo just avoids the 4:3 video. Is it possible to erase (turn it all black) that block of logo completely during video encode? The sides are black anyway, so I get a "perfect" black border.

I don't want to crop out the borders though, because the beginning is in 16:9.

Source

http://i28.tinypic.com/2gv0haf.png

What I want throughout the video.

http://i27.tinypic.com/2daj9g3.png

smok3
26th July 2009, 17:15
in avisynth terms it would be something like

film=avisource("film.avi")
a=film.trim(0,306) # the 16:9 part
b=film.trim(307,304506) # the 4:3 part

# Crop(Left, top, -right, -Bottom)
b=b.Crop(80,0,-80,-0)
b=b.AddBorders(80,0,80,0)

return(a+b)

not the actual numbers, just some used for the illustration.

Gavino
26th July 2009, 17:45
b=b.Crop(80,0,-80,-0)
b=b.AddBorders(80,0,80,0)
or, simpler and faster,
b=b.LetterBox(0, 0, 80, 80)
# note different parameter order for LetterBox (http://avisynth.org/mediawiki/Letterbox)

Chengbin
27th July 2009, 04:13
Thanks.

Can you show me how do I join 2 trimmed video together in avisynth automatically?

I once had to trim a video to 18 pieces, 7 of them needs deband. It was painful to do it manually.

For example, if I want frames 0-99 with MSharpen(), and 100-199 with MSharpen() and ffdshow("default"), and join the video together at the end, how would I write that script?

shoopdabloop
27th July 2009, 04:45
a = last.trim(0,99);
b = last.trim(100,199);
c = last.trim(200,last.framecount);

now apply separate filtering to a and b, and splice them all together.

Gavino
27th July 2009, 09:52
You can also use ApplyRange (http://avisynth.org/mediawiki/ApplyRange).

ApplyRange(0, 199, "MSharpen")
ApplyRange(100, 199, "ffdshow", "default" )

This has the advantage that you don't have to manually splice together the different segments. Only disadvantage is that ApplyRange does not support named arguments for the called filter, all arguments are by position.

Ghitulescu
27th July 2009, 10:21
Is it possible to do this upon a MPEG-2 file without reencoding?
At least without reencoding the image part (let's assume that the black borders, be they top/bottom or left/right, have adequate sizes (eg multiple of 16).

Gavino
27th July 2009, 10:31
Is it possible to do this upon a MPEG-2 file without reencoding?
Not using Avisynth, at any rate. It always delivers uncompressed video and audio to its client application.

smok3
27th July 2009, 11:10
best bet for native mpeg2 schnit is sony vegas (pro).

JohannesL
27th July 2009, 12:12
Only disadvantage is that ApplyRange does not support named arguments for the called filter, all arguments are by position.
Therefore, use JDL_ApplyRange.

Chikuzen
30th July 2009, 02:31
I wonder why neuron2 doesn't close this thread because of rule 6.

thewebchat
30th July 2009, 03:04
Nobody here mentioned warez, p2p, or any other type of Internet-downloaded media, Chikuzen. Perhaps you are projecting your own practices onto someone else?

Chikuzen
30th July 2009, 03:58
The screen shot that Chengbin posted shows that Television Broadcasting in Japan is a source.
The law of Japan is forbidden to give the friend the recorded one. (Such a foolish law is not defended of course actually. )
If Chengbin lived in Japan, I made his honor dirty.