• Resolved mrengy

    (@mrengy)


    A relative shot a portrait orientation video with her iPad Mini (not sure which version / OS but I could find out if necessary), and I can’t seem to get the aspect ratio to display correctly on my site.

    I’ve tried various configurations of settings in the main Videopack Settings page and in the “Edit media” page for the video. Nothing seems to work.

    Browsers (same behavior in each):
    Mac OS 10.15.7 , Firefox 88.0.1
    Mac OS 10.15.7 , Chrome Version 90.0.4430.212 (Official Build)
    iPhone SE iOS 12.2 , Safari

    ===

    Combinations of settings and results

    Edit Media
    width: 360
    height: 640
    “Lock to aspect ratio”: unchecked

    Videopack settings
    Video player: “Video.js v7”
    “Set all videos to expand to 100% of their containers”: unchecked
    Default width: 360
    Default height: 640
    Constrain “Vertical” videos to default aspect ratio

    Image thumbnail appearance: https://share.getcloudapp.com/Blu49mED
    Video appearance: https://share.getcloudapp.com/mXupeN7k

    Edit Media
    width: 360
    height: 640
    “Lock to aspect ratio”: checked

    Videopack settings
    Video player: “Video.js v7”
    “Set all videos to expand to 100% of their containers”: unchecked
    Default width: 360
    Default height: 640
    Constrain “Vertical” videos to default aspect ratio`

    Same result for thumbnail and video appearance


    Edit Media
    width: 360
    height: 640
    “Lock to aspect ratio”: <strong>checked</strong>

    Videopack settings
    Video player: “<strong>WordPress Default</strong>”
    “Set all videos to expand to 100% of their containers”: unchecked
    Default width: 360
    Default height: 640
    Constrain “Vertical” videos to default aspect ratio`

    Image thumbnail appearance: https://share.getcloudapp.com/nOuoj48G
    Video appearance: https://share.getcloudapp.com/E0uYkNzd

    ===

    Interestingly the Edit Media page shows the dimensions as 1920 x 1080, and I was having issues before (which I resolved by changing Videopack image rotation settings) of the video appearing rotated sideways). Maybe somewhere in the depths of the information about this video, something thinks it is still supposed to be in landscape orientation?

    I’ll email you a link to the page where this is occurring.

    • This topic was modified 3 years, 6 months ago by mrengy. Reason: formatting
    • This topic was modified 3 years, 6 months ago by mrengy. Reason: Clarified source of video
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Kyle Gilman

    (@kylegilman)

    This is an encoding problem, not a video player problem. None of the plugin player settings will make a difference here because the 720p video has been stretched out to fill a 1920×1080 window during transcoding. You can see that by opening up the -720.mp4 video in its own tab without using my plugin. The original video is HEVC/H.265 because it was shot on an Apple device and they’re determined to make that a thing even though most web browsers don’t support it so only the 720p video will play in most browsers.

    Did you disable automatic rotation? You would need a very old version of FFMPEG to run into that problem. Would you mind posting the output of your FFMPEG test output with “Automatic FFMPEG Rotation” and “Test video rotation” enabled?

    Thread Starter mrengy

    (@mrengy)

    Ah, I see that when I view the video URL in its own tab. Strange.

    I didn’t disable automatic rotation, but I can try that. Earlier I had both “Enable automatic FFMPEG rotation” and “Enable legacy FFMPEG rotation method” checked, and it came out sideways in the player.

    Here’s the output of “test video rotation” with only the following FFMPEG legacy options checked: “enable legacy FFMPEG -b and -ba bitrate flags” and “Enable automatic FFMPEG rotation”:

    /usr/bin/ffmpeg -y -i "[path-to-site]/content/plugins/video-embed-thumbnail-generator/images/sample-video-rotated-h264.mp4" -acodec aac -strict experimental -ab 96k -s 640x360 -vcodec libx264 -crf 18 -threads 0 "[path-to-site]/content/uploads/2021/05/sample-video-h264-360.mp4"

    “FFMPEG test output”:

    ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers
      built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
      configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
      libavutil      55. 78.100 / 55. 78.100
      libavcodec     57.107.100 / 57.107.100
      libavformat    57. 83.100 / 57. 83.100
      libavdevice    57. 10.100 / 57. 10.100
      libavfilter     6.107.100 /  6.107.100
      libavresample   3.  7.  0 /  3.  7.  0
      libswscale      4.  8.100 /  4.  8.100
      libswresample   2.  9.100 /  2.  9.100
      libpostproc    54.  7.100 / 54.  7.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '[path-to-site]/content/plugins/video-embed-thumbnail-generator/images/sample-video-rotated-h264.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf57.56.100
      Duration: 00:00:00.04, start: 0.000000, bitrate: 1850 kb/s
        Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 1423 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
        Metadata:
          rotate          : 90
          handler_name    : VideoHandler
        Side data:
          displaymatrix: rotation of -90.00 degrees
        Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 193 kb/s (default)
        Metadata:
          handler_name    : SoundHandler
    Stream mapping:
      Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
      Stream #0:1 -> #0:1 (aac (native) -> aac (native))
    Press [q] to stop, [?] for help
    [libx264 @ 0x113e09288c80] using cpu capabilities: MMX2 SSE2Fast LZCNT
    [libx264 @ 0x113e09288c80] profile High, level 3.0
    [libx264 @ 0x113e09288c80] 264 - core 152 r2854 e9a5903 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - https://www.videolan.org/x264.html - options: 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=11 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=23 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=18.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to '[path-to-site]/content/uploads/2021/05/sample-video-h264-360.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf57.83.100
        Stream #0:0(eng): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 640x360, q=-1--1, 23.98 fps, 24k tbn, 23.98 tbc (default)
        Metadata:
          encoder         : Lavc57.107.100 libx264
          handler_name    : VideoHandler
        Side data:
          cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
          displaymatrix: rotation of -0.00 degrees
        Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 96 kb/s (default)
        Metadata:
          handler_name    : SoundHandler
          encoder         : Lavc57.107.100 aac
    frame=    1 fps=0.0 q=23.0 Lsize=       4kB time=00:00:00.04 bitrate= 822.4kbits/s speed=0.11x
    video:3kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 45.328033%
    [libx264 @ 0x113e09288c80] frame I:1     Avg QP: 9.67  size:  2292
    [libx264 @ 0x113e09288c80] mb I  I16..4: 92.2%  0.5%  7.3%
    [libx264 @ 0x113e09288c80] 8x8 transform intra:0.5%
    [libx264 @ 0x113e09288c80] coded y,uvDC,uvAC intra: 4.8% 0.0% 0.0%
    [libx264 @ 0x113e09288c80] i16 v,h,dc,p: 94%  1%  5%  0%
    [libx264 @ 0x113e09288c80] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 60% 40%  0%  0%  0%  0%  0%  0%  0%
    [libx264 @ 0x113e09288c80] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 34% 23%  2%  3%  2%  5%  2%  4%
    [libx264 @ 0x113e09288c80] i8c dc,h,v,p: 100%  0%  0%  0%
    [libx264 @ 0x113e09288c80] kb/s:439.62
    [aac @ 0x113e09282540] Qavg: 59782.387
    Thread Starter mrengy

    (@mrengy)

    Also, I tried disabling automatic FFMPEG rotation again and uploaded the same video again, and it showed up sideways. ??

    Plugin Author Kyle Gilman

    (@kylegilman)

    I would not recommend disabling automatic rotation. I was just asking to determine if that’s why you were having this problem.

    You don’t appear to have a very old version of FFMPEG. Did you have a problem when you ran the plugin with the legacy -b flags disabled? Usually you’d have to go back something like six or seven years to find a version of FFMPEG that requires the legacy flags.

    I don’t have a lot of time to troubleshoot this week so I think your best bet is to convert the video locally using something like Handbrake.

    Thread Starter mrengy

    (@mrengy)

    I just disabled the legacy -b flags, and uploaded again, and it seemed to encode correctly on a test post. Good guess! And thanks for the useful plugin.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can’t seem to correct video aspect ratio’ is closed to new replies.