View Full Version : encoding with borders?


Daodan
25th October 2005, 09:22
Well, maybe my question will make some doubt my sanity. But I want to encode a 2,1 AR movie (800x384)(well that's how I first encoded it) in 4:3 AR. But with black borders. Is it possible? (directly from dvd source using x264). If it is, will I lose much from quality? (obviously some bitrate will be lost even if it is pure black).

Manao
25th October 2005, 10:40
Why do you want the black borders ? They should be no good reason for it ( except for testing purposes ).

Now, it is possible, of course. You need avisynth to add the borders ( the filter to be used is Addborders - what a surprise ;p ). Quality wise, as you said, you'll lose a little bitrate. Furthermore, if you don't aligned the borders on mod16 bundaries, there will be an additionnal loss of bitrate at the limit between black borders and the picture. And if they aren't aligned to mod8 ( high profile with 8x8 ) or at least mod4 ( with only 4x4 transform ), there will be an additionnal loss of quality at the limit between borders and picture ( basically, a small ringing migh be spotted ).

Daodan
25th October 2005, 11:17
Gee, thanks. It's not really for testing purposes. Well, the idea is I want a final mkv file that contains video, audio and a ssa subtitle file. The problem is I don't want the sub to be on the visible part of the movie, but below, on the black and unused part. But I don't seem to be able to make a ssa script that does that (I asked around another forum and they said it's impossible as long as i use vsfilter). I tried Medusa and ChronoSub but no luck. So the only thing left is this, I think.
Could you tell me where I can find what parameters do I use for addborders (let's say I don't want to add borders till I reach 4:3 but only a little more, just for the subs)?

Manao
25th October 2005, 11:46
Then I'd advise you to add a border only to the bottom of the picture, and to change the aspect ratio accordingly. Make the black border have a height multiple of 16, and such a border will imply almost no bitrate loss ( a few bytes per pictures )

Daodan
25th October 2005, 11:49
:thanks:

akupenguin
25th October 2005, 12:05
Make the black border have a height multiple of 16, and such a border will imply almost no bitrate loss ( a few bytes per pictures )
It will still interfere with motion compensation, if anything in the bottom row of blocks in moving up or down.

My solution: "mplayer -vf expand", to add borders during playback. You can do the same in ffdshow.

MeteorRain
26th October 2005, 14:01
in vobsub, you can also extend the video to 4:3 (if 16:9 original) and put the subtitle into the black area

bond
26th October 2005, 21:16
doesnt vsfilter display the subs below the video by default anyways?

MeteorRain
27th October 2005, 04:38
iirc, it does.

Daodan
27th October 2005, 08:43
Well no. Not if the ssa formatting sais him not to. And I can't make it (with Medusa for example) to put it below the picture. If you know a way to do this it would be all the better. And the other tricks with modifying the settings won't do either because I want other people to play it the same without having to do any modifications.
But the black borders stuff works pretty well after all, and not really a quality loss (I used as suggested a multiple of 16 for the upper and lower borders).