airsdk / Adobe-Runtime-Support

Report, track and discuss issues in Adobe AIR. Monitored by Adobe - and HARMAN - and maintained by the AIR community.
204 stars 11 forks source link

MP4 H.264 videos with High 10 Profile (Hi10P, 110) or High 4:4:4 Predictive Profile (Hi444PP, 244) doesn't play properly #139

Open itlancer opened 5 years ago

itlancer commented 5 years ago

Problem Description

MP4 H.264 videos with High 10 Profile (Hi10P, 110) or High 4:4:4 Predictive Profile (Hi444PP, 244) doesn't play properly (or doesn't at all) with AIR. https://en.wikipedia.org/wiki/Advanced_Video_Coding#Profiles Tested with multiple devices across many OSes and its versions and firmwares: Windows, macOS, Android, iOS. It has been tested with multiple AIR SDK versions to latests AIR 32.0.0.144 beta and AIR 33.0.2.288. Tried with simple Video object, StageVideo and VideoTexture. Same problem in all cases with any H.264 (MP4) videos with specified profiles. May be same problems exists with other High profiles too. Many others video players and some browsers correct playback these videos on the same devices.

Changing renderMode doesn't help. NetStream::useHardwareDecoder = true doesn't help. Changing disableMediaCodec doesn't help - with Android it cause black screen instead of video with audio wheezing at start. Changing hardwareAccelerated in Android application manifest doesn't help. Changing containsVideo in application manifest doesn't help.

Related issues (not the same): https://github.com/Gamua/Adobe-Runtime-Support/issues/89 https://github.com/Gamua/Adobe-Runtime-Support/issues/80 https://github.com/Gamua/Adobe-Runtime-Support/issues/88

Steps to Reproduce

Launch code below with any MP4 H.264 video with High 10 Profile (Hi10P, 110) or High 4:4:4 Predictive Profile (Hi444PP, 244). Application example with sources and example of video with High 10 Profile (Hi10P, 110) attached. video_high_profile_bug.zip

package {
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.net.NetConnection;
    import flash.net.NetStream;
    import flash.media.StageVideo;
    import flash.geom.Rectangle;
    import flash.events.NetStatusEvent;
    import flash.media.Video;

    public class VideoHighProfileBug extends Sprite {
        private var nc:NetConnection;
        private var ns:NetStream;

        public function VideoHighProfileBug() {
            addEventListener(Event.ADDED_TO_STAGE, init);
        }

        private function init(e:Event):void {
            removeEventListener(Event.ADDED_TO_STAGE, init);

            nc = new NetConnection();
            nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
            nc.connect(null);
        }

        private function netStatusHandler(event:NetStatusEvent):void {
            trace(event.info.code);
            switch (event.info.code){
                case "NetConnection.Connect.Success":
                    ns = new NetStream(nc);
                    ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                    ns.client = {onMetaData:getMeta, onPlayStatus:onPlayStatus};
                    var sv:StageVideo = stage.stageVideos[0];
                    sv.viewPort = new Rectangle(0, 0, 1280, 800);
                    sv.attachNetStream(ns);
                    ns.play("high10Profile.mp4");
                    break;
                case "NetStream.Play.StreamNotFound":
                    trace("Stream not found");
                    break;
            }
        }

        private function getMeta(mdata:Object):void {
            trace("avc profile:", mdata["avcprofile"]);//Trace MP4 H.264 video AVC profile

            //MP4 H.264 videos with High 10 Profile (Hi10P, 110) or High 4:4:4 Predictive Profile (Hi444PP, 244) doesn't play correctly
            if (mdata["avcprofile"] == 110 || mdata["avcprofile"] == 244) trace("!!! incorrect video playback !!!");
        }

        //Seek video to begin after complete
        private function onPlayStatus(infoObject:Object):void {
            ns.seek(0);
        }
    }
}

Actual Result: Video doesn't play at all or play as white/black screen or play in green colors. actual Android: AIR 32.0.0.89 - video playback failed AIR 32.0.0.144 - video playback failed AIR 33.0.2.288 - video playback failed

Windows: AIR 32.0.0.89 and earlier - video playback in green colors AIR 32.0.0.109 - video playback failed https://github.com/Gamua/Adobe-Runtime-Support/issues/80 AIR 32.0.0.144 - no video playback (white screen) https://github.com/Gamua/Adobe-Runtime-Support/issues/80 AIR 33.0.2.288 - no video playback (white screen) https://github.com/Gamua/Adobe-Runtime-Support/issues/80

iOS: AIR 32.0.0.89 - video playback failed AIR 32.0.0.144 - video playback failed AIR 33.0.2.288 - video playback failed

macOS: AIR 30.0.0.107 - video playback in green colors AIR 32.0.0.129 - no video playback (white screen) AIR 33.0.2.288 - no video playback (white screen)

Expected Result: Correct video playback. expected

Known Workarounds

none

itlancer commented 3 years ago

With latest AIR 31.1.1.345 application sample from origin issue https://github.com/Gamua/Adobe-Runtime-Support/files/3800422/video_high_profile_bug.zip cause application hanging for Windows. Any operation with NetStream (seek, play, close etc methods) after onPlayStatus event for such videos just cause application hanging without any callstacks or errors.

itlancer commented 3 years ago

@ajwfrost With latest AIR 31.1.1.476 application still hangs and crashes with provided sample.

itlancer commented 3 years ago

Hangs still exists with latest AIR 33.1.1.533 BETA.

itlancer commented 5 months ago

Hangs still exists with latest AIR 51.0.1.1. Also the same issue with High 4:2:2 Profile (Hi422P, 122) videos. Sample:

https://github.com/airsdk/Adobe-Runtime-Support/assets/10899066/4d524bf3-3ed1-4dea-aced-3780d40f98c0

itlancer commented 4 days ago

Issue still exists with latest AIR 51.1.2.1.