Setting aspect ratio via command line

About encoding, codec settings, muxers and filter usage
earth
New Cone
New Cone
Posts: 5
Joined: 20 Jun 2013 13:33

Setting aspect ratio via command line

Postby earth » 20 Jun 2013 13:45

I am streaming an XviD MPEG4 variant rtsp stream to disk. The resulting file shows a display aspect ratio of 1.11111 (10:9) in the metadata when viewed with MediaInfo.

The command line docs suggest you can set the aspect ratio by an option but I'm having no joy with it:

vlc.exe rtsp://192.168.20.102:554/ch0_unicast_firststream --sout="#duplicate{dst=display, dst={std{access=file, mux=avi, dst='c:\users\rja\desktop\aspectratiotest.avi'}}}" --no-sout-audio --aspect-ratio=4:3

Any suggestions as to what is wrong there?



Thanks,
Richard

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: Setting aspect ratio via command line

Postby Jean-Baptiste Kempf » 24 Jun 2013 16:57

Did you try to set the size directly in the transcode options?
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.

earth
New Cone
New Cone
Posts: 5
Joined: 20 Jun 2013 13:33

Re: Setting aspect ratio via command line

Postby earth » 25 Jun 2013 14:19

I haven't tried that but I don't want to transcode anyway.

Am I right in thinking the display aspect ratio int he meta data is simply a description of the aspect ratio that the viewer should attempt to view the video in? By that I mean there is no change to make to the video data if the display aspect ratio is changed?

earth
New Cone
New Cone
Posts: 5
Joined: 20 Jun 2013 13:33

Re: Setting aspect ratio via command line

Postby earth » 27 Jun 2013 18:00

Did you try to set the size directly in the transcode options?

I've used transcode now as follows:

H:\>vlc.exe rtsp://192.168.20.102:554/ch0_unicast_firststream --aspect-ratio=1.333 --sout="#transcode{vcodec=mp4v, width=320, height=240}:duplicate{dst=display, dst={std{access=file, mux=avi, dst='C:\Users\rja\Desktop\aspectratiotest.avi'}}}
"

Two things changed there.

1. Moved --aspect-ratio to before --sout. I find the display window is now set to the correct aspect ratio and if I look at the metadata with MediaInfo while streaming then the display aspect ratio is set to 4:3 as I would like. However When the streaming to the file is stopped the display aspect ratio meta data is set to 1.1111 (10:9) which is the aspect ratio of the source.

2. Added the transcode option set the horistontal and vertical resolution to what I want. The meta data in the file shows this resolution and when played from Window Media Player it appears as the correct aspect ratio but playing the file in VLC player results in the wrong ratio. I think this is because WMP ignores the display aspect ratio setting in the meta data and vlc does not. As I mentioned above the display aspect ratio is set incorrectly when the stream is closed.

earth
New Cone
New Cone
Posts: 5
Joined: 20 Jun 2013 13:33

Re: Setting aspect ratio via command line

Postby earth » 27 Jun 2013 18:01

The other thing is transcoding greatly lowers the video quality.

OzzWizard
New Cone
New Cone
Posts: 1
Joined: 17 Dec 2019 14:16

Re: Setting aspect ratio via command line

Postby OzzWizard » 17 Dec 2019 14:17

Did you try to set the size directly in the transcode options?

I've used transcode now as follows:

H:\>vlc.exe rtsp://192.168.20.102:554/ch0_unicast_firststream --aspect-ratio=1.333 --sout="#transcode{vcodec=mp4v, width=320, height=240}:duplicate{dst=display, dst={std{access=file, mux=avi, dst='C:\Users\rja\Desktop\aspectratiotest.avi'}}}
"

Two things changed there.

1. Moved --aspect-ratio to before --sout. I find the display window is now set to the correct aspect ratio and if I look at the metadata with MediaInfo while streaming then the display aspect ratio is set to 4:3 as I would like. However When the streaming to the file is stopped the display aspect ratio meta data is set to 1.1111 (10:9) which is the aspect ratio of the source.

2. Added the transcode option set the horistontal and vertical resolution to what I want. The meta data in the file shows this resolution and when played from Window Media Player it appears as the correct aspect ratio but playing the file in VLC player results in the wrong ratio. I think this is because WMP ignores the display aspect ratio setting in the meta data and vlc does not. As I mentioned above the display aspect ratio is set incorrectly when the stream is closed.
Rly thanks a lot bro. I opened an account to thank you.


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 6 guests