Page 1 sur 1

propriété : rotation 90 - non reprise après la conversion

Posté : sam. 15 avr., 2017 16:33
par igor76
Bonjour,

J'utilise m4ng pour réduire la taille des vidéos que je prends avec mon téléphone.
Lorsque mes vidéos sont prises à l'horizontal, je peux choisir n'importe quel encodeur : xVid, DivX, AVC. Ca fonctionne
En revanche, lorsque mes vidéos sont prises à la verticale : seul AVC arrivait à me les encoder en respectant la rotation qui est précisé dans le fichier. En effet, bien que la ratio soit conservée, avec xVid et Dvix, la propriété "rotation 90°" ne semblait pas prise en compte. Ainsi l'image qui était en 9:16 passe en 16:9 (d'où un effet ratatiné)

Mais sur le lot, avec AVC, j'ai 6 vidéos récalcitrantes prises à la verticale que je n'arrive pas à encoder normalement.
J'ai mis 2 exemples de fichiers qui ont été convertis avec le même profil. (AVC : x264, compression réduite, conteneur AVI)
La première, c'est parfait je n'ai pas de problème, la seconde l'image est ratatinée. Pour chacune j'ai mis les informations données par "MediaInfo"










Un exemple d'une vidéo qui est bien convertie :
--------------------------------------------------

- voici un "MediaInfo" de la vidéo originelle

General
Complete name : .....\\VID_20161121_193356.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42
File size : 41.0 MiB
Duration : 31s 723ms
Overall bit rate : 10.8 Mbps
Encoded date : UTC 2016-11-21 18:34:30
Tagged date : UTC 2016-11-21 18:34:30

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 1 frame
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 30s 112ms
Bit rate : 11.1 Mbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Rotation : 90°
Frame rate mode : Variable
Frame rate : 30.055 fps
Minimum frame rate : 14.490 fps
Maximum frame rate : 134.933 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.178
Stream size : 39.7 MiB (97%)
Title : VideoHandle
Language : English
Encoded date : UTC 2016-11-21 18:34:30
Tagged date : UTC 2016-11-21 18:34:30

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 31s 723ms
Source duration : 31s 735ms
Source_Duration_FirstFrame : 12ms
Bit rate mode : Constant
Bit rate : 128 Kbps
Nominal bit rate : 96.0 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Compression mode : Lossy
Stream size : 496 KiB (1%)
Source stream size : 496 KiB (1%)
Title : SoundHandle
Language : English
Encoded date : UTC 2016-11-21 18:34:30
Tagged date : UTC 2016-11-21 18:34:30
mdhd_Duration : 31723


- voici un "MediaInfo" de la vidéo convertie

General
Complete name : .....\OUT_VID_20161121_193356.avi
Format : AVI
Format/Info : Audio Video Interleave
File size : 3.03 MiB
Duration : 31s 848ms
Overall bit rate : 797 Kbps
Writing application : Lavf57.25.100

Video
ID : 0
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : H264
Duration : 30s 117ms
Bit rate : 691 Kbps
Width : 640 pixels
Height : 360 pixels
Display aspect ratio : 0.563
Frame rate mode : Variable
Frame rate : 60.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.050
Stream size : 2.46 MiB (81%)
Writing library : x264 core 148 r2665 a01e339
Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=2pass / mbtree=1 / bitrate=691 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00

Audio
ID : 1
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 3
Mode : Joint stereo
Mode extension : MS Stereo
Codec ID : 55
Codec ID/Hint : MP3
Duration : 31s 848ms
Bit rate mode : Constant
Bit rate : 128 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Compression mode : Lossy
Stream size : 496 KiB (16%)
Alignment : Aligned on interleaves
Interleave, duration : 23 ms (1.36 video frame)
Writing library : LAME3.99.5


Un exemple d'une vidéo qui est convertie (mais l'image est toute ratatinée)
---------------------------------------------------------------------------------

- voici un "MediaInfo" de la vidéo originelle

General
Complete name : .....\20161128_131448.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42
File size : 120 MiB
Duration : 58s 560ms
Overall bit rate : 17.2 Mbps
Encoded date : UTC 2016-11-28 12:15:47
Tagged date : UTC 2016-11-28 12:15:47
com.android.version : 6.0.1

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 1 frame
Format settings, GOP : M=1, N=30
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 58s 489ms
Bit rate : 17.0 Mbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Rotation : 90°
Frame rate mode : Variable
Frame rate : 30.000 fps
Minimum frame rate : 29.421 fps
Maximum frame rate : 30.612 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.273
Stream size : 119 MiB (98%)
Title : VideoHandle
Language : English
Encoded date : UTC 2016-11-28 12:15:47
Tagged date : UTC 2016-11-28 12:15:47
mdhd_Duration : 58489

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 58s 560ms
Source duration : 58s 564ms
Source_Duration_FirstFrame : 4ms
Bit rate mode : Constant
Bit rate : 256 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Compression mode : Lossy
Stream size : 1.79 MiB (1%)
Source stream size : 1.79 MiB (1%)
Title : SoundHandle
Language : English
Encoded date : UTC 2016-11-28 12:15:47
Tagged date : UTC 2016-11-28 12:15:47
mdhd_Duration : 58560




- voici un "MediaInfo" de la vidéo convertie
General
Complete name : .....\OUT_20161128_131448.avi
Format : AVI
Format/Info : Audio Video Interleave
File size : 5.81 MiB
Duration : 58s 632ms
Overall bit rate : 831 Kbps
Writing application : Lavf57.25.100

Video
ID : 0
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.0
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : H264
Duration : 58s 500ms
Bit rate : 691 Kbps
Width : 640 pixels
Height : 360 pixels
Display aspect ratio : 16:9
Frame rate mode : Variable
Frame rate : 30.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.100
Stream size : 4.81 MiB (83%)
Writing library : x264 core 148 r2665 a01e339
Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=2pass / mbtree=1 / bitrate=691 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00

Audio
ID : 1
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 3
Mode : Joint stereo
Codec ID : 55
Codec ID/Hint : MP3
Duration : 58s 632ms
Bit rate mode : Constant
Bit rate : 128 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Compression mode : Lossy
Stream size : 915 KiB (15%)
Alignment : Aligned on interleaves
Interleave, duration : 24 ms (0.72 video frame)
Writing library : LAME3.99.5

Je continue de chercher mais je vois pas en plus quelle option, je pourrais utiliser.
Merci pour votre aide.

Re: propriété : rotation 90 - non reprise après la conversio

Posté : sam. 15 avr., 2017 18:28
par Subbat
Salut,
Si je ne me trompe pas dans la previsualisation de m4ng tu peux mettre un option de rotation...

Re: propriété : rotation 90 - non reprise après la conversio

Posté : sam. 15 avr., 2017 20:41
par igor76
La vidéo est maintenant à l'équerre (je dois pencher la tête pour bien la voir) mais sinon le ratio est bon maintenant.
Est-ce qu'il y aura une possibilité pour retourner la video maintenant de 90° ? Une sorte de post traitement qui n'affecterait plus l'encodage.

Re: propriété : rotation 90 - non reprise après la conversio

Posté : sam. 15 avr., 2017 21:15
par igor76
Subbat,

J'ai remarqué ceci :
Sur le premier exemple qui fonctionne, l'aspect ratio est passé de 16/9 à 0.563 (soit 90° appliqué à 16/9). Du 9/16 en fait.
Sur le second exemple, l'aspect ratio a été conservé, d'où ce problème de ratio pour une vidéo prise à la verticale.

Sais-tu s'il est possible de forcer un aspect ratio car je pense que ça peut résoudre mon problème ?

Re: propriété : rotation 90 - non reprise après la conversio

Posté : sam. 15 avr., 2017 23:09
par Subbat
Bah écoute je n'ai pas la possibilité de tester quoi que soit ce WE. Mais normalement ce que tu as en preview est ce qui sera reencoder. Donc si dans la preview la vidéo n'est pas retourner à 90 il faut le faire manuellement via les options vidéos depuis la preview (ou filtres vidéos je sais plus).
Mais de manière générale la vidéo finale correspond à ce que tu vois en preview

Re: propriété : rotation 90 - non reprise après la conversio

Posté : sam. 22 avr., 2017 16:23
par igor76
> Mais de manière générale la vidéo finale correspond à ce que tu vois en preview
Dans mon cas avec mes fameuses 6 vidéos, le preview ne correspond pas avec l'encodage.
J'ai donc converti mes vidéos pour gagner en place. Elles sont à l'horizontal et pour les visionner j'utiliserai VLC avec la rotation.

Merci en tout cas pour ton aide sur m4ng.

A bientôt.