Log in

View Full Version : Adding black bars to videos without re-encoding?


kolamorx
19th July 2022, 00:36
Is there any method to add black bars to videos without re-encoding?

Music Fan
19th July 2022, 14:08
You can make an Avisynth script which add black bars and you play it in real time. But it will be playable on pc only, not on an external player.

FranceBB
20th July 2022, 20:00
Is there any method to add black bars to videos without re-encoding?

By physically adding them to the file? No, you have to re-encode.

By making the player display them on the fly? Yes, you can.

Some players allow you to set how a file should be displayed.
For instance, for SD files on Omneon, not only you can add the 4:3 or 16:9 tag, but you can also add whether it should display black bars or crop. This information will be added into the .mxf container and it will be read by any player that supports it.

The problem with this is that if you do something like this there's no guarantee that it will work and only a few players will honour that and definitely not consumer players given that it's mxf. A more consumer friendly alternative would be to do this with MKVToolnix which allows you to set the aspect ratio and cropping parameters at container level. When the file plays, the player should read those values and apply the scaling on the fly, however this is not really very widespread either. I think it would be much better to re-encode, but if you insist on doing this without re-encoding, your best shot is MKVToolnix.

SeeMoreDigital
20th July 2022, 20:53
Is there any method to add black bars to videos without re-encoding?
Out of interest... What device will you be using to play such files?

Just about any software player will automatically add black bars, depending on the aspect ratio of the content and the display screen. Same goes for hardware play back devices.

kolamorx
21st July 2022, 21:29
I think it would be much better to re-encode, but if you insist on doing this without re-encoding, your best shot is MKVToolnix.
Is MKVToolnix capable of adding black bars to videos?

SeeMoreDigital
21st July 2022, 21:34
Is MKVToolnix capable of adding black bars to videos?In short... No!

Why do you need to add black bars. What device are you using to play your files?

kolamorx
22nd July 2022, 00:20
What device are you using to play your files?
I use my personal computer (VLC media player for Windows) to play the files.

SeeMoreDigital
22nd July 2022, 08:11
VLC player offers the ability to add black bars automatically.

If this isn't happening it must mean your sources have not been encoded correctly. With this in mind please run one of your problem sources through an application called MediaInfo ('https://mediaarea.net/en/MediaInfo/Download'), which must be set to text mode and post what it reports 'in full' as a text file.

Music Fan
22nd July 2022, 08:37
In short... No!
And what if we put a higher resolution as display resolution than the actual resolution and set a cropping ?

SeeMoreDigital
22nd July 2022, 21:07
You'll need to provide an example.

Personally I have dozens (720x480 and 720x576) of image only (ie: black border cropped) DVD back-ups on my NAS that are displayed perfectly on my 65" TV.

Lol... When this forum started (over 20 years ago), we all cropped the black borders from our DVD back-ups!

StainlessS
22nd July 2022, 22:24
Lol... When this forum started (over 20 years ago), we all cropped the black borders from our DVD back-ups!

Some of us still do so.

FranceBB
23rd July 2022, 19:32
Is MKVToolnix capable of adding black bars to videos?

Ah no, not adding. Looks like it's only supported in the Omneon Muxer and mxf container... what a bummer. I really thought MKV would support this 'cause mkv as a container generally supports (almost) literally anything...

StainlessS
23rd July 2022, 20:13
VLC player offers the ability to add black bars automatically.

If this isn't happening it must mean your sources have not been encoded correctly. With this in mind please run one of your problem sources through an application called MediaInfo ('https://mediaarea.net/en/MediaInfo/Download'), which must be set to text mode and post what it reports 'in full' as a text file.
Lets forget adding black bars, the only sensible/sane way is as said by SeeMoreDigital.
It might just be a case of changing aspect ratio in container[sources have not been encoded correctly],
OR, just using correct settings in player.
Post output of MediaInfo.

stax76
23rd July 2022, 22:20
For cases where a container option don't help, mpv supports file specific configuration files:

https://mpv.io/manual/master/#file-specific-configuration-files


In such a file, filters can be defined:

https://mpv.io/manual/master/#video-filters


It's not completely easy to learn how to use mpv, a good place to ask questions is Reddit:

https://www.reddit.com/r/mpv

kolamorx
24th July 2022, 08:56
VLC player offers the ability to add black bars automatically.
VLC player is not capable of adding black bars automatically.
https://forum.videolan.org/viewtopic.php?f=2&t=160309#p529433

SeeMoreDigital
24th July 2022, 10:14
VLC player is not capable of adding black bars automatically.
https://forum.videolan.org/viewtopic.php?f=2&t=160309#p529433Oh yes it can!

I've just played a few minutes of the following 'cropped' (and very poorly encoded) movie in VLC,and it added the black bars: -

General
Complete name : \\SYNOLOGY_NAS\My Photos and Videos\Videos\My MPEG-4 Movie Test Files\Die Hard 4 (Live Free Or Die Hard) @ 123mins (628x254p25.000).avi
Format : AVI
Format/Info : Audio Video Interleave
File size : 702 MiB
Duration : 2 h 3 min
Overall bit rate : 795 kb/s
Writing application : VirtualDubMod 1.5.10.1 (build 2366/release)
Writing library : VirtualDubMod build 2366/release

Video
ID : 0
Format : MPEG-4 Visual
Format profile : Advanced Simple@L5
Format settings : BVOP2
Format settings, BVOP : 2
Format settings, QPel : No
Format settings, GMC : No warppoints
Format settings, Matrix : Default (H.263)
Codec ID : DX50
Codec ID/Hint : DivX 5
Duration : 2 h 3 min
Bit rate : 673 kb/s
Width : 628 pixels
Height : 254 pixels
Display aspect ratio : 2.472
Frame rate : 25.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.169
Stream size : 594 MiB (85%)
Writing library : XviD 1.0.3 (UTC 2004-12-20)

Audio
ID : 1
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 3
Codec ID : 55
Codec ID/Hint : MP3
Duration : 2 h 3 min
Bit rate mode : Constant
Bit rate : 112 kb/s
Channel(s) : 2 channels
Sampling rate : 48.0 kHz
Compression mode : Lossy
Stream size : 98.9 MiB (14%)
Alignment : Aligned on interleaves
Interleave, duration : 40 ms (1.00 video frame)
Interleave, preload duration : 504 ms

So please post a MediaInfo report as previously requested?

kolamorx
24th July 2022, 12:03
Oh yes it can!
That's because your video has a 2.472 aspect ratio, of course any player will automatically add black bars when using a large window.
However, the video's width is maximal and my goal is to limit it and force it permanently to 16:9 aspect ratio by black bars. (I use only large VLC window.)
VLC developer says that the player is not capable of doing it.

SeeMoreDigital
24th July 2022, 12:17
Just post a MediaInfo file report!

kolamorx
24th July 2022, 12:22
There is no point in doing that.

SeeMoreDigital
24th July 2022, 12:30
There is no point in doing that.

With respect, without providing detailed information about your source video, you are wasting everybody's time. Nobody can help you!

I have request this topic be closed.

kolamorx
24th July 2022, 13:14
With respect, without providing detailed information about your source video, you a wasting everybody's time. Nobody can help you!

I have request this topic be closed.
I'm not wasting anybody's time.
I asked a question and got an answer: no.
You are wasting my time since you don't understand it's not a matter of source, it's a matter of the player.
This topic should stay opened, maybe in the future there will be a solution.

StainlessS
24th July 2022, 16:25
Just post the requested MediaInfo text or that's probably the last reply you will get.