Приветствую, бьюсь не один час не могу понять как правильно конвертировать видео.
сперва считываю данные загруженного видео, проверяю размер изменять размер или нет. так проверяю если например с телефона снимаю получаю данные
mediainfo '.$video.' | grep Rotation
на тесте айфон. получаю инфу что видео нужно повернуть. далее делаю постер.
Вообщем все работает как надо. но проблема в том что когда кодирую с поворотом то html5 video продолжает его показывать с изначальными данными. т.е. поворачивает видео уже повернутое.
предполагаю что мета данные видео не обновляются и html5 читает их и поворачивает автоматом.
Как обновить данные после переворота?
медиаинфо до конвертирования
spoilerFormat : MPEG-4
Format profile : QuickTime
Codec ID : qt 0000.00 (qt )
File size : 2.52 MiB
Duration : 24 s 747 ms
Overall bit rate mode : Variable
Overall bit rate : 853 kb/s
Encoded date : UTC 2017-08-26 06:27:24
Tagged date : UTC 2017-08-26 06:27:49
Writing library : Apple QuickTime
com.apple.quicktime.make : Apple
com.apple.quicktime.model : iPhone 6 Plus
com.apple.quicktime.software : 10.3.2
com.apple.quicktime.creationdate : 2017-08-26T11:27:24+0500
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Baseline@L3
Format settings, CABAC : No
Format settings, RefFrames : 1 frame
Format settings, GOP : M=1, N=30
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 24 s 747 ms
Bit rate : 756 kb/s
Width : 480 pixels
Height : 360 pixels
Display aspect ratio : 4:3
Rotation : 90?
Frame rate mode : Variable
Frame rate : 29.970 (29970/1000) FPS
Minimum frame rate : 28.571 FPS
Maximum frame rate : 30.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.146
Stream size : 2.23 MiB (89%)
Title : Core Media Video
Encoded date : UTC 2017-08-26 06:27:24
Tagged date : UTC 2017-08-26 06:27:49
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.601
Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 24 s 747 ms
Source duration : 24 s 799 ms
Bit rate mode : Variable
Bit rate : 86.6 kb/s
Channel(s) : 1 channel
Channel positions : Front: C
Sampling rate : 44.1 kHz
Frame rate : 43.066 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 262 KiB (10%)
Source stream size : 262 KiB (10%)
Title : Core Media Audio
Encoded date : UTC 2017-08-26 06:27:24
Tagged date : UTC 2017-08-26 06:27:49
Other #1
Type : meta
Duration : 24 s 747 ms
Duration_FirstFrame : 5370
Duration_LastFrame : 18443
Bit rate mode : VBR
Other #2
Type : meta
Duration : 24 s 747 ms
Bit rate mode : CBR
после конвертирования
spoilerFormat : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 1.78 MiB
Duration : 24 s 823 ms
Overall bit rate mode : Variable
Overall bit rate : 601 kb/s
Writing application : Lavf56.25.101
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3
Format settings, CABAC : Yes
Format settings, RefFrames : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 24 s 759 ms
Bit rate : 512 kb/s
Width : 360 pixels
Height : 480 pixels
Display aspect ratio : 0.750
Rotation : 90?
Frame rate mode : Constant
Frame rate : 29.970 (30000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.099
Stream size : 1.53 MiB (86%)
Writing library : x264 core 142 r2495 6a301b6
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=1 / 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=abr / mbtree=1 / bitrate=512 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 24 s 823 ms
Bit rate mode : Variable
Bit rate : 75.8 kb/s
Maximum bit rate : 96.0 kb/s
Channel(s) : 2 channels
Channel(s)_Original : 1 channel
Channel positions : Front: C
Sampling rate : 44.1 kHz
Frame rate : 43.066 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 230 KiB (13%)
Default : Yes
Alternate group : 1