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

Netstrream.play.failed on Ubuntu 22.04 #1984

Open
princeofspace opened this issue Jun 21, 2022 · 11 comments
Open

Netstrream.play.failed on Ubuntu 22.04 #1984

princeofspace opened this issue Jun 21, 2022 · 11 comments

Comments

@princeofspace
Copy link

princeofspace commented Jun 21, 2022

Problem Description

SWF Content on Ubuntu 22.04 fails to stream mp4s. This was tested on various versions of the SDK and confirmed on AIR 33.1.1.889.

Steps to Reproduce

The following code is what I've been using to test with:

Files.zip

`
package {
import flash.net.NetConnection;
import flash.display.MovieClip;
import flash.net.NetStream;
import flash.media.Video;
import flash.events.NetStatusEvent;

[SWF(frameRate="24", width="800", height="800")]
public class Temp extends MovieClip {

	private var _connection:NetConnection = new NetConnection();
	private var _stream:NetStream;
	private var _video:Video = new Video();
	public function Temp() {
		_connection.connect(null);
		_stream = new NetStream(_connection);
		_video.attachNetStream(_stream);
		_stream.useHardwareDecoder = true;
		_stream.play('temp.mp4');
		
		_stream.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);

		_stream.client = this;

		addChild(_video);
	}

	private function onNetStatus(e:NetStatusEvent):void {
		trace('onNetStatus', e.info.code);
	}

	public function onMetaData(info:Object):void { }
	public function onTextData(info:Object):void { }
	public function onPlayStatus(info:Object):void { }
}

}

`

On a Mac, the result is that the video loads and plays with the following in the log:

onNetStatus NetStream.Play.Start
onNetStatus NetStream.Buffer.Full
onNetStatus NetStream.Buffer.Flush
onNetStatus NetStream.Play.Stop
onNetStatus NetStream.Buffer.Empty

On Ubuntu the video fails with the following log messages:

onNetStatus NetStream.Play.Start
onNetStatus NetStream.Buffer.Full
onNetStatus NetStream.Play.Failed
onNetStatus NetStream.Play.Stop

Known Workarounds

I haven't been able to work around the issue.

@princeofspace princeofspace changed the title Netstrream.play.failed Netstrream.play.failed on Ubuntu 22.04 Jun 21, 2022
@ajwfrost
Copy link
Collaborator

Hi - we're working on this, it looks like it's just linked with the removal of the software H.264 decoders from the runtime (due to patent licensing restrictions) so we're working on implementing a platform-specific implementation like was previously done for macOS/Windows...

thanks

@itlancer
Copy link

Video still doesn't work for Linux with latest AIR 50.0.1.1.

@itlancer
Copy link

@ajwfrost
With latest AIR 50.2.2.1 it marked as resolved but for us it still doesn't work. The same NetStream.Play.Failed.
Tested with multiple different Ubuntu 22.04 devices (also with VM).
In all cases ffmpeg installed with OS:

whereis ffmpeg
ffmpeg: /usr/bin/ffmpeg /usr/share/ffmpeg /usr/share/man/man1/ffmpeg.1.gz

@BwackNinja
Copy link

@itlancer
This isn't using the ffmpeg binary, but rather the ffmpeg libraries (libavcodec.so and friends)

@ajwfrost
Even using AIR 5.2.2.2, we can't get this to work. We are seeing "Invalid picture dimensions: 0 x 0!" which corresponds to a log message in libavcodec/indeo3.c. We built a minimal set of ffmpeg 5.1.2 libraries [1] just to support and test h.264 decoding and debug that issue. Using that, avcodec_find_decoder called with AV_CODEC_ID_INDEO3, which points to a difference between the enum in upstream and the version you are compiling against since AV_CODEC_ID_H264 is right next to it. Patching ffmpeg around that, we get further, but it crashes before displaying any frames of the video.

[1] We compiled using ./configure --prefix=~/ffmpeg --disable-stripping --disable-all --enable-protocol=file,cache,data,pipe,tee,unix --enable-parser=aac,aac_latm,h264,mpeg4video,mpegvideo,mpegaudio --enable-vaapi --enable-vdpau --enable-decoder=h264 --enable-avcodec --enable-avformat --enable-avfilter --enable-avdevice --disable-static --enable-shared --enable-rpath --enable-rdft --enable-filters --enable-ffplay --enable-demuxer=aac,avi,h264,m4v,mov && make && make install

@ajwfrost
Copy link
Collaborator

Hi
Thanks for the details .. so this may be a mismatch between build time and run time I guess. I was just taking a look, we seem to have different classes to cope with different versions of ffmpeg (are they really not compatible?) -> it seems an app built against an older version of ffmpeg may not work when run on a newer version. Will ask the developer to look into this again...
thanks

@BwackNinja
Copy link

Some success here. Tried several versions (including a couple libav releases) and they all still see avcodec_find_decoder called with AV_CODEC_ID_INDEO3, but FFmpeg 4.4.3 doesn't crash after patching around that. We can get video to display using the standard Video component, but it doesn't display with VideoTextures even though VideoTextures do now work with .flv files (so #2296 seems to be resolved).

There are issues with some video files though, which play fine on other platforms, ffmpeg-based players, and ffplay. With those videos, a frame of video does display, then the message [h264 @ 0x7fd2d400a940] no frame! is written to the command line when running, coming from ffmpeg, followed by the message Error decoding frame. I had better luck after encoding to the baseline profile.

@amorganiv
Copy link

Andrew... Are there still plans to implement the ability to play MP4 (H.264) videos on iOS devices? Currently, we have to use FFmpeg to convert the MP4 video to FLV's in order to play the video on iOS devices.

@ajwfrost
Copy link
Collaborator

Hi @amorganiv -> just checking, do you need to use the Video class for playback or could you instead use StageVideo? This should give you the playback capabilities on iOS.

We are looking at all this currently though, one of the team was checking how we could pull out the decoded video frames from the iOS av player and upload them into the internal rendering system for use in Video objects.. so all this sort of thing (and also the ability for external components - i.e. ANEs - to be able to push decoded frames/data into AIR) is definitely still planned!

thanks

@amorganiv
Copy link

Andrew... The StageVideo does work on iOS devices. Thank you! The only minor drawback is StageVideo objects always display behind other objects on the stage. The Video object is added to the display list. Glad to hear the team is looking into supporting the Video option on iOS.

@BwackNinja
Copy link

Has there been any update to this? We're still very interested in using video decoding capabilities with the Linux runtime, especially with hardware acceleration.

Also willing to test any new code as its being developed.

@itlancer
Copy link

@ajwfrost
Video playback still doesn't work even with latest AIR 51.0.1.1 for Linux.
NetStream::play() with IDataInput/ByteArray also doesn't work airsdk/ANE-PlayAssetDelivery#20 (comment)
In any case:

NetStream.Play.Start
NetStream.Buffer.Full
NetStream.Play.Failed
NetStream.Play.Stop

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

No branches or pull requests

6 participants