Adding letterbox to stream

About encoding, codec settings, muxers and filter usage
Pentium100
New Cone
New Cone
Posts: 5
Joined: 18 May 2014 07:51

Adding letterbox to stream

Postby Pentium100 » 18 May 2014 08:00

Hello, is here a way to convert 720x576 16:9 (or some other AR) video to 720x576 4:3? The device I want to use for playback always stretches the video and I want to watch it on a 4:3 TV.

I have tried this:

Code: Select all

vlc -I dummy -vvv test.m2ts --sout=#transcode{vcodec=mpgv,vb=8192,vfilter=canvas{width=720,height=576,aspect=4:3}}:standard{access=file,mux="ts",dst="result.mpg"}
2.1.3 tried to resize the video to 46x0 and crashed because that is an invalid size
0.8.6i does not change the aspect ratio or resolution (tried different resolutions) - it does change the bitrate though.

this:

Code: Select all

vlc -I dummy -vvv test.m2ts --sout=#transcode{vcodec=mpgv,vb=8192,vfilter=canvas{aspect=4:3}}:standard{access=file,mux="ts",dst="result.mpg"}
changes the encoded aspect ratio, bot does not add the black bars.

this :

Code: Select all

vlc -I dummy -vvv test.m2ts --sout=#transcode{vcodec=mpgv,vb=8192,width=768,height=576,aspect=4:3}:standard{access=file,mux="ts",dst="result.mpg"}
2.1.3 resizes the video to 768x576 (tried that to see if it does anything), keeps the encoded and actual aspect ratio (no black bars).

Is there a way to add the black bars to widescreen video?

Pentium100
New Cone
New Cone
Posts: 5
Joined: 18 May 2014 07:51

Re: Adding letterbox to stream

Postby Pentium100 » 01 Jun 2014 19:59

I figured it out.

The first command line works, but not with the latest version of VLC. It works with 2.0.3. However, then I wanted to deinterlace using bob and that works on 2.1.3, but fails on 2.0.3 (main filter warning: dropping pictures). I am now trying different versions to see maybe there is a version with both of these functions working.

EDIT: Tried 2.1.0 (it crashed) and 2.0.8 (the same as 2.0.3), so I guess there is no version of VLC where it is possible to deinterlace using a doubler and then resize the video.

jwebb117
Blank Cone
Blank Cone
Posts: 19
Joined: 27 May 2014 19:16
VLC version: 0.8.6c
Operating System: OSX
Location: New York City / Philadelphia

Re: Adding letterbox to stream

Postby jwebb117 » 11 Jun 2014 00:06

This is probably silly, but is there a way to add an overlay to the stream? Then you can just put the bars up as a separate graphic element. If anyone knows if this is possible, I would be interested in this for a variety of uses. Thanks.

Pentium100
New Cone
New Cone
Posts: 5
Joined: 18 May 2014 07:51

Re: Adding letterbox to stream

Postby Pentium100 » 14 Jun 2014 22:34

That would work I guess, as long as adding the overlay would change the size of the video. Basically what I need to do is:

Original video (720x576) -> deinterlace (bob or other doubler) -> resize to square pixels (now it's something like 720x400) -> add black bars top and bottom so it's back to 720x576.

However, In older versions of VLC (2.0.x) the resizing works, but deinterlacing fails (unless I use blending, which I do not want to), while in newer VLC versions (2.1.x) deinterlacing works OK, but resizing fails.

jwebb117
Blank Cone
Blank Cone
Posts: 19
Joined: 27 May 2014 19:16
VLC version: 0.8.6c
Operating System: OSX
Location: New York City / Philadelphia

Re: Adding letterbox to stream

Postby jwebb117 » 11 Aug 2014 22:13

Interesting. Thanks!


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: Bing [Bot] and 12 guests