Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd December 2006, 15:16   #1  |  Link
pimpMyHD
Registered User
 
Join Date: Oct 2006
Posts: 16
how to crop an avi ( xvid , ac3 ) without reencode it ?

I have several avi containing xvid and ac3. All of them have the same dummy grey 8 pixels at the bottom.

Can i write a avs script that can remove those lines, without reencode the whole files.

I tried to use this script i wrote (with the help of some post from this forum) on virtualdub mod :

Quote:
# source XviD AVI file
file = "E:\TLSm\SAMOURAI.avi"

# open AVI video-only to get correct frame rate
AVISource(file, audio = false)

# save correct frame rate for DirectShowSource
frate = Framerate()

# reopen in DirectShow for better audio compatibility
DirectShowSource(file, fps = frate)

# crop the 8 lines of the bottom
crop(0,0,0,-8)
but i have not found the way to use it. If a save 'direct stream copy' i will need to reencode it.
So what is the way ?

thanks a lot, i know that my question is noob related ... but after several hours of search and test, i can't find my way.

by the way, Merry Xmas
pimpMyHD is offline   Reply With Quote
Old 23rd December 2006, 15:31   #2  |  Link
bkman
Registered User
 
Join Date: Jan 2006
Posts: 294
You can't crop the source without re-encoding. You could crop it during playback with something like ffdshow, though (conceivably).
bkman is offline   Reply With Quote
Old 23rd December 2006, 15:44   #3  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,770
does asp support setting cropping info in the header like avc? if yes, than you could make every decoder automatically only show the cropped video without needing to reencode
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free
bond is offline   Reply With Quote
Old 23rd December 2006, 16:39   #4  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,556
Yes, that's the only way xvid can support non-mod-8. According to Mpeg4Modifier (which is much better than xvid's source for these things, btw), the width and height are part of the avi itself and not the vol or vop, though they may or may not also be there. So try hex editing the riff header.
foxyshadis is offline   Reply With Quote
Old 24th December 2006, 18:19   #5  |  Link
pimpMyHD
Registered User
 
Join Date: Oct 2006
Posts: 16
ok, i understand that i can't recrop a xvid without reencode it.
So, you say hat i can advise decoders that they must crop the video while decoding it. How can i perform that ?

( sorry but the discussion seems to become out of topic, according to you it is not an avs related problem )
pimpMyHD is offline   Reply With Quote
Old 24th December 2006, 23:17   #6  |  Link
Pookie
Registered User
 
Join Date: Apr 2005
Posts: 1,339
FFdshow - VideoDecoder Settings -Crop
Pookie is offline   Reply With Quote
Old 25th December 2006, 00:22   #7  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,556
I can tell you how to do it with a hex editor, because I just tried and it worked, but if you're not comfortable with them you'll want to bail. And always work on a copy of the original unless you fancy occasionally losing a file.

Open windows calc, enter the height of the current file, and the set it to hex. Open virtualdub, and open tools->hex editor. Load your file in. Click on "strf" which will highlight the important chunk. (Not strl or strh.) Now look in the highlighted area of the left pane for the height, it'll probably start right underneath strf (the bytes will be backwards, but you should recognize it from what calc showed). Subtract 8 from the number (use calc if you aren't handy with hex) and replace the first byte - you probably won't need to touch the others. Save, and see if it worked.
foxyshadis is offline   Reply With Quote
Old 25th December 2006, 12:10   #8  |  Link
pimpMyHD
Registered User
 
Join Date: Oct 2006
Posts: 16
thanks pookie, but i do not use ffdshow at all.

i will try the foxy method.

thanks a lot.
pimpMyHD is offline   Reply With Quote
Old 26th December 2006, 11:22   #9  |  Link
medp7060
Registered User
 
Join Date: Jan 2005
Posts: 158
thanks, foxyshadis. It is the first time I have heard to crop a clip without reencoding. I tested it and it worked!!!!
medp7060 is offline   Reply With Quote
Old 17th October 2007, 03:33   #10  |  Link
snowden
Registered User
 
snowden's Avatar
 
Join Date: Apr 2007
Posts: 30
i have been looking everywhere for advanced editing techniques for some of my xvid and other videos and i've come across the beginnings of it in this topic...better here than never.

@foxyshadis: does this hex hack also apply to other file formats (video of course) such as MPEG-1/-2?


Last edited by Guest; 17th October 2007 at 03:42.
snowden is offline   Reply With Quote
Old 17th October 2007, 04:16   #11  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,556
If you can get it to play without crashing, I suppose. Never tried, but some mpeg streams do have separate display size vs coded size.
foxyshadis is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:09.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.