Mp4 file created from ffmpeg can play on Simulator/PC browser but can't play on iOS app/safari in real device - ios

The backend team uses ffmpeg to create video from images.
The strange thing is that the video can be played on Mac browser/iPhone Simulator but not on browser/iOS app on real phone.
I tried using AVPlayer to print the error but error = nil
here is the file: https://firebasestorage.googleapis.com/v0/b/chatchatapp123.appspot.com/o/image_rendered.mp4?alt=media
here is its metadata: https://www.metadata2go.com/result/46e72635-7fac-46ee-acfe-cb6ffda49692
Has anyone encountered this before and if so, any ideas as to why?
Thanks.

I've noticed, field order in metadata is tt, which means
Interlaced video, top field coded and displayed first
But according to the document of “HTTP Live Streaming” from Apple, there is a description,” Important: Interlaced video is not supported on iOS devices.”, which is written on the official document.
https://developer.apple.com/documentation/http_live_streaming/hls_authoring_specification_for_apple_devices

Related

How to programmatically change video codec in Xamarin iOS

I've recently run into a issue with taking video on new iPhones(8 and up) written in Xamarin. When capturing the video video on older devices the codec is H.264, but on new devices Apple has switch to H.265. These videos are played in browser and pretty much everything I've checked doesn't support H.265.
Since you can change in the setting of the device between (high efficiency-H.265 and most compatiable-H.264), I figured you can do this programmatically. I haven't been able to find any information on how to do this if at all. Any help would be appreciated.
You can set the codec on a AVCaptureVideoDataOutput, which you add to your Session, through WeakVideoSettings which is just a dictionary of settings.
You can find the keys in the official apple docs: https://developer.apple.com/documentation/avfoundation/avassetwriterinput/video_settings_dictionaries

Live stream implementation using RTSP protocol

I'm trying to gain access to a live stream through the RTSP protocol on iOS. I'm trying to run the example from this website: http://www.gdcl.co.uk/2013/02/20/iOS-Video-Encoding.html and it's advertised that you can just take the url (rtsp://) and paste it into quicktime player, VLC or some other means, but whenever I try it fails. When I try in quicktime player it gives me this error: The document “Macintosh HD” could not be opened. The file may be damaged or may not be a movie file that is compatible with QuickTime Player.
What am I doing wrong? Is the example broken or do I need to update some specs in the code. I'm running iOS 9.3 and it's told to work > 7.0.
I was able to play this back on VLC when compiling and running on my iOS device. You need to ensure that you are on WiFi (vs LTE or 3G). I'm on iOS 9.2.1 and played back with VLC version 2.2.2.
You can then take it a step further as I was successful in ingesting it into Wowza via Stream file with the following configuration:
{
uri : "rtsp://[rtsp-address-as-published-on-the-app]",
streamTimeout:12000,
reconnectWaitTime:12000,
rtpTransportMode:"udp",
rtspValidationFrequency:15000,
rtspFilterUnknownTracks:true,
rtspStreamAudioTrack:false,
rtspStreamVideoTrack:true,
rtpDebugSession:true,
rtspSessionTimeout:12000,
rtspConnectionTimeout:12000
}
I would suggest reviewing what the console logs say in your iOS application (xcode) and then also take a look at your VLC error messages/logs as well to see what the exact issue is when you try to playback.

iOS "Cannot Decode" m3u8

I have a live stream that in the past was playable on iOS devices (using the URL for the m3u8 file). Now, when I try to view the live stream on an iOS device, I get a message that says "Cannot Decode". I am still able to use this file on Android devices though. Does anyone have any idea why iOS devices would not be able to play this file?
The live stream is being encoded by Adobe Flash Media Live Encoder 3.2 and we are using Adobe Media Server 5. I followed the steps here to get everything setup initially (when it was working). Once it stopped working on iOS, I verified that none of the settings had changed.
iOS does not support FLASH, so iOS cannot decode a FLV stream, it only support HLS(HTTP Live Streaming).
You can set the Live Encoder as following
Preset: H.264
Video Format (H.264), click the right spanner, set Profile(Main), Level(3.1), Keyframe Frequency(4 seconds)
FMS URL: rtmp://yoursever/livepkgr and Stream: livestream?adbe-live-event=liveevent
Then, open iDevice Safari and go to http://yoursever/hls-live/livepkgr/_definst_/liveevent/livestream.m3u8,it will be played.

MP4 Videos on website embed with html5 does not play on iOS

So I have a couple of videos on my website that I shot using the iPhone 4 and then converted to mp4, webm and ogg, so that I can use them with html5. Thing is, the video does not play at all on the 4 iOS devices that I tested and neither on Chrome for Android.
The Chrome issue could be because some of the mp4 are actually m4v files, but still after encoding with handbrake a video to the iphone 4 presset and in mp4 format, it still does not play.
What happens, you ask? Well, it shows the play button crossed out with a diagonal bar, the debug console on Safari does not show any message untill I try to access the video directly. Then it says: QuickTime Movie could not be played.
What can I do? I have been trying to encode with ffmpeg, have tried a handful of different solutions, some even found here on stackoverlow, but to no avail. The videos do get shorter, both in display size and MBs, but nothing works to fix the issue at hand.
I've been trying to get this corrected for a couple of weeks now. Any help and/or suggestions are welcome.
Thank you.
By the way, all the videos are on a registred users section of the website, but I have one for debugin on the main page, so feel free to test.
https://sidnerwebsite.sytes.net
It seems the issue is caused by the iOS' need of an Intermediate Certificate trusted by the iOS to play videos through an SSL connection. After disabling the re-routing of the website to its ssl counterpart, the videos display correctly on iOS.

YouTube video fails to load with iOS UIWebView

W're developing an iPad app (iOS 4.3.5) that uses UIWebView to load YouTube videos. About once in five times a YouTube video will fail to load and I only see the following blank screen with YouTube's logo:
Looking in the debug logs I can only see the following warnings:
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.5 (8L1)/Symbols/System/Library/Internet Plug-Ins/QuickTime Plugin.webplugin/QuickTime Plugin (file not found).
warning: No copy of QuickTime Plugin.webplugin/QuickTime Plugin found locally, reading from memory on remote device. This may slow down the debug session.
I've read about this warning (https://stackoverflow.com/questions/7149593/warning-while-playing-a-video-link-in-my-app) and don't think it effects this problem.
Does anyone know how to fix this?
Try with video tag of HTML 5. I have done the same thing with video tag and its working perfect with my application.
Below is the sample code for the same...
<html><head><video controls=\"controls\"><source src=\"%#\" type=\"video/mp4\" height=\"%0.0f\" width=\"%0.0f\"/></video></body></html>
(Answering my own questions)
OK. I'm pretty sure I figured this out. Some videos don't have a mobile player. You can look at the JSON output here:
http://gdata.youtube.com/feeds/api/videos/TWfph3iNC-k?v=2&alt=jsonc
And here:
http://gdata.youtube.com/feeds/api/videos/cd4jvtAr8JM?v=2&alt=jsonc
Notice how the second video (cd4jvtAr8JM) doesn't have the mobile player link. I guess this means that YouTube hasn't encoded it yet for mobile. Or it's restricted for mobile. Regardless, these type of videos all won't play for me.

Resources