Changing aspect ratios

About encoding, codec settings, muxers and filter usage
PhilipC
New Cone
New Cone
Posts: 2
Joined: 15 Sep 2006 12:50

Changing aspect ratios

Postby PhilipC » 17 Sep 2006 13:48

I've got a DVD that was created on a home DVD recorder. As a result, the aspect ratio is wrong - the DVD recorder says it is 4:3 but it is actually 16:9.

Now, if I get VLAN to play the DVD and tick the menu option to adjust the aspect ratio to 16:9, it looks great. However, I'm struggling to come up with the correct set of command line options to get sout to do the same trick.

Am I correct in saying that "--aspect-ratio" only affects the screen playback and not the sout interpretation of the input stream?

The source material is 720x576 so, if my maths is right, that should translate to 1280x576 if I want a 16:9 aspect ratio, but it looks badly stretched horizontally.

I've tried setting the width & height in the transcode parameters. I've also tried setting the canvas-aspect value. Neither seems to be giving me the right results.

Can someone suggest what I should be using to do this?

Thanks.

--Philip

mdsh
New Cone
New Cone
Posts: 4
Joined: 30 Sep 2006 23:32
Location: London
Contact:

Postby mdsh » 01 Oct 2006 01:29

I'm having a very similar problem. I'm using Windows XP and I want to stream the output of my DV camera. The camera is 16:9 PAL and therefore the native output is 720x576 pixels.

I know I have my maths right and that this should be scaled to 1050x576 pixels to display on a square pixel display (see http://www.bbc.co.uk/commissioning/tvbr ... size.shtml).

That's far too big so I want to scale the video to half that, i.e. 524x288.

If I put 524 and 288 into the width and height values and look at the debug output things initially look good...

Code: Select all

[00000307] main private debug: using sout stream module "stream_out_rtp" [00000303] main private debug: using sout stream module "stream_out_duplicate" [00000300] main private debug: set sout option: sout-transcode-vcodec to mp4v [00000300] main private debug: set sout option: sout-transcode-vb to 1024 [00000300] main private debug: set sout option: sout-transcode-acodec to mp3 [00000300] main private debug: set sout option: sout-transcode-ab to 192 [00000300] main private debug: set sout option: sout-transcode-channels to 2 [00000300] main private debug: set sout option: sout-transcode-fps to 12.5 [00000300] main private debug: set sout option: sout-transcode-width to 524 [00000300] main private debug: set sout option: sout-transcode-height to 288 [00000300] main private debug: set sout option: sout-transcode-deinterlace to (null) [00000300] main private debug: set sout option: sout-transcode-audio-sync to (null) [00000300] main private debug: set sout option: sout-transcode-samplerate to 44100 [00000300] stream_out_transcode private debug: codec audio=mp3 44100Hz 2 channels 192Kb/s [00000300] stream_out_transcode private warning: bad aspect ratio [00000300] stream_out_transcode private debug: codec video=mp4v 524x288 scaling: 1.000000 1024kb/s
But what does the private warning: bad aspect ratio mean?

Later in the debug output I spot this:

Code: Select all

[00000300] stream_out_transcode private debug: source 720x576, crop 720x576, destination 360x288, padding 360x288
Why has it now chosen 360x288 - i.e. 720x576 divided by 2?

Why has it forgotten all about 524x288? Is it possible for VLC to do the correct thing when scaling from a live source on Windows? I know it can

I've spent hours working on this, trying all sorts of settings so I hope someone can point me in the right direction.

I'm using this command line with VLC media player - version 0.8.5 Janus on Windows XP:

Code: Select all

vlc -vvv -I dummy dshow:// :dshow-vdev="Microsoft DV Camera and VCR" :dshow-caching=200 :aspect-ratio="1050:576" :sout=#transcode{vcodec=mp4v,vb=1024,acodec=mp3,ab=192,channels=2,fps=12.5,width=524,height=288,deinterlace,audio-sync,samplerate=44100}:duplicate{dst=display,dst=rtp{dst=10.64.0.1,port=1234,sdp=http://10.64.0.41:8080/test.sdp}}

mdsh
New Cone
New Cone
Posts: 4
Joined: 30 Sep 2006 23:32
Location: London
Contact:

Postby mdsh » 02 Oct 2006 00:31

Sorry to reply to myself. I've tried to discuss this on IRC but maybe Sunday is not a good day.

Here's an example of another reason for wanting to aspect-ratio convert on transcode.

I have an mpeg that is flagged with the wrong aspect ratio (it's flagged as 4:3 but it's actually 16:9).

I want to transcode it to an m4v and stream it to a server for reflecting, but I want to correct the aspect ratio.

The best option would be for me to be able to override the aspect-ratio flag in the m4v. I don't think that is available as an option, which is a feature I'd like to request and will do through the appropriate channel if I am proved to be correct.

The alternative way would be to rescale the original by using width and height in the transcode (as I was suggested on IRC). The problem is that although it looks like this should work, it doesn't appear to, which I think is a bug and will also file appropriately if I am proved to be correct.

Here is a demonstration. The file wrong-4x3.m2v is a 720x576 (PAL) file that is flagged as 4:3 but contains obviously 16:9 material.

Code: Select all

vlc -vvvv http://mark.himsley.org/wrong-4x3.m2v :sout=#transcode{vcodec=mp4v,vb=512,width=1050,height=576}:duplicate{dst=display,dst=std{access=rtp,mux=ts,dst=10.64.0.1:1234}}
Since wrong-4x3.m2v is being served from the end of my broadband line it will be best if you download it first (it's 4MB) and access if locally rather than pulling it across the net becaused I don't have the upload bandwidth to feed a 4Mbps file.

Please test this and let me know what you think.
--
Mark Himsley

ab7
Blank Cone
Blank Cone
Posts: 10
Joined: 28 Jun 2007 23:44

Re: Changing aspect ratios

Postby ab7 » 30 Jun 2007 20:22

Hello everyone,

I'm currently looking for a solution to the same problem as described in this thread! Anyone found a solution yet?
(I posted a thread about this (viewtopic.php?f=4&t=38675) and then I found out about this thread).

So yeah... ideas anyone?

Many thanks!

Albrecht

ab7
Blank Cone
Blank Cone
Posts: 10
Joined: 28 Jun 2007 23:44

Re: Changing aspect ratios

Postby ab7 » 21 Sep 2007 20:27

*Bump*

Anyone an idea?

Thanks in advance!
Albrecht

ab7
Blank Cone
Blank Cone
Posts: 10
Joined: 28 Jun 2007 23:44

Re: Changing aspect ratios

Postby ab7 » 03 Feb 2008 11:58

yeah.. still searching for the solution.. news anyone?

Thanks!
Albrecht


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 21 guests