Skip to main content
Inspiring
May 29, 2015
Question

VideoTexture sequence unpredictable crash on iOS

  • May 29, 2015
  • 2 replies
  • 3164 views

Hi all,

We are trying to play several clips sequence with VideoTextures but code is crashing unpredictably on iOS devices from time to time.

I have created sample codebase for it, so one can try it. Sources are here https://www.dropbox.com/s/wdnf5q2zrq73f1l/VideoTextureTest.zip?dl=0 Here is full logic of what is happening:

package videotexturetest.views.application

{

  import feathers.controls.ImageLoader;

  import flash.events.NetStatusEvent;

  import flash.net.NetConnection;

  import flash.net.NetStream;

  import starling.display.Sprite;

  import starling.events.Event;

  import starling.textures.Texture;

  public class ApplicationView extends Sprite

  {

  private var _currentIndex = 1;

  private var _numVideos = 8;

  private var _image:ImageLoader;

  private var _connection:NetConnection;

  private var _currentStream:NetStream;

  private var _currentTexture:Texture;

  private var _nextStream:NetStream;

  private var _nextTexture:Texture;

  public function ApplicationView()

  {

  addEventListener(Event.ADDED_TO_STAGE, function(event:Event):void

  {

  initialize();

  });

  }

  private function prepareNextStream():void

  {

  if (_currentIndex == _numVideos)

  {

  _nextStream = null;

  _nextTexture = null;

  return;

  }

  trace("Preparing next texture:", "videos/clip_" + (_currentIndex + 1) + ".mp4");

  // Second NetStream connection

  _nextStream = new NetStream(_connection);

  _nextStream.client = { onMetaData : function(infoObject:Object) {} };

  Texture.fromNetStream(_nextStream, 1, function(texture:Texture):void

  {

  trace("Video texture is ready:", "videos/clip_" + (_currentIndex + 1) + ".mp4");

  _nextTexture = texture;

  _nextStream.togglePause();

  });

  _nextStream.play("videos/clip_" + (_currentIndex + 1) + ".mp4");

  }

  private function initialize():void

  {

  _image = new ImageLoader();

  _image.setSize(stage.stageWidth, stage.stageHeight);

  addChild(_image);

  _connection = new NetConnection();

  _connection.connect(null);

  // First NetStream connection

  _currentStream = new NetStream(_connection);

  _currentStream.client = { onMetaData : function(infoObject:Object) {} };

  _currentStream.addEventListener(NetStatusEvent.NET_STATUS, function(event:NetStatusEvent):void

  {

  if (event.info.code == 'NetStream.Play.Stop' && _nextStream)

  {

  var stream:NetStream = event.target as NetStream;

  stream.removeEventListener(NetStatusEvent.NET_STATUS, arguments.callee);

  _currentIndex++;

  _nextStream.addEventListener(NetStatusEvent.NET_STATUS, arguments.callee);

  _image.source = _nextTexture;

  _nextStream.togglePause();

  _currentTexture.dispose();

  _currentStream.close();

  _currentTexture = _nextTexture;

  _currentStream = _nextStream;

  prepareNextStream();

  }

  });

  Texture.fromNetStream(_currentStream, 1, function(texture:Texture):void

  {

  trace("Video texture is ready:", "videos/clip_" + _currentIndex + ".mp4");

  _currentTexture = texture;

  _image.source = _currentTexture;

  });

  prepareNextStream();

  _currentStream.play("videos/clip_" + _currentIndex + ".mp4");

  }

  }

}

Two streams exist as same time. One for current video and second one for next one. It allows us to switch videos without flickering. Code works fine on desktop (air simulator) but when I try to launch it in real ios device app is crashing and I have the following error in device logs:

May 29 07:41:57 iPhone-Alexey ReportCrash[3541] <Notice>: ReportCrash acting against PID 3540

May 29 07:41:57 iPhone-Alexey ReportCrash[3541] <Notice>: Formulating crash report for process VideoTextureTest[3540]

May 29 07:41:57 iPhone-Alexey com.apple.launchd[1] (UIKitApplication:VideoTextureTest[0x917b][3540]) <Warning>: (UIKitApplication:VideoTextureTest[0x917b]) Job appears to have crashed: Segmentation fault: 11

May 29 07:41:57 iPhone-Alexey mediaserverd[3071] <Warning>: 07:41:57.609 [0x3f31000] CMSession retain count > 1!

May 29 07:41:57 iPhone-Alexey backboardd[28] <Warning>: Application 'UIKitApplication:VideoTextureTest[0x917b]' exited abnormally with signal 11: Segmentation fault: 11

May 29 07:41:57 iPhone-Alexey mediaserverd[3071] <Warning>: Encountered an XPC error while communicating with backboardd: <error: 0x3c8d7744> { count = 1, contents =

  "XPCErrorDescription" => <string: 0x3c8d79dc> { length = 22, contents = "Connection interrupted" }

  }

May 29 07:41:57 iPhone-Alexey mediaserverd[3071] <Error>: 07:41:57.670 [0x4035000] sessionID = 0xbff6e4: cannot get ClientInfo

May 29 07:41:57 iPhone-Alexey mediaserverd[3071] <Error>: 07:41:57.673 ERROR: [0x4035000] 150: AudioQueue: Error 'ini?' from AudioSessionSetClientPlayState(0xbff6e4)

Could anyone suggest something about this issue? Is it a problem in NetStream or it somehow connected to VideoTexture?

Same information was published in Starling forum VideoTexture « Starling Forum

This topic has been closed for replies.

2 replies

Adobe Employee
June 2, 2015

Thanks for reporting the issue.

We are able to reproduce the issue and logged an internal bug 3998622 for the same. we will investigation it and update you soon.

Regards,

Adobe AIR team

Participating Frequently
June 21, 2015

Hi Jitender
Can you confirm the status of 3998622?

Appreciate 3 weeks have now elapsed since time of last comment/issue replication. Has there been any progress, can we expect future release addressing this issue?


BTW: We are trying to plan the launch phase of an application, subject to this bug being addressed.

Any updates would be greatley appreciated.


Adobe Employee
June 22, 2015

Hi Marcus,

Thanks for being patient. We are working on the fix and will update you as soon as it get fixed.

Regards,

Adobe AIR Team

Participating Frequently
May 29, 2015

I have been able to reproduce this problem (crashes) from provided AS source; with latest/previous labs sdk

iPhone5 - 6.0.1
iPad3 - 7.1.2

Has anyone in the community managed to get multiple Netstream's via videoTextureworking correctly to switch video clip playback on IOS or Android devices without intermitentcrash issues?

(@) Adobe team - useful to know if this is a known issue or any workarounds?been scratching my head on this issue for the last week!