Difference in quality when video is uploaded directly from camera and when it is selected from gallery - ios

Problem
I am currently developing an iPhone app, where I need to upload a video with a multipart post request.
I am using AfNetworking and UIImagePickerController.
I set the quality of the UIImagePickerController to high.
When I try to upload a video that has just been recorded in the app, the quality is significantly lower, than when I choose a previously recorded video from the gallery.
Question
Does anybody have experience like this one ?

Related

Picking images from camera and album in iOS Swift 5

I'm working in the application where users will select multiple images from album or taking pictures from camera and send it to server via REST API. Size limit is 5MB for all images. Is there any way to determine the size of images while selecting it from UIImagePicker before loading into application?. Also suggest me the better approach do the same
You can’t do it using built in UIImagePickerController. You can write your own asset picker.

Reduce video bitrate swift

Im using uiimagepicker for the user to pick a video from photo library.
After setting video quality to low in image picker settings, a 5 minute or even a 2 min recorded video is still too big for upload. Is there anyway to compress the video size further. My guess is that i need to reduce the bitrate.
I am of course using assets to manage the file

Compress video like iOS's camera roll

Background:
I am recording a video and then uploading it.
Problem:
I compressed the video using this solution (medium quality) but it doesn't:
keep the original dimensions of the video
have as good a compression ratio as camera roll's.
I need similar compression (size and dimensions) like camera roll.
If it's not possible, do we have a workaround, say, automatically select the file from the iOS video picker (for upload)?
You can use AVAssetWriter and set custom compression settings. You can even compress the video while you're recording so you don't have to re-process the video before upload. Search around, there's tons of examples.

Video uploaded to youtube has low quality preview thumbnail

I have an iphone application that uploads videos to youtube. It uploads the video files without a problem. But there is an issue that the thumbnail preview image is of very low quality.
My question is this, is it possible using the youtube api to set a different preview image?
No. this is not possible with the Standard API.
See this answer for possible ways forward. Youtube API - Set the Thumbnail of video

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