Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#1360 closed defect (fixed)

Video orientation support — at Version 6

Reported by: bennylp Owned by: nanang
Priority: normal Milestone: release-2.0-alpha2
Component: pjmedia Version: 2.0-dev-branch
Keywords: Cc:
Backport to 1.x milestone: Backported:

Description (last modified by bennylp)

Background

  • Mobile devices can be rotated (the rotation angle can be detected), which may lead to wrong video orientation in rendering/playback.

Objective

  • The purpose is to allow video rendering in natural orientation (head/sky upside) or the preferred orientation of the capturer.

Notes

  • Common video codecs works in predefined allowed sizes/orientation, e.g: CIF, QCIF.
  • On iOS, capturing video to a file will store the video data in camera's native orientation, i.e: wide-oriented, the capture orientation info (the device/camera orientation when the capture/record process is done) is stored in video metadata, so in playing back the file, the stored capture orientation info (may be combined with current device orientation info) is used to calculate rotation angle to get natural orientation in video rendering/playback.

Ideas

  • The orientation info is readable and read-only in capture.
  • The renderer will apply the orientation info provided by the capturer.
  • The orientation info is a rotation angle to be applied to a picture/video so it can be displayed naturally (or as the capturer preference).

Issues

  • SDP/SIP only offers limited support for orientation, and there is no way for sender to tell receiver about the video orientation of the capture device. The 'a=orient:x' in SDP is not really useful as this is receiver preference/capability, while in practice, the receiver can render any orientations and the capturer cannot really send portrait (codecs limitation, etc).

Specification

Based on the background above, the following API will be implemented by this ticket:

  • Add orientation capability to video device with the following specification:
    • it is read-only for capture devices, and
    • it is write-only for renderer devices
  • Add pjsua_vid_win_rotate(win, angle) API. The angle is a rotation angle to be applied to a picture/video so it can be displayed naturally (or as the capturer preference).

Change History (6)

comment:1 Changed 13 years ago by bennylp

  • Summary changed from Video orientation to Video orientation support

comment:2 Changed 13 years ago by bennylp

  • Owner changed from bennylp to nanang
  • Status changed from new to assigned

comment:3 Changed 13 years ago by nanang

  • Description modified (diff)

comment:4 Changed 13 years ago by nanang

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [3774]) Close #1360: implementated video orientation (currently only for video devices).

comment:5 Changed 13 years ago by bennylp

  • Description modified (diff)

comment:6 Changed 13 years ago by bennylp

  • Description modified (diff)
Note: See TracTickets for help on using tickets.