Vero V: rotated HEVC phone videos play sideways (cause found + workaround add-on)

Rotated iPhone videos (HEVC, 90/180/270 in the tkhd matrix) play sideways or upside down on my Vero V with amcodec enabled. H.264 rotated videos play fine. Disabling amcodec fixes the orientation but stutters. Same issue as this thread and this one.

Setup: Vero V, vero5-mediacenter-osmc 21.3.0-7, kernel 4.9.269-93-osmc.

Cause

  1. setVideoRect only writes the manual orientation (m_orientation) to /sys/class/ppmgr/orientation, never video_rotation_degree. The rotation only reaches the decoder via gcodec.param, which the H.264 decoder honours and the HEVC one ignores.
  2. HEVC frames come out compressed (amvdec_h265 mmu_enable=1), and ppmgr does not rotate them.

With double_write_mode=1 on amvdec_h265 and the stream rotation (0-3) written to ppmgr/orientation, the video plays upright and smooth. Tested with 90, 180 and 270 clips.

Possible fix in the vero5 patch

  • Write (m_orientation + video_rotation_degree) % 4 to ppmgr/orientation.
  • Enable double write for HEVC streams with a rotation.

Workaround meanwhile

I published a small service add-on that does both: GitHub - juanmaguitar/service.vero.rotation: Kodi service add-on for OSMC Vero: plays rotated HEVC phone videos upright · GitHub (install from zip). One open question: it keeps double_write_mode=1 for all HEVC playback. Could that hurt 4K HDR / DV playback? Happy to test builds.

2 Likes

Thank you, that fixes playback of my videos recorded on my Android phone.
It would be nice to have the fix in the official OSMC build :slight_smile:

Excellent! IIRC this hasn’t worked since we went from kernel 3.14 to 4.9. And iPhone footage was worse than Android. I’ll give it a test.

The rotation does now work for me for some DJI OSMO Action videos that I have but it seems a bit pixelated or moire or something, not really sure how to explain it. Good effort getting it working though.

Nice find! This fixes the rotated HEVC issue without the stutter. Would be good to know if double_write_mode=1 causes any issues with 4K HDR or DV.