Not able to play recorded mp4 file in iOS 10

Ney

Member
Hi
I am able to publish and play the stream. At the time of publishing the video, we are also recording them. I am able to successfully record the audio as well. But the issue is with to play the recorded video. I had tried to user MPMoviePlayer and AVPlayerViewController, but both are not working. Even in your sample (Stream recording), Code for playing recorded video is commented out (ViewController.m line 150). Could you please help, how can I play the recorded video in our app


One of the sample video that has been recorded and saved successfully on server http://buckwormvideos.com:9091/clie...6-2F195FEC791C-n5b4gp7g3kopc71c9bfgmdbtfo.mp4. But this file is not playable on iOS.
 

Max

Administrator
Staff member
On iOS Safari you can play MP4 files using HLS, however you need a server for HLS delivery (m3u8).
This is related to all MP4 files, not only files recorded by WCS.
Currently WCS does not support HLS playback of MP4 (VOD).
So you have to use Apache+plugins or nginx to deliver this file over HLS.
 

Ney

Member
Earlier we were using, red5pro on same server and converting the file from flv to mp4 and we were successfully played those files.

More over I am using MPMoviePlayer, not the iOS safari browser, which can definitely play mp4.
 

Max

Administrator
Staff member
Looks like something is wrong with our mp4.
We will check it.
As an option, try to re-encode the mp4 file using ffmpeg.
 

Ney

Member
We can not ffmpeg for our case, as this is time taking process and in our app, we are offering the user to see the video, as live stream gets stopped.
 

Max

Administrator
Staff member
Could you please check these two mp4 files:
https://flashphoner.com/downloads/tmp/2351-old-aac-encoder.mp4
https://flashphoner.com/downloads/tmp/2351-new-aac-encoder.mp4
Both record files have been produced by WCS build 2351.
First file old-aac-encoder.mp4 was created with setting:
Code:
use_new_aac_encoder=false
Second file new-aac-encoder.mp4 was created with setting:
Code:
use_new_aac_encoder=true
It was recorded in Chrome 59 by this link: https://wcs5-eu.flashphoner.com/demo2/recording
Please let me know these files play in your iOS app.
 

Ney

Member
Hi

I am not sure this is going to be worked. I am doing the recording of the live stream with property .record as 'YES'.

My code is like below for recording

Code:
 FPWCSApi2Session *session = [FPWCSApi2 getSessions][0];
        FPWCSApi2StreamOptions *options = [[FPWCSApi2StreamOptions alloc] init];
        options.name = streamName;
        options.display = self.videoViewLocal;
        options.record = true; // SHREESH Code
        NSError *error;
        publishStream = [session createStream:options error:&error];
are you trying to say, we need to do these changes on our server.
 

Max

Administrator
Staff member
I assume that mp4 recording has been fixed in latest server builds (2351) or with new AAC encoder enabled.
So you can try to play recorded mp4 files to check it.
If it works, you can record mp4 with latest 2351 server build and check if it works for you.

Please also provide a working test code which we can use to play mp4 file.
We will test your code with our mp4 record.
 

Max

Administrator
Staff member
also could you please let us know on which file we need to do setting for use_new_aac_encoder
WCS_HOME/conf/flashphoner.properties
But still when I am recording the live stream, getting the below url, which is still not playable on iOS device.
Provided files were recorded from Chrome browser.
We will try to record two files from iOS SDK, recording sample.
If you have a code / app to test playback quickly, please provide.
 

Max

Administrator
Staff member
Code:
WCS_HOME/conf/flashphoner.properties
This setting requires WCS restart.
Code:
service webcallserver restart
 

Ney

Member
Please provide the UDID of your iPhone, so that you can run our app on your device. Please provide two UDID as you will be needed two device to check the flow of app.
 

Max

Administrator
Staff member
We need a code sample that can be built on our Xcode.
We are going to make such sample from scratch or in our default Stream Recorder example, but it may take a time.
On this default support level we don't cover testing of third party applications and code investigation.
 

Max

Administrator
Staff member
We do not provide any timings on the default support level.
We will inform you through this thread once we have any news.
 

Ney

Member
Hi Max

I am sharing the link updated sample code. In which I have written the code for native player in viewcontroller.m with in Stream recording folder. Function name is
playVideo and definition is as follows (Line 388 - Line 400) and is called at line 151. Hope this will help you.

Sample code link : https://drive.google.com/file/d/0B9idwfuO6suNZ2RIbUpIRWdfcTQ/view?usp=sharing

Code:
- (void)playVideo:(NSString *)urlString {
   
    NSURL *movieURL = [NSURL URLWithString:urlString];
    AVURLAsset *movieAsset = [AVURLAsset URLAssetWithURL:movieURL options:nil];
    [movieAsset.resourceLoader setDelegate:self queue:dispatch_get_main_queue()];
    self.avcontroller = [[AVPlayerViewController alloc]init];
    AVPlayerItem *playerItem = [AVPlayerItem playerItemWithAsset:movieAsset];
    self.avplayer = [AVPlayer playerWithPlayerItem:playerItem];
    self.avcontroller.player = self.avplayer;
    [self presentViewController:self.avcontroller animated:YES completion:^{
        [self.avcontroller.player play];
    }];
}
 

Max

Administrator
Staff member
The issue should be fixed in 2354 server build.
Our QA is checking this now.
You can also test latest build with your code:
Code:
service webcallserver update 2354
 
Top