I am using vlc windows command line to transcode video to change the aspect ratio. My source video resolution is 352x480, codec: MPEG-4 (mp4v)
The command line I use is:
vlc c:\SourceVideo.ts :sout=#transcode{vcodec=mpgv,vb=256,width=320,height=240,canvas-width=320,canvas-height=240,canvas-aspect=4:3,fps=25}:std{access=file,mux=ts,dst="C:\Test.ts"}
I can use this command line above to successfully change the video to 320x240. But if I change the vcodec=h264, the converted video seems like is 320x480 which keeps the original aspect-ratio. The interesting thing is that its Codec details shown in VLC player is Codec: H264 - MPEG-4 AVC (part 10) (h264), Resolution: 320x240.
The snapshots I take from these videos are:
Orignial video: although the resolution is 352x480, but the snapshots pixel is 352x528
http://bugatti.nvfast.org/vlcsnap-original.png
transcoded using vcodec=mpgv, snapshot pixel is 320x240, which is what I want.
http://bugatti.nvfast.org/vlcsnap-transcoded-mpgv.png
transcoded using vcodec=h264, snapshot pixel is 320x480. I need 320x240, this is not what I want.
http://bugatti.nvfast.org/vlcsnap-transcoded-h264.png
Please, someone can give me a hint to figure this out. It seems vcodec=h264 is not working correctly to change the aspect-ratio. I have to use h264 because I transcode my video for apple HLS streaming. Thanks.