AVAssetExportSession exportAsynchronouslyWithCompletionHandler: Source frame unsupported format - ios

I am using AVAssetExportSession to export a video selected from library. It works great for all videos of all types except landscape-recorded screen recordings (using the screen recording feature in iOS 11). Weird enough, it works perfectly for other landscape videos, and it also works perfectly for portrait videos of the same screen recording feature. But I've tried two videos that are landscape screen recordings, and they both failed with the error Source frame unsupported format.
How can I fix this problem?
UPDATE: Videos play just fine both in Photos and in my app before exporting.

The video size may not be standard like 1920 X 1080 , The screen recording produce non standard video resolutions in some devices.
You need to write the videos in standard resolution while recording

Related

Itunesconnect App Preview Video

I have tried many times to upload App Preview video.
But each time I failed.
Please recommend me best tool to convert my video to availble and how to.
Thanks
You must use Safari to upload your video.
I use QuickTime Player to record the screen of my app.
In QuickTime Player you can record in portrait and landscape, but you cannot rotate your screen during the record.
Open QuickTime Player > File > New Movie Recording (then select your device for camera and microfone).
Sample of record screen:
Apple App Preview Video Guidelines
As you can imagine, Apple wants to generate a similar Look & Feel for all videos. Therefore they released some guidelines, which you should mind when creating a preview video.
15-30 seconds length
Maximum file size of 500 mb
.mov, .m4v, .mp4 format
Only use screen capture
No (very less) copy – due to the reason that you can’t internationalize your video and only upload it once in one language
Don’t overlay animated hands, you can use touch hotspots if really necessary
For games: Show more gameplay scenes than cutscenes
You can use voice over – but mind the internationalization part – Apple recommends to only use a very limited and professional voice over if you have to
Your preview video should only contain content for which you have the full rights (don’t show you app streaming content from an iTunes Playlist or a YouTube video)
App Preview Video Format
Now the most important part – which format or size should your video have. As you have already read in my screenshot size article it can be quite frustrating creating a lot screenshots in different sizes.
Apple recommends you to use the following app preview resolutions (this is already a summary, that you have to create the least amount of different video versions):
iPhone 5+ iPhone 6 Plus: 1920 x 1080
iPhone 6: 1334 x 750
iPad: 1200 x 900

iOS App Preview without iPhone 6 Plus

I have done an iOS App Preview (Video) using iPhone 6 and Quicktime in Yosemite, but I cannot upload it for iPhone 6+ in iTunes Connect, and I don't have an iPhone 6+ Device.
Is there a way to make an App Preview (Video) for iPhone 6+ without the device ?
I have found a good solution!
In Keynote app, I changed the document size to be the same as iPhone 6+ size and imported the iPhone 6 video and resizes it.
I have resived the video to fit the document and exported it as a video.
That's it!
It is not a perfect solution, but it is good.
Solution how to upscale video using iMovie 10:
Create screen recording using QuickTime player. As a result you will have a video with 1334x750 resolution (or 750x1334, depends on screen orientation).
Find any sample video with resolution 1920x1080 (or 1080x1920). It can be preview of some other application or any other video.
Open iMovie 10 and create new App Preview (File -> New App Preview).
Drag-and-drop sample (from step#2) clip from Finder to the timeline (first imported clip's resolution will be used in export)
Drag-and-drop your actual video clip from Finder to the timeline.
Remove sample clip from the timeline (you don't need it anymore, final resolution already set)
Click on
Select your preview project, Share Project -> App preview
You will see that export resolution will be 1920x1080 (or 1080x1920)
Success! I used this trick several times already.
Disclaimer: This solution only work for downsampliing, if you know how to upsample video please share it with us
Hi iphoner, unfortunately you need to record it using a higher resolution device and use Handbrake to convert your videos.
I used a iPhone 6+ to record the video using Quicktime and encountered the same issue.
To upload a video for iPhone 6+, you need to upload a video with this format size 1920x1080.
1) Change "Anamorphic" to "custom"
2) unselect "keep aspect ratio"
3) Set the size (width and height) you want (Warning u can only downsample it/ you need a large resolution as your base video)
Other device acceptable formats:
ipad: 1200x900, 900x1200
iPhone 5.5inch/iPhone 3.5inch: 1920x1080,1080x1920
iPhone 4.7inch: 1334x750, 750x1334
For a more comprehensive guide please refer to this document by apple
You can generate the video from the simulator by running through the following steps.
Get your app running in the simulator.
I believe you will need to run the simulator at 100% scale to ensure 1080:1920
Open up Terminal and run the following command
$ xcrun simctl io booted recordVideo /path/Video.mov
Switch to your simulator window and run through your demo
When you have finished your demo switch back to your terminal window and Press CTL+C to stop the recording
Edit the movie in iMovie
In order to upload as an App Preview then it will need to be < 30 seconds. You can cut the video down a little, or speed some sections up in order to get it under 30 seconds.
Once you have finished editing the movie you can then export it (File->Share->iTunes)
This will save it to your iTunes library:
/Users/marcbeavan/Music/iTunes/iTunes Media/Home Videos/
This file is ready to be uploaded to iTunes Connect
File info for my video is shown below
This command line works perfectly for me every time. It comes from an answer to a similar question (link):
ffmpeg -i input.mp4 -acodec copy -crf 12 -vf scale=1080:1920,setsar=1:1 output.mp4
It will take the input.mp4 file, resize it and output ouput.mp4. You need to install ffmpeg before running the command.
Of course, upscaling leads to quality loss. But if you do not have a Plus screen, this is much better than not having a video app preview at all.
I make a lot of app previews and in all sizes. The easiest way is to have all the devices, but that's definitely not practical for most people. You could also edit the dimensions post production to "simulate" the actual device, even iPad. I would also recommend avoiding the problem all together by having someone like snappdemo.com do it for you pretty cheap.
If you have any way to record higher resolution, like an iPhone X and need 1080*1920, just follow these steps:
Open your higher resolution video in Quicktime.
Go to Edit -> rotate right.
Go to File -> Export as -> 1080p.
Open exported File in Quicktime.
Go to Edit -> Rotate Left.
Worked great for me.

iOs: Low frame per second(fps) for VGA resolution

I'm facing an issue in broadcasting video from one iPhone to another iPhone.
The issue is when I view the friend's live video in my iPhone, the frame per second(fps) is very low(it is 12fps). Video quality and audio is looking fine but the only problem is fps.
I don't know where I need to config/change the code to convert from variable fps to constant fps. Also to increase the fps as **24/30**.
The resolution I used for broadcasting
RESOLUTION_VGA, // 480x640px (landscape) & 640x480px (portrait)
I'm using following libraries for streaming
MediaLibiOS - link
Ffmpeg-2.2.1
CommLibiOS
libx264-r2409
Wowza is a Media Server and iOS target version is 7.0
Please help !
Thanks in advance.

View uploaded video in iOS app

I have a bunch of videos uploaded to google drive. They are in mpeg4 (avi) format I believe. I have tried everything I can think to view the video in a MPMoviePlayerViewController. In the simulator the video player launches and looks like it playing, but I don't see any video. When I run it on my device the player won't launch. I have tried to use the downloadUrl, alternateLink, embedLink and webContentLink with no success.
Is it possible to stream video from Google Drive to iOS?
The simulator isn't a full blown emulator, but just a simulator. It uses similar frameworks from Mac OS, which may have different functionality than on iOS. In other words, the simulator may have more capabilities than an actual device.
The MPMoviePlayerController class on iOS supports only a few containers and codecs, and does not support AVI.
Supported Formats
This class plays any movie or audio file supported in iOS. This
includes both streamed content and fixed-length files. For movie
files, this typically means files with the extensions .mov, .mp4,
.mpv, and .3gp and using one of the following compression standards:
H.264 Baseline Profile Level 3.0 video, up to 640 x 480 at 30 fps. (The Baseline profile does not support B frames.)
MPEG-4 Part 2 video (Simple Profile)
If you use this class to play audio files, it displays a white screen
with a QuickTime logo while the audio plays. For audio files, this
class supports AAC-LC audio at up to 48 kHz, and MP3 (MPEG-1 Audio
Layer 3) up to 48 kHz, stereo audio.

iOS thumbnail issue with saved video to camera roll

We have an issue where video generated by our application and saved to camera roll (from user action) will show as black thumbnail on the iOS Photo Gallery instead of a thumbnail of a frame. Once you select the video it will play without any issues on the iOS device or any other device (export to your mac or pc...).
The issue does not occur on the iPhone simulator, only on iOS devices..
We generate the video using AVFoundation (very similiar to this How do I export UIImage array as a movie?)
We then combine the video with an mp3 file using AVMutableVideoComposition. If I extract all frame of video, first frame is not black.
The thumbnail in the Photo Gallery will show as a black square, no time span (on iOS4) shown on the thumbnail. We save the video to camera roll using UISaveVideoAtPathToSavedPhotosAlbum ...
We have changed the video compression type and settings multiple times with no luck. The output is a H264 QuickTimeMovie.
Any ideas ?
Thank you.

Resources