41
Adobe AIR. NativeProcess. FFMPEG. Awesome. ROCKY MOUNTAIN ADOBE USER GROUP – APRIL 8 2014

Adobe AIR. NativeProcess. FFMPEG. Awesome

Embed Size (px)

DESCRIPTION

April 8 2014: Rocky Mountain Adobe User Group

Citation preview

Page 1: Adobe AIR. NativeProcess. FFMPEG. Awesome

Adobe AIR.

NativeProcess.

FFMPEG. Awesome.ROCKY MOUNTAIN ADOBE USER GROUP – APRIL 8 2014

Page 2: Adobe AIR. NativeProcess. FFMPEG. Awesome

Introduction

Flash Player and AIR… What’s Up?

FFMPEG: CLI Transcoder

AIR NativeProcess API

VOD Transcode

Live Streaming

Closing Remarks

Page 3: Adobe AIR. NativeProcess. FFMPEG. Awesome

Joseph Labrecque

Senior Interactive Software Engineer | Adjunct FacultyUniversity of Denver

Proprietor | OwnerFractured Vision Media, LLC

Adobe Community ProfessionalAdobe Education LeaderAdobe Certified ExpertAdobe Certified EducatorAdobe Influencer

AuthorLynda.com | Peachpit Press | Adobe Press | Packt Publishing | O’Reilly Media | video2brain

ArtistAn Early Morning Letter, Displaced | shivervein

Page 4: Adobe AIR. NativeProcess. FFMPEG. Awesome

AIR is “King”THIRTEEN

Page 5: Adobe AIR. NativeProcess. FFMPEG. Awesome

What’s new with the Runtimes?

Flash Player 12 / AIR 4

Improved Packaging Engine - iOS - BETA

Graphics: Buffer Usage flag for Stage3D

Mobile Workers (concurrency) - Android

Support for native resources access by R* mechanism in ANE - Android

Stage3D Creation of Context3D with Profile Array

Flash Player 13 / AIR 13 – RELEASED TODAY!!!

Enhanced Supplementary Character Support for TextField

Relocated Full Screen Video Warning to Top of Screen

New Stage3D Texture Wrapping Modes

Debugging and Telemetry Support for Improved Packaging Engine - iOS - BETA

Page 6: Adobe AIR. NativeProcess. FFMPEG. Awesome

2014 Runtimes Positioning

The Adobe® Flash® Platform runtimes, Flash Player and AIR®, together enable

businesses to efficiently deliver rich customer experiences across multiple

digital touch points. With Flash Player and AIR, content can easily and

consistently move between the browser, standalone applications and native

operating systems to reach users on the devices of their choice. Since the

Adobe runtimes share a common codebase, developers can reuse code to

deploy game console quality 2D and 3D games, rich media applications with

premium high definition video and scalable date driven applications though

both AIR and Flash Player.

March, 2014

Page 7: Adobe AIR. NativeProcess. FFMPEG. Awesome

Flash is Dead

March, 2014

Page 8: Adobe AIR. NativeProcess. FFMPEG. Awesome

2014 Flash Runtimes Statistics

“Flash is Dead” - false

More than 175,000 applications using AIR 3.8 or greater.

Installed over 500 million times in the second half of 2013.

Reach 11 times more people than the best-selling hardware game console!

400 million+ desktops update to the new version of Flash Player within six weeks of release.

500 million+ devices are addressable today with Flash technology

1 billion projected addressable devices by the end of 2015.

http://www.adobe.com/products/flashruntimes/statistics.html

Page 9: Adobe AIR. NativeProcess. FFMPEG. Awesome

DU VideoManager Flash Player Stats

April, 2014

Page 10: Adobe AIR. NativeProcess. FFMPEG. Awesome

FFMPEGCLI VIDEO TRANSCODE

Page 11: Adobe AIR. NativeProcess. FFMPEG. Awesome

FFMPEG

FFmpeg is a complete, cross-platform

solution to record, convert and stream audio

and video. It includes libavcodec - the

leading audio/video codec library.

Adobe AIR can tap into and control

FFMPEG.

Convert video…

Capture desktops…

Capture webcam…

Stream files, desktops, webcams…

Page 12: Adobe AIR. NativeProcess. FFMPEG. Awesome

Distributions

Linux

http://ffmpeg.gusari.org/static/

http://johnvansickle.com/ffmpeg/

Windows

Zeranoe FFmpeg builds:

http://ffmpeg.zeranoe.com/builds/

OSX

http://www.evermeet.cx/ffmpeg/

http://ffmpegmac.net/

Page 13: Adobe AIR. NativeProcess. FFMPEG. Awesome

FFMPEG Source

If you want to contribute…

Git:

git clone git://source.ffmpeg.org/ffmpeg.git

ffmpeg

Page 14: Adobe AIR. NativeProcess. FFMPEG. Awesome

Documentation

ffmpeg [global_options] {[input_file_options]

-i ‘input_file’} ... {[output_file_options]

‘output_file’} ...

Specify inputs…

An array of options for transcoding…

How to output?

Page 15: Adobe AIR. NativeProcess. FFMPEG. Awesome

NativeProcessTHE ENDLESS API

Page 16: Adobe AIR. NativeProcess. FFMPEG. Awesome

AIR 2.0!

Released in 2010

Theme was “disruption”

Supports NativeProcess

Only the extendedDesktop AIR profile

supports the NativeProcess class.

Page 17: Adobe AIR. NativeProcess. FFMPEG. Awesome

What is NativeProcess?

“The NativeProcess class provides command line integration and general launching

capabilities. The NativeProcess class lets an AIR application execute native processes

on the host operating system. The AIR application can monitor the standard input

(stdin) and standard output (stdout) stream of the process as well as the process's

standard error (stderr) stream.”

Basically, this new API allows your application to communicate with just about any

process running on the host machine. This can be an operating system core process

or software like FFMPEG.

Page 18: Adobe AIR. NativeProcess. FFMPEG. Awesome

DropFolders

Video Converter

Originally an experiment…

Uses HandBrake CLI

Fairly popular… for a demo.

Page 19: Adobe AIR. NativeProcess. FFMPEG. Awesome

DropFolders - Source

I get emails… every week.

Now open source…

Want a change? Contribute!

https://github.com/josephlabrecque/DropF

olders

Page 20: Adobe AIR. NativeProcess. FFMPEG. Awesome

NativeProcess ExampleFFMPEG AND BATCH

Page 21: Adobe AIR. NativeProcess. FFMPEG. Awesome

What to Import

flash.desktop.NativeProcess;

flash.desktop.NativeProcessStartupInfo;

flash.events.NativeProcessExitEvent;

flash.events.ProgressEvent;

flash.events.IOErrorEvent;

flash.filesystem.File;

Page 22: Adobe AIR. NativeProcess. FFMPEG. Awesome

NativeProcess Setup

Create a new File object to run

Create the NativeProcess and add listeners

Create NativeProcessStartupInfo instance

Build up your arguments as Vector

Bind everything together and start

Page 23: Adobe AIR. NativeProcess. FFMPEG. Awesome

NativeProcess Communication

Standard Input

nativeProcess.standardInput.writeUTF();

Standard Output

nativeProcess.standardOutput.readUTFBytes();

Page 24: Adobe AIR. NativeProcess. FFMPEG. Awesome

Simple Example – DEMO!!!

FFMPEG is command-line driven

Batch files are useful for CLI

1. Invoke Windows Command Prompt

2. Call a batch file

3. Instruct FFMPEG

4. Read the output

Page 25: Adobe AIR. NativeProcess. FFMPEG. Awesome

VOD TranscodeFOR FLASH AND HTML5

Page 26: Adobe AIR. NativeProcess. FFMPEG. Awesome

VideoManager

System for the University of Denver

Faculty, staff, and student uploads

Video is gathered from upload server [AIR]

Video is converted on server [AIR/FFMPEG]

Converted video is moved to AMS

Adobe Media Server streams [HDS/HLS]

Page 27: Adobe AIR. NativeProcess. FFMPEG. Awesome

VideoCast

Public face of DU VideoManager

Curated video collections

Rich in metadata

Page 28: Adobe AIR. NativeProcess. FFMPEG. Awesome

CrunchBuddy

Headless AIR app

AIR Captive Runtime

Installed as a Windows service

3 transcode servers host this service:

CRUNCHER, CRUNCHER2, CRUNCHER3

Processes up to 50 videos a day

Page 29: Adobe AIR. NativeProcess. FFMPEG. Awesome

CrunchBuddy - Process

Listens for files added to a temp directory on

the VideoManager web server.

Pulls those files over the network into a

queue.

Uses MediaInfo libraries to read bitrate,

resolution, rotation, and so forth.

Makes decisions on how to encode the file.

Performs transcode and moves the file(s) to

Adobe Media Server for streaming.

Alerts the user that their file is ready through

VideoManger communication.

Problems? Log file is written.

Page 30: Adobe AIR. NativeProcess. FFMPEG. Awesome

CrunchBuddy – DEMO!!!

Adobe AIR

File

NativeProcess

Captive Runtime

POST/GET

AMS

MediaInfo

FFMPEG

Windows Server

Adobe Media Server

Apache, PHP, Laravel, MySQL

Page 31: Adobe AIR. NativeProcess. FFMPEG. Awesome

Live StreamingAND MORE…

Page 32: Adobe AIR. NativeProcess. FFMPEG. Awesome

CameraSnatcher

Web module… no NativeProcess!

Until it hits CrunchBuddy :)

Measure bandwidth with AMS.

Bandwidth determines quality.

Page 33: Adobe AIR. NativeProcess. FFMPEG. Awesome

StreamSnatcher

Work in progress…

Create 3 streams send to RTMP

AMS streams as HDS/HLS

Page 34: Adobe AIR. NativeProcess. FFMPEG. Awesome

Related: ANEsCLOSE COUSINS.

Page 35: Adobe AIR. NativeProcess. FFMPEG. Awesome

ANEs: AIR Native Extensions

An ANE file is an archive file that contains

the necessary libraries and resources for the

native extension.

Native code plus ActionScript code.

AIR profiles extendedDesktop,

mobileDevice, and extendedMobileDevice

Declaring the extension in your application

descriptor file.

200+ multiplatform ANEs:

http://www.riaxe.com/blog/200-adobe-air-

anes/

Page 36: Adobe AIR. NativeProcess. FFMPEG. Awesome

Desktop… Mobile… whatever.

Android devices, starting with Android 2.2

iOS devices, starting with iOS 4.0

iOS Simulator, starting with AIR 3.3

Blackberry PlayBook

Windows desktop devices that support AIR

3.0

Mac OS X desktop devices that support AIR

3.0

Page 37: Adobe AIR. NativeProcess. FFMPEG. Awesome

Closing RemarksJUST A COUPLE MORE THINGS…

Page 38: Adobe AIR. NativeProcess. FFMPEG. Awesome

Why all the chains and ropes, Adobe…

http://www.infin8iphone.co.uk/?p=240

Page 39: Adobe AIR. NativeProcess. FFMPEG. Awesome

…when even you stray from the “rules”?

Adobe Photoshop Touch. Built with AIR. Not a game.

Page 40: Adobe AIR. NativeProcess. FFMPEG. Awesome

Building a Mobile App with

Feathers and Starling Downloading the frameworks and

the AIR SDK

Configuring the project

Implementing a theme

Creating the screen classes

Adding a navbar component

Building the classes

Returning saved files

Publishing a project

Installing and running the app

http://www.lynda.com/JosephLabrecque

Page 41: Adobe AIR. NativeProcess. FFMPEG. Awesome

Thanks. Questions?

CONTACT JOSEPH

@JosephLabrecque

JosephLabrecque.com

[email protected]