Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] MP4 H.264 video rotation problem #100

Open
itlancer opened this issue Aug 30, 2019 · 0 comments
Open

[Android] MP4 H.264 video rotation problem #100

itlancer opened this issue Aug 30, 2019 · 0 comments

Comments

@itlancer
Copy link

Problem Description

MP4 H.264 rotated video have render problems with Android. If it rotated it skews above black rectangle and actually video don't rotating (see attached screenshot).
It has been tested from AIR 13.0.0.83 to latests AIR 32.0.0.144 beta and AIR 33.0.1.228 with different Android.
Same problem in all cases with any MP4 (H.264) videos.
It works fine with FLV videos, but it's not supported in Media Encoder CC 2014 any more.
Also it works fine with Windows.

Tracker and related issues:
https://tracker.adobe.com/#/view/AIR-3810201
https://tracker.adobe.com/#/view/AIR-4198792

Steps to Reproduce

Launch code below with any Android device. Try to play video with rotation of Video object.
Application example with sources and example of video attached.
video_rotation_bug.zip

package  {
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.net.NetConnection;
	import flash.net.NetStream;
	import flash.media.Video;
	import flash.events.NetStatusEvent;
	
	public class VideoRotationBug extends Sprite {
		private var nc:NetConnection;
		private var ns:NetStream;
		private var video:Video = new Video(640, 480);
		
		public function VideoRotationBug() {
			addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init(e:Event):void {
			removeEventListener(Event.ADDED_TO_STAGE, init);
			
			video.y = 200;
			video.rotation = -30;
			addChild(video);
			
			nc = new NetConnection();
			nc.addEventListener(NetStatusEvent.NET_STATUS, ncHandler);
			nc.connect(null);
		}
		
		private function ncHandler(e:NetStatusEvent):void {
			if (e.info.code == "NetConnection.Connect.Success"){
				ns = new NetStream(nc);
				ns.client = {onMetaData:getMeta};
				ns.addEventListener(NetStatusEvent.NET_STATUS, nsHandler);
				video.attachNetStream(ns);
				ns.play("video.mp4");
			}
		}
		
		private function nsHandler(e:NetStatusEvent):void {
			trace(e.info.code);
			if (e.info.code == "NetStream.Play.Stop"){
				e.target.removeEventListener(NetStatusEvent.NET_STATUS, nsHandler);

				ns = new NetStream(nc);
				ns.client = {onMetaData:getMeta};
				ns.addEventListener(NetStatusEvent.NET_STATUS, nsHandler);
				video.attachNetStream(ns);
				ns.play("video.mp4");
			}
		}

		private function getMeta(mdata:Object):void { }
	}
}

Actual Result:
Video skews above black rectangle. See attached screenshot.
Screenshot_2014-08-22-10-45-17

Expected Result:
Rotated video playback without skews and deformations above black rectangle.

Known Workarounds

none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant