Wrong aspect ratio when transcoding video

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
flyowynd
New Cone
New Cone
Posts: 7
Joined: 22 May 2009 11:32

Wrong aspect ratio when transcoding video

Postby flyowynd » 22 May 2009 14:04

Hi

I tried to transcode and stream an h.264 udp stream using lower bitrate and half resolution using windows version of vlc 1.0-rc1.
Apparently there's a problem with the aspect ratio of the output stream even if I correctly set output heigth and width.

When I capture the output stream and use a video analyzer I've got this:

video stream type : AVC
resolution : 544x576
profile:level : Main:5.1
aspect ratio :136x37(Extended_SAR(52751:13600))
chroma format : 4:2:0
interlaced : no

136*37 value seems to be the problem.

In my case if I try to play the stream (or playing it localy) using another vlc I've got an elongated windows. If I force aspect ratio when playing it's ok but that's not a solution.

I use the GUI to transcode my stream with the following options:

:sout=#transcode{vcodec=h264,vb=800,fps=25,scale=0.5,acodec=mp4a,ab=96,channels=2,samplerate=11250}:display

It does the same with the following:

:sout=#transcode{vcodec=h264,vb=800,fps=25,scale=1,width=544,height=576,acodec=mp4a,ab=96,channels=2,samplerate=11250}:display

or

:sout=#transcode{vcodec=h264,vb=800,fps=25,width=272,height=288,acodec=mp4a,ab=96,channels=2,samplerate=11250}:display

Do you have any idea?

Thanks.

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: Wrong aspect ratio when transcoding video

Postby VLC_help » 22 May 2009 16:49

Maybe you should set the width width=resolution*aspect ratio. Anamorphic stuff is usually problematic, so always encode as PAR 1:1 if possible.

flyowynd
New Cone
New Cone
Posts: 7
Joined: 22 May 2009 11:32

Re: Wrong aspect ratio when transcoding video

Postby flyowynd » 22 May 2009 17:16

It's not really better when I try something like 320*240

I've got this video:

video stream type : AVC
resolution : 320x240
profile:level : Main:5.1
aspect ratio :320x87(Extended_SAR(52751:19200))
chroma format : 4:2:0
interlaced : no

with this command line:

:sout=#transcode{vcodec=h264,vb=800,fps=25,width=320,height=240,acodec=mp4a,ab=96,channels=2,samplerate=11250}:display

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: Wrong aspect ratio when transcoding video

Postby VLC_help » 23 May 2009 15:09

You can try Yamb fixing the aspect ratio.
http://www.walterdevos.be/2008/10/24/fi ... quicktime/

flyowynd
New Cone
New Cone
Posts: 7
Joined: 22 May 2009 11:32

Re: Wrong aspect ratio when transcoding video

Postby flyowynd » 26 May 2009 13:20

yep but at the end I wanna stream to MPEG-TS, not creating a file. Yamb seems not able to do that.
That's why VLC was so useful for me.

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: Wrong aspect ratio when transcoding video

Postby VLC_help » 26 May 2009 15:06

Sorry, I misunderstood you. You have some sample video I could use to replicate this issue?

flyowynd
New Cone
New Cone
Posts: 7
Joined: 22 May 2009 11:32

Re: Wrong aspect ratio when transcoding video

Postby flyowynd » 27 May 2009 19:09

No problem :D

I've created a rar file (~10Meg) and it's available on megaupload at this address: http://www.megaupload.com/?d=J18NBAHS

In this file you have the original stream (H.264, 544*576, aspect ratio 1055*576) and two different transcoded stream.

In first one I used this line to trancode:

:sout=#transcode{vcodec=h264,vb=800,scale=1,acodec=mp4a,ab=96,channels=2,samplerate=11250}:std{access=file,mux=ts,dst=c:\\test.ts}

For the second one id nearly the same, just half res:

:sout=#transcode{vcodec=h264,vb=800,scale=0.5,acodec=mp4a,ab=96,channels=2,samplerate=11250}:std{access=file,mux=ts,dst=c:\\test.ts}

I hope it could help you to find the problem.

But what I found is that aspect ratio when transcoded is always 136*37.

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: Wrong aspect ratio when transcoding video

Postby VLC_help » 28 May 2009 20:39

Thanks. Confirmed. Trac ticket opened
http://trac.videolan.org/vlc/ticket/2793

nereikianieko
Blank Cone
Blank Cone
Posts: 27
Joined: 24 May 2008 17:51

Re: Wrong aspect ratio when transcoding video

Postby nereikianieko » 12 Oct 2009 20:14

I can't believe my eyes this ticket type changed from defect to enhancement . This is real bug.

mphilip876
New Cone
New Cone
Posts: 1
Joined: 12 Oct 2009 10:21

Re: Wrong aspect ratio when transcoding video

Postby mphilip876 » 13 Oct 2009 07:37

I have visited the links bt didn't get anything worthy...

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: Wrong aspect ratio when transcoding video

Postby VLC_help » 13 Oct 2009 16:59

mphilip876: issue isn't fixed.

nereikianieko
Blank Cone
Blank Cone
Posts: 27
Joined: 24 May 2008 17:51

Re: Wrong aspect ratio when transcoding video

Postby nereikianieko » 05 Nov 2009 10:36

Is any way to pay to someone to get this corrected?

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: Wrong aspect ratio when transcoding video

Postby VLC_help » 05 Nov 2009 18:19

Yep. Post your request to http://mailman.videolan.org/listinfo/vlc-devel and someone might fix this, if you offer money.

vice
Blank Cone
Blank Cone
Posts: 61
Joined: 18 Oct 2007 13:43

Re: Wrong aspect ratio when transcoding video

Postby vice » 17 Dec 2009 13:07

Ummm.. I've observed this same issue BUT not using the transcoding.

Let me explain.

I connect to a transport stream with a H264 encoded video and stream it out by RTP without transport stream and without transcoding. Only changing is transmission system (and by the way the network, but that's another history). When I connect to this VLC stream out, I observed the aspect ratio is incorrect.

I do a lot of tests, and found that the resolution is correct but aspect ratio information and correction is incorrect. I'm not shure because this was long time ago but it could be like applying two times the correct correction.

More detailed information:

Original source:
H264 video inside a UDP transport stream. Resolution: D1 PAL (720 × 576) a resolution (with non-squared pixels) so for displaying in common TFT displays it needs aspect rate correction to have a 768 x 576 resolution. A perfect 4:3 proportion with square pixels.

VLC media player connects to this stream and stream it with #rtp stream out module without transcoding or anything else. It's send exactly the same H264 video information but with a diferrent transport.

But the client render the video widther than it should be. It seems that the aspect ratio correction is applied twice.

Why I haven't posted about it? Because I've solved simply by forcing the aspect ratio to 4:3 on the client side.

I hopes this helps to locate the problem. And for users to have a simple workaround.

Best regards,
vicente

nereikianieko
Blank Cone
Blank Cone
Posts: 27
Joined: 24 May 2008 17:51

Re: Wrong aspect ratio when transcoding video

Postby nereikianieko » 21 Dec 2009 08:48

@VLC_help
Dear VLC_help, have you seen mine message in this list? I've tried to subscribe and have posted twice about asking to fix this, also offering money (50 - 100 $ - is this enough?) , but seems like message even didn't apear in this message list.
Maybe you can post it? I can send you message by PM or post it here.

@vice
We all know, that we can fix this forcing aspect ratio in client side, but this is so primitive and the worst - problem still remains. There are many situasions, there this "fix" will not work, as VLC is used to stream not only VLC-to-VLC, but also to many other clients, there simply forcing correct aspect is not possible.

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: Wrong aspect ratio when transcoding video

Postby VLC_help » 21 Dec 2009 17:07

nereikianieko: unfortunately I won't represent anyone else in mailing list in that way. But I can try to help you with vlc-devel issues you are having.

ILEoo
Developer
Developer
Posts: 91
Joined: 05 Nov 2008 16:29

Re: Wrong aspect ratio when transcoding video

Postby ILEoo » 26 Dec 2009 18:45

This should be fixed in head (upcoming 1.1) you can try nightly build tomorrow to check if it works for you.

vice
Blank Cone
Blank Cone
Posts: 61
Joined: 18 Oct 2007 13:43

Re: Wrong aspect ratio when transcoding video

Postby vice » 19 Apr 2010 01:31

I was just adding more information to try to track the problem.

And, yes, keep aspect ratio is just a simple workaround for (maybe) only VLC media player as client :)

xfgxie
New Cone
New Cone
Posts: 3
Joined: 14 Jan 2013 22:51

Re: Wrong aspect ratio when transcoding video

Postby xfgxie » 15 Jan 2013 02:31

This should be fixed in head (upcoming 1.1) you can try nightly build tomorrow to check if it works for you.
I still seem to have this problem. I am using 1.1.11. Has this bug been really fixed? Thanks.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Wrong aspect ratio when transcoding video

Postby Jean-Baptiste Kempf » 15 Jan 2013 18:02

Don't wake up 3 years old threads, please.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 51 guests