Giter Club home page Giter Club logo

videoexport's Introduction

About

This is an iOS Swift based project that is intended to show how various video formats and orientations can be read and exported for maximum compatibility across clients and reduced size.

Criteria

The following criteria was used for export:

  1. Dimensions reduced to no greater than 512 x 288 (16:9) or 480 x 360 (4:3)
  2. Rotation (preferred transform) of container set to 0 degrees (CGAffineTransformIdentity).
  3. Video profile level set to AVVideoProfileLevelH264Baseline30 ([email protected])
  4. Video bitrate reduced to average of 725,000 bps
  5. MP4 container

Installation

Navigate to the folder where you downloaded the project (Ex: VideoExport-master) and execute

pod install

Assumes that CocoaPods is installed on your system.

Issues

Simulator hang bug

Some videos cannot be processed on the simulator, but will work fine on a real device.

This is an Xcode bug that has been documented in the following article: Using a video composition to process certain videos causes an Xcode simulator hang

A bug report has been filed with Apple. A project demonstrating the bug can be found at: GitHub VideoCompositionSimulatorBug

There is no known workaround.

CMTime bug

There exists a bug on the simulator wherein a CMTime structure can get corrupted when it is passed from Swift to Objective-C. It occurs only on the iPhone 4S and iPhone 5 configurations. The bug has been documented in the article: Xcode simulator bug with Swift to Objective-C call passing CMTime structure

A bug report has been filed with Apple. A project demonstrating the bug can be found at: GitHub CMTimeBug

A workaround exists and has been implemented in the method getVideoComposition() in ViewController.swift.

Details

There is extensive details about the project including how I established the criteria to be used in the file README.h

The Table of Contents of that file includes:

Overview

Criteria Discussion

  • Support for MPMoviePlayerController
  • Support for Dropbox
  • Android Support
  • Bitrate considerations
  • Container

Meeting project criteria

  • AVAssetExportSession
  • AVAssetReader/AVAssetWriter
  • SDAVAssetExportSession

Misc. Project Notes

Portrait Example

Preferred transform

Contrasting preferred transform with video composition transform

  • Method 1
  • Method 2
  • Comparison of methods

Additional References

  • General
  • Temp directory
  • Adding & Retrieving Metadata
  • MPMoviePlayerController
  • UIRequiredDeviceCapabilities
  • Reducing file size
  • Video settings

videoexport's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.