Often I get various video files with unstandart aspect ratios and I need to bring them to the standart ones by adding black borders on the edges of the frames.
I understand that any modification in the video frames requiers reencoding, because technically they become new frames and compressions alhoritms have to be computed for them again.
This is 100% necessary when we modify the frame itself (put an image or some text above the frame), but concerning black borders on the edges I don't sure, here is why:
In this case, We don't need to put any changes in the data inside the frames, the video data inside the frames could be left unedited, just the rest parts of the frame would be filled with zeros in the raw representaion.
One fact which has lead me to this idea is that when you try to add borders in AviDemux and then click the preview button you will see the final results.
You can play the video with boreder filter applied, rewind it in realtime (!!!) and it works pretty smooth withoud any frames dropped even on my low power laptop -
Everything looks like the job is already done!
So why have I do the full reencoding and spend a lot of time on it? The question is:
Is there any method to add or remove black borders witout reencoding?
+ Reply to Thread
Results 1 to 11 of 11
Not permanently, no. You can do it in other ways, though. For example, most software players will play AviSynth scripts, like so:
Crop(0,60,0,-60)###to crop away (remove) black borders
#AddBorders(0,60,0,60)###to add black borders above and below a video
I don't use AviDemux, but I suspect it's doing something very similar (or identical) when you can play the preview. I can open that script in MPC-HC if I want to play it with black borders added or removed.
@pandy: care to share some names of tools which allow to crop without reencoding?users currently on my ignore list: deadrats, Stears555
Decoding is unnecessary to operate in frequency domain (only DC coefficient, remaining AC coefficient equal to 0) at macro block level and as such if you can add/remove macroblock then you meet not re-encoding criteria.
So only 'inhouse' self written tools. I knot that in theory this is possible, but I have never seen a tool (proprietary or not) that could do this and produce a still decodable output stream for a MPEG-4 based codec.users currently on my ignore list: deadrats, Stears555
DVD shrink, some are used in broadcast ("smart" multiplexers). Adding or removing defined macroblocks seem to easier than re-encoding.
I saw tools used to generate synthetic bit streams where no spatial data was used at all (macroblocks, motion vectors, other aspects was defined parametrically).
Well so called re-quantizers are same type tools - some of them are available as open source?users currently on my ignore list: deadrats, Stears555
I must say that sadly but i have almost zero coding skills thus can't provide such tool...