How to record A/V 90 degrees rotated ?

*nix specific usage questions
rmvb
Blank Cone
Blank Cone
Posts: 47
Joined: 19 Oct 2011 11:14
Operating System: Linux

How to record A/V 90 degrees rotated ?

Postby rmvb » 06 Mar 2017 10:29

Hi
I have similar job to do but the original file.MOV is rotated 90°CCW and was from a friend's phone 1280*720px.
I can read it OK when using transformation filter 90°CW, but when following instructions in the link above to re-rec the file, in preferences I can only set destination folder but not output file name. Although I can find the resulting vlc-record-timestamp-file.MOV.mp4 in the designated destination folder.
But whether I selected or not Tools/Preferences/All/Out stream/Out stream/Transcode/Picture transformation video filter (Tools/List of effects/filters/Video effects/Geometry/Transformation/90°Rotation still being selected in both cases), the outfile is not rotated (I check with Totem to be sure VLC settings for re-rec do not interfere)

Instead when using Ctrl+R (Convert/Record) I can choose input file and path/outfile.mov. In order to preserve default profiles, I setup a dedicated Rotation one based on Video H264 + MP3 profile (MP4/MOV, Video Encoding H264, thoughput & quality Not Used, Frame speed same as source, Resolution Scale Auto, Width 720, Height 1280 & selected Video transformation filter, and Audio MP3 128/2/44100).
But then, although rotation is saved OK as well as sound, the resulting video is 1280*720 instead of 720*1280, has the left half flickering scrambling green, the right side being visible and square and centered from original video (with missing up & down). When I select only one out of width or height the resulting file is clean square and W/H ratio is no more respected. Depending on I choose .mov or .mp4 outfile the size is very different. I also got a outfile with two small rotated videos one above the other.

Please what is the way ?

Thank you

zcot
Big Cone-huna
Big Cone-huna
Posts: 606
Joined: 15 Jun 2005 10:58

Re: How to record A/V 90 degrees rotated ?

Postby zcot » 11 Mar 2017 03:10

This works properly for me, although it's an mp4 file, which I put in my home directory(and the output ends up there too).

Code: Select all

vlc "InputFile.mp4" --transform-type=270 :sout='#transcode{vcodec=mp4v,vfilter=transform}:std{access=file,dst="OutputFile.mp4"}' vlc://quit

Rémi Denis-Courmont
Developer
Developer
Posts: 15263
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: How to record A/V 90 degrees rotated ?

Postby Rémi Denis-Courmont » 11 Mar 2017 08:32

That command line will decode and reencode, wasting a lot of CPU and degrading the video quality.

VLC should automatically rotate the video; if it does not, you might need to update. I don't think saving the transformation matrix is supported yet.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

rmvb
Blank Cone
Blank Cone
Posts: 47
Joined: 19 Oct 2011 11:14
Operating System: Linux

Re: How to record A/V 90 degrees rotated ?

Postby rmvb » 11 Mar 2017 12:35

When playing the mov on a win32 latest VLC 2.2.4, the video is not rotated (my ubuntu 14.04 is stuck to VLC2.1.6).
I think when people catch a video (or photo) with a phone and they have autorotation disabled, depending on the way they physically hold the phone rotated or not is the reason we get original recording rotated. So transcoding seems to be required if I understand well.
I don't care at all with CPU usage as long as it's the only way to reach the goal.

So I did the conversion with windows

Code: Select all

C:\Documents and Settings\me\Sync>"C:\Program Files\VideoLAN\VLC\vlc.exe" -I dummy ".\Titou2.mov" --transform-type=90 --sout="#transcode{vcodec=h264,vfilter=transform}:std{access=file,dst=.\Titou2v.mov}" vlc://quit
This is far better as the ouput, although roughly a third in size (what Rémi calls "degrading the video quality." I believe, or this opinion was about mov/h264 ->mp4 additional loss in conversion ?). The output plays fine in ubuntu both in other player and vlc216 (ratio/proportion=preset/prédéfinie), but strangely in windows vlc224 I have to force ratio to 16:9 (when Crtl+J says 720x1280 !) to get a fine view. More strangely a snapshot is good when video plays bad (1:1) and snap is KO (same bad ratio as bad video) when vid is OK! ???

Back to ubuntu to try zcot conversion (very slightly tweaked) I get from

Code: Select all

cvlc "IMG_1362.MOV" --transform-type=90 :sout='#transcode{vcodec=mp4v,vfilter=transform}:std{access=file,dst="Titou2v.mp4"}' VLC media player 2.1.6 Rincewind (revision 2.1.6-0-gea01d28) [0x895c98] dummy interface: using the dummy interface module... [0x7f4e500039a8] stream_out_transcode stream out error: cannot find audio encoder (module:any fourcc: ). Take a look few lines earlier to see possible reason. [0x7f4e500039a8] stream_out_transcode stream out error: cannot create audio chain [0x7f4e50c1bba8] main decoder error: cannot create packetizer output (mp4a) [mpeg4 @ 0x7f4e44005200] removing common factors from framerate libva info: VA-API version 0.35.0 libva info: va_getDriverName() returns 0 libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so libva info: va_openDriver() returns -1 [0x7f4e44003478] vaapi generic error: Failed to initialize the VAAPI device [mpeg4 @ 0x7f4e4455c320] removing common factors from framerate [h264 @ 0x7f4e44001920] Cannot parallelize deblocking type 1, decoding such frames in sequential order libva info: VA-API version 0.35.0 libva info: va_getDriverName() returns 0 libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so libva info: va_openDriver() returns -1 [0x7f4e4800b0d8] vaapi generic error: Failed to initialize the VAAPI device Fontconfig warning: FcPattern object size does not accept value "0" Fontconfig warning: FcPattern object size does not accept value "0" Fontconfig warning: FcPattern object size does not accept value "0" Fontconfig warning: FcPattern object size does not accept value "0" [0x7f4e44001ca8] main vout display error: Failed to resize display [0x7f4e44003308] xcb_window window error: X server failure
a bad video 1/10 weight against original, double square one above the other with a flickering band between each (beside no sound which is another off topic issue).
When using h264 instead:

Code: Select all

cvlc "IMG_1362.MOV" --transform-type=90 :sout='#transcode{vcodec=h264,vfilter=transform}:std{access=file,dst="Titou2v.mov"}' VLC media player 2.1.6 Rincewind (revision 2.1.6-0-gea01d28) [0x1c269f8] dummy interface: using the dummy interface module... [0x7f10e4000958] x264 encoder: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX [0x7f10e4000958] x264 encoder: profile Constrained Baseline, level 3.1 [0x7f10d40039a8] stream_out_transcode stream out error: cannot find audio encoder (module:any fourcc: ). Take a look few lines earlier to see possible reason. [0x7f10d40039a8] stream_out_transcode stream out error: cannot create audio chain [0x7f10d4c1ba68] main decoder error: cannot create packetizer output (mp4a) libva info: VA-API version 0.35.0 libva info: va_getDriverName() returns 0 libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so libva info: va_openDriver() returns -1 [0x7f10e4c0d138] vaapi generic error: Failed to initialize the VAAPI device [0x7f10e4000958] x264 encoder: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX [0x7f10e4000958] x264 encoder: profile Constrained Baseline, level 3.1 [h264 @ 0x7f10e4c0c100] Cannot parallelize deblocking type 1, decoding such frames in sequential order [0x7f10e4000958] x264 encoder: frame I:3 Avg QP:20.00 size: 97213 [0x7f10e4000958] x264 encoder: frame P:698 Avg QP:23.13 size: 20912 [0x7f10e4000958] x264 encoder: mb I I16..4: 100,0% 0,0% 0,0% [0x7f10e4000958] x264 encoder: mb P I16..4: 3,9% 0,0% 1,5% P16..4: 64.7% 12.6% 1.3% 0.0% 0.0% skip:16.0% [0x7f10e4000958] x264 encoder: coded y,uvDC,uvAC intra: 46.5% 40.8% 6.6% inter: 35,4% 27,4% 0,0% [0x7f10e4000958] x264 encoder: i16 v,h,dc,p: 11% 57% 19% 13% [0x7f10e4000958] x264 encoder: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 9% 50% 18% 3% 3% 1% 7% 1% 7% [0x7f10e4000958] x264 encoder: i8c dc,h,v,p: 36% 46% 8% 10% [0x7f10e4000958] x264 encoder: kb/s:4247.70 [h264 @ 0x7f10d8c09bc0] A non-intra slice in an IDR NAL unit. [h264 @ 0x7f10d8c09bc0] decode_slice_header error libva info: VA-API version 0.35.0 libva info: va_getDriverName() returns 0 libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so libva info: va_openDriver() returns -1 [0x7f10d4001e88] vaapi generic error: Failed to initialize the VAAPI device Fontconfig warning: FcPattern object size does not accept value "0" Fontconfig warning: FcPattern object size does not accept value "0" Fontconfig warning: FcPattern object size does not accept value "0" Fontconfig warning: FcPattern object size does not accept value "0" [0x7f10e4000958] main vout display error: Failed to resize display [0x7f10e40094d8] xcb_window window error: X server failure
a bad video 1/2 weight against original, double square one above the other with a green band between each (beside same no sound).

As a summary, only windows helped, although quality loss.
Thanks for tips you gave

Bye

rmvb
Blank Cone
Blank Cone
Posts: 47
Joined: 19 Oct 2011 11:14
Operating System: Linux

[solved] Re: How to record A/V 90 degrees rotated ?

Postby rmvb » 27 Dec 2017 10:16

in the end all this does the job (unfortunately this is for Windows - but maybe this also works for recent linuxes):

Code: Select all

"C:\Program Files\VideoLAN\VLC\vlc.exe" -I dummy "in_img_1361.mov(or mp4)" --transform-type=90 --sout="#transcode{vcodec=mp4v(ou h264),vfilter=transform}:std{access=file,dst=out_img_1362.mp4(or mov)}" vlc://quit


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 9 guests