├── .watchmanconfig ├── ios ├── .gitignore ├── Resources │ ├── pyramid.jpg │ ├── tajmahal.jpg │ ├── truenorg.otf │ ├── colosseum.jpg │ ├── doppioone_regular.ttf │ ├── subtitle.srt │ └── sil_open_font_license.txt ├── ReactNativeFFmpegTest │ ├── Images.xcassets │ │ ├── Contents.json │ │ └── AppIcon.appiconset │ │ │ ├── Icon-120.png │ │ │ ├── Icon-121.png │ │ │ ├── Icon-180.png │ │ │ ├── Icon-40.png │ │ │ ├── Icon-58.png │ │ │ ├── Icon-60.png │ │ │ ├── Icon-80.png │ │ │ ├── Icon-87.png │ │ │ ├── Icon-1024.png │ │ │ └── Contents.json │ ├── AppDelegate.h │ ├── main.m │ ├── Info.plist │ ├── AppDelegate.m │ └── LaunchScreen.storyboard ├── ReactNativeFFmpegTest.xcworkspace │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── contents.xcworkspacedata ├── Podfile ├── ReactNativeFFmpegTest.xcodeproj │ └── xcshareddata │ │ └── xcschemes │ │ └── ReactNativeFFmpegTest.xcscheme └── Podfile.lock ├── .gitattributes ├── app.json ├── android ├── app │ ├── debug.keystore │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ └── styles.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ └── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ ├── assets │ │ │ │ ├── colosseum.jpg │ │ │ │ ├── pyramid.jpg │ │ │ │ ├── tajmahal.jpg │ │ │ │ ├── truenorg.otf │ │ │ │ ├── doppioone_regular.ttf │ │ │ │ ├── subtitle.srt │ │ │ │ └── sil_open_font_license.txt │ │ │ ├── web_hi_res_512.png │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── arthenica │ │ │ │ └── reactnative │ │ │ │ └── ffmpeg │ │ │ │ └── test │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ └── debug │ │ │ └── AndroidManifest.xml │ ├── proguard-rules.pro │ ├── build_defs.bzl │ ├── BUCK │ └── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── settings.gradle ├── gradle.properties ├── build.gradle ├── gradlew.bat └── gradlew ├── clean.sh ├── .buckconfig ├── index.js ├── src ├── util.js ├── tooltip.js ├── style.js ├── main.js ├── react-native-ffmpeg-api-wrapper.js ├── command-tab.js ├── popup.js ├── pipe-tab.js ├── progress_modal.js ├── test-api.js ├── concurrent-execution-tab.js ├── vid-stab-tab.js ├── subtitle-tab.js ├── video-tab.js ├── video-util.js ├── https-tab.js └── audio-tab.js ├── .eslintrc.js ├── .gitignore ├── LICENSE ├── package.json ├── .flowconfig └── README.md /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | /Pods/ 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ReactNativeFFmpegTest", 3 | "displayName": "ReactNativeFFmpegTest" 4 | } -------------------------------------------------------------------------------- /android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/android/app/debug.keystore -------------------------------------------------------------------------------- /clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rm -rf node_modules 4 | rm -rf ios/build 5 | rm -rf ios/Pods 6 | rm -rf android/app/build 7 | -------------------------------------------------------------------------------- /ios/Resources/pyramid.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/ios/Resources/pyramid.jpg -------------------------------------------------------------------------------- /ios/Resources/tajmahal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/ios/Resources/tajmahal.jpg -------------------------------------------------------------------------------- /ios/Resources/truenorg.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/ios/Resources/truenorg.otf -------------------------------------------------------------------------------- /ios/Resources/colosseum.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/ios/Resources/colosseum.jpg -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ReactNativeFFmpeg Test 3 | 4 | -------------------------------------------------------------------------------- /ios/ReactNativeFFmpegTest/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ios/Resources/doppioone_regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/ios/Resources/doppioone_regular.ttf -------------------------------------------------------------------------------- /.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /android/app/src/main/assets/colosseum.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/android/app/src/main/assets/colosseum.jpg -------------------------------------------------------------------------------- /android/app/src/main/assets/pyramid.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/android/app/src/main/assets/pyramid.jpg -------------------------------------------------------------------------------- /android/app/src/main/assets/tajmahal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/android/app/src/main/assets/tajmahal.jpg -------------------------------------------------------------------------------- /android/app/src/main/assets/truenorg.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/android/app/src/main/assets/truenorg.otf -------------------------------------------------------------------------------- /android/app/src/main/web_hi_res_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/android/app/src/main/web_hi_res_512.png -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/app/src/main/assets/doppioone_regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/android/app/src/main/assets/doppioone_regular.ttf -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import { AppRegistry } from 'react-native'; 2 | import Main from './src/main'; 3 | import {name as appName} from './app.json'; 4 | 5 | AppRegistry.registerComponent(appName, () => Main); 6 | -------------------------------------------------------------------------------- /ios/ReactNativeFFmpegTest/Images.xcassets/AppIcon.appiconset/Icon-120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/ios/ReactNativeFFmpegTest/Images.xcassets/AppIcon.appiconset/Icon-120.png -------------------------------------------------------------------------------- /ios/ReactNativeFFmpegTest/Images.xcassets/AppIcon.appiconset/Icon-121.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/ios/ReactNativeFFmpegTest/Images.xcassets/AppIcon.appiconset/Icon-121.png -------------------------------------------------------------------------------- /ios/ReactNativeFFmpegTest/Images.xcassets/AppIcon.appiconset/Icon-180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/ios/ReactNativeFFmpegTest/Images.xcassets/AppIcon.appiconset/Icon-180.png -------------------------------------------------------------------------------- /ios/ReactNativeFFmpegTest/Images.xcassets/AppIcon.appiconset/Icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/ios/ReactNativeFFmpegTest/Images.xcassets/AppIcon.appiconset/Icon-40.png -------------------------------------------------------------------------------- /ios/ReactNativeFFmpegTest/Images.xcassets/AppIcon.appiconset/Icon-58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/ios/ReactNativeFFmpegTest/Images.xcassets/AppIcon.appiconset/Icon-58.png -------------------------------------------------------------------------------- /ios/ReactNativeFFmpegTest/Images.xcassets/AppIcon.appiconset/Icon-60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/ios/ReactNativeFFmpegTest/Images.xcassets/AppIcon.appiconset/Icon-60.png -------------------------------------------------------------------------------- /ios/ReactNativeFFmpegTest/Images.xcassets/AppIcon.appiconset/Icon-80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/ios/ReactNativeFFmpegTest/Images.xcassets/AppIcon.appiconset/Icon-80.png -------------------------------------------------------------------------------- /ios/ReactNativeFFmpegTest/Images.xcassets/AppIcon.appiconset/Icon-87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/ios/ReactNativeFFmpegTest/Images.xcassets/AppIcon.appiconset/Icon-87.png -------------------------------------------------------------------------------- /ios/ReactNativeFFmpegTest/Images.xcassets/AppIcon.appiconset/Icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tanersener/react-native-ffmpeg-test/HEAD/ios/ReactNativeFFmpegTest/Images.xcassets/AppIcon.appiconset/Icon-1024.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/ReactNativeFFmpegTest/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : UIResponder 5 | 6 | @property (nonatomic, strong) UIWindow *window; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ios/ReactNativeFFmpegTest/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char * argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ios/ReactNativeFFmpegTest.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/ReactNativeFFmpegTest.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'ReactNativeFFmpegTest' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | include ':react-native-video' 5 | project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android') 6 | -------------------------------------------------------------------------------- /src/util.js: -------------------------------------------------------------------------------- 1 | export function today() { 2 | let now = new Date(); 3 | return `${now.getFullYear()}-${now.getMonth()}-${now.getDate()}`; 4 | } 5 | 6 | export function now() { 7 | let now = new Date(); 8 | return `${now.getFullYear()}-${now.getMonth()}-${now.getDate()} ${now.getHours()}:${now.getMinutes()}:${now.getSeconds()}.${now.getMilliseconds()}`; 9 | } 10 | 11 | export function ffprint(text) { 12 | console.log(text.endsWith('\n') ? text.replace('\n', '') : text); 13 | } 14 | -------------------------------------------------------------------------------- /android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /ios/Resources/subtitle.srt: -------------------------------------------------------------------------------- 1 | 1 2 | 00:00:00,021 --> 00:00:04,000 3 | Colosseum or Coliseum is an oval amphitheatre in the centre of the city of Rome, Italy. 4 | 5 | 2 6 | 00:00:04,001 --> 00:00:06,927 7 | The Great Pyramid of Giza is the oldest and largest of the three pyramids in the Giza pyramid complex bordering what is now El Giza, Egypt. 8 | 9 | 3 10 | 00:00:06,928 --> 00:00:09,000 11 | The Taj Mahal is an ivory-white marble mausoleum on the south bank of the Yamuna river in the Indian city of Agra. 12 | -------------------------------------------------------------------------------- /android/app/src/main/assets/subtitle.srt: -------------------------------------------------------------------------------- 1 | 1 2 | 00:00:00,021 --> 00:00:04,000 3 | Colosseum or Coliseum is an oval amphitheatre in the centre of the city of Rome, Italy. 4 | 5 | 2 6 | 00:00:04,001 --> 00:00:06,927 7 | The Great Pyramid of Giza is the oldest and largest of the three pyramids in the Giza pyramid complex bordering what is now El Giza, Egypt. 8 | 9 | 3 10 | 00:00:06,928 --> 00:00:09,000 11 | The Taj Mahal is an ivory-white marble mausoleum on the south bank of the Yamuna river in the Indian city of Agra. 12 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "env": { 3 | "browser": false, 4 | "es6": true 5 | }, 6 | "extends": "eslint:recommended", 7 | "globals": { 8 | "Atomics": "readonly", 9 | "SharedArrayBuffer": "readonly" 10 | }, 11 | "parserOptions": { 12 | "ecmaFeatures": { 13 | "jsx": true 14 | }, 15 | "ecmaVersion": 2018, 16 | "sourceType": "module" 17 | }, 18 | "plugins": [ 19 | "react-native" 20 | ], 21 | "rules": { 22 | } 23 | }; 24 | -------------------------------------------------------------------------------- /android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | require_relative '../node_modules/react-native/scripts/react_native_pods' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | platform :ios, '11.0' 5 | 6 | target 'ReactNativeFFmpegTest' do 7 | 8 | pod 'react-native-ffmpeg/full', :podspec => '../node_modules/react-native-ffmpeg/react-native-ffmpeg.podspec' 9 | 10 | config = use_native_modules! 11 | 12 | use_react_native!(:path => config["reactNativePath"]) 13 | 14 | # Enables Flipper. 15 | # 16 | # Note that if you have use_frameworks! enabled, Flipper will not work and 17 | # you should disable these next few lines. 18 | use_flipper! 19 | post_install do |installer| 20 | flipper_post_install(installer) 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useAndroidX=true 21 | android.enableJetifier=true 22 | -------------------------------------------------------------------------------- /src/tooltip.js: -------------------------------------------------------------------------------- 1 | export const COMMAND_TEST_TOOLTIP_TEXT = "Enter an FFmpeg command without 'ffmpeg' at the beginning and click one of the RUN buttons"; 2 | 3 | export const VIDEO_TEST_TOOLTIP_TEXT = "Select a video codec and press ENCODE button"; 4 | 5 | export const HTTPS_TEST_TOOLTIP_TEXT = "Enter the https url of a media file and click the button"; 6 | 7 | export const AUDIO_TEST_TOOLTIP_TEXT = "Select an audio codec and press ENCODE button"; 8 | 9 | export const SUBTITLE_TEST_TOOLTIP_TEXT = "Click the button to burn subtitles. Created video will play inside the frame below"; 10 | 11 | export const VIDSTAB_TEST_TOOLTIP_TEXT = "Click the button to stabilize video. Original video will play above and stabilized video will play below"; 12 | 13 | export const PIPE_TEST_TOOLTIP_TEXT = "Click the button to create a video using pipe redirection. Created video will play inside the frame below"; 14 | 15 | export const CONCURRENT_EXECUTION_TEST_TOOLTIP_TEXT = " Use ENCODE and CANCEL buttons to start/stop multiple execution"; 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | 43 | # fastlane 44 | # 45 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 46 | # screenshots whenever they are needed. 47 | # For more information about the recommended setup visit: 48 | # https://docs.fastlane.tools/best-practices/source-control/ 49 | 50 | */fastlane/report.xml 51 | */fastlane/Preview.html 52 | */fastlane/screenshots 53 | 54 | # Bundle artifact 55 | *.jsbundle 56 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Taner Sener 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "29.0.2" 6 | minSdkVersion = 24 7 | compileSdkVersion = 29 8 | targetSdkVersion = 29 9 | } 10 | repositories { 11 | google() 12 | jcenter() 13 | } 14 | dependencies { 15 | classpath("com.android.tools.build:gradle:4.0.1") 16 | 17 | // NOTE: Do not place your application dependencies here; they belong 18 | // in the individual module build.gradle files 19 | } 20 | } 21 | 22 | ext { 23 | reactNativeFFmpegPackage = "video" 24 | } 25 | 26 | allprojects { 27 | repositories { 28 | mavenLocal() 29 | maven { 30 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 31 | url("$rootDir/../node_modules/react-native/android") 32 | } 33 | maven { 34 | // Android JSC is installed from npm 35 | url("$rootDir/../node_modules/jsc-android/dist") 36 | } 37 | mavenCentral() 38 | google() 39 | jcenter() 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 15 | 16 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 16 | 17 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /ios/ReactNativeFFmpegTest/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-40.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-60.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-58.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-87.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-80.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-120.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-121.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-180.png", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "size" : "1024x1024", 53 | "idiom" : "ios-marketing", 54 | "filename" : "Icon-1024.png", 55 | "scale" : "1x" 56 | } 57 | ], 58 | "info" : { 59 | "version" : 1, 60 | "author" : "xcode" 61 | } 62 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-ffmpeg-test", 3 | "version": "0.5.2", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "ios": "react-native run-ios", 8 | "start": "react-native start", 9 | "test": "jest", 10 | "lint": "eslint ." 11 | }, 12 | "dependencies": { 13 | "@react-native-picker/picker": "^1.9.7", 14 | "@react-navigation/material-top-tabs": "^5.3.10", 15 | "@react-navigation/native": "^5.8.10", 16 | "node-fetch": "^2.6.1", 17 | "prop-types": "^15.7.2", 18 | "react": "^17.0.2", 19 | "react-native": "^0.65.1", 20 | "react-native-ffmpeg": "^0.5.2", 21 | "react-native-fs": "^2.16.6", 22 | "react-native-gesture-handler": "^1.9.0", 23 | "react-native-reanimated": "^1.13.2", 24 | "react-native-screens": "^2.16.1", 25 | "react-native-tab-view": "^2.15.2", 26 | "react-native-video": "^5.1.0-alpha8", 27 | "set-value": "^4.1.0", 28 | "xmldom": "^0.6.0" 29 | }, 30 | "devDependencies": { 31 | "@babel/core": "^7.12.10", 32 | "@babel/runtime": "^7.12.5", 33 | "@react-native-community/eslint-config": "^2.0.0", 34 | "babel-jest": "^26.6.3", 35 | "eslint": "^7.16.0", 36 | "jest": "^26.6.3", 37 | "metro-react-native-babel-preset": "^0.64.0", 38 | "react-native-codegen": "^0.0.8", 39 | "react-test-renderer": "16.13.1" 40 | }, 41 | "jest": { 42 | "preset": "react-native" 43 | }, 44 | "resolutions": { 45 | "**/**/minimist": "^1.2.2" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.arthenica.reactnative.ffmpeg.test", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.arthenica.reactnative.ffmpeg.test", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/arthenica/reactnative/ffmpeg/test/MainActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2018 Taner Sener 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.arthenica.reactnative.ffmpeg.test; 26 | 27 | import com.facebook.react.ReactActivity; 28 | 29 | public class MainActivity extends ReactActivity { 30 | 31 | /** 32 | * Returns the name of the main component registered from JavaScript. 33 | * This is used to schedule rendering of the component. 34 | */ 35 | @Override 36 | protected String getMainComponentName() { 37 | return "ReactNativeFFmpegTest"; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /ios/ReactNativeFFmpegTest/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ArthenicaReactNativeFFmpegTest 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(CURRENT_PROJECT_VERSION) 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSAllowsArbitraryLoads 30 | 31 | NSExceptionDomains 32 | 33 | localhost 34 | 35 | NSExceptionAllowsInsecureHTTPLoads 36 | 37 | 38 | 39 | 40 | NSCameraUsageDescription 41 | Record video using device camera 42 | NSLocationWhenInUseUsageDescription 43 | 44 | UILaunchStoryboardName 45 | LaunchScreen 46 | UIRequiredDeviceCapabilities 47 | 48 | armv7 49 | 50 | UISupportedInterfaceOrientations 51 | 52 | UIInterfaceOrientationPortrait 53 | UIInterfaceOrientationLandscapeLeft 54 | UIInterfaceOrientationLandscapeRight 55 | 56 | UIViewControllerBasedStatusBarAppearance 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 11 | ; Ignore duplicate module providers 12 | ; For RN Apps installed via npm, "Libraries" folder is inside 13 | ; "node_modules/react-native" but in the source repo it is in the root 14 | .*/Libraries/react-native/React.js 15 | 16 | ; Ignore polyfills 17 | .*/Libraries/polyfills/.* 18 | 19 | ; Ignore metro 20 | .*/node_modules/metro/.* 21 | 22 | [include] 23 | 24 | [libs] 25 | node_modules/react-native/Libraries/react-native/react-native-interface.js 26 | node_modules/react-native/flow/ 27 | node_modules/react-native/flow-github/ 28 | 29 | [options] 30 | emoji=true 31 | 32 | module.system=haste 33 | module.system.haste.use_name_reducers=true 34 | # get basename 35 | module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1' 36 | # strip .js or .js.flow suffix 37 | module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1' 38 | # strip .ios suffix 39 | module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1' 40 | module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1' 41 | module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1' 42 | module.system.haste.paths.blacklist=.*/__tests__/.* 43 | module.system.haste.paths.blacklist=.*/__mocks__/.* 44 | module.system.haste.paths.blacklist=/node_modules/react-native/Libraries/Animated/src/polyfills/.* 45 | module.system.haste.paths.whitelist=/node_modules/react-native/Libraries/.* 46 | 47 | munge_underscores=true 48 | 49 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 50 | 51 | module.file_ext=.js 52 | module.file_ext=.jsx 53 | module.file_ext=.json 54 | module.file_ext=.native.js 55 | 56 | suppress_type=$FlowIssue 57 | suppress_type=$FlowFixMe 58 | suppress_type=$FlowFixMeProps 59 | suppress_type=$FlowFixMeState 60 | 61 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 62 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 63 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 64 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 65 | 66 | [version] 67 | ^0.75.0 68 | -------------------------------------------------------------------------------- /ios/ReactNativeFFmpegTest/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | 3 | #import 4 | #import 5 | #import 6 | 7 | #ifdef FB_SONARKIT_ENABLED 8 | #import 9 | #import 10 | #import 11 | #import 12 | #import 13 | #import 14 | 15 | static void InitializeFlipper(UIApplication *application) { 16 | FlipperClient *client = [FlipperClient sharedClient]; 17 | SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults]; 18 | [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]]; 19 | [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]]; 20 | [client addPlugin:[FlipperKitReactPlugin new]]; 21 | [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]]; 22 | [client start]; 23 | } 24 | #endif 25 | 26 | @implementation AppDelegate 27 | 28 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 29 | { 30 | #ifdef FB_SONARKIT_ENABLED 31 | InitializeFlipper(application); 32 | #endif 33 | 34 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 35 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge 36 | moduleName:@"ReactNativeFFmpegTest" 37 | initialProperties:nil]; 38 | 39 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 40 | 41 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 42 | UIViewController *rootViewController = [UIViewController new]; 43 | rootViewController.view = rootView; 44 | self.window.rootViewController = rootViewController; 45 | [self.window makeKeyAndVisible]; 46 | return YES; 47 | } 48 | 49 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 50 | { 51 | #if DEBUG 52 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 53 | #else 54 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 55 | #endif 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/arthenica/reactnative/ffmpeg/test/MainApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2019 Taner Sener 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package com.arthenica.reactnative.ffmpeg.test; 26 | 27 | import android.app.Application; 28 | import com.facebook.react.PackageList; 29 | import com.facebook.react.ReactApplication; 30 | import com.brentvatne.react.ReactVideoPackage; 31 | import com.facebook.react.ReactNativeHost; 32 | import com.facebook.react.ReactPackage; 33 | import com.facebook.soloader.SoLoader; 34 | 35 | import java.util.List; 36 | 37 | public class MainApplication extends Application implements ReactApplication { 38 | 39 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 40 | 41 | @Override 42 | public boolean getUseDeveloperSupport() { 43 | return BuildConfig.DEBUG; 44 | } 45 | 46 | @Override 47 | protected List getPackages() { 48 | @SuppressWarnings("UnnecessaryLocalVariable") 49 | List packages = new PackageList(this).getPackages(); 50 | // Packages that cannot be autolinked yet can be added manually here, for example: 51 | // packages.add(new MyReactNativePackage()); 52 | packages.add(new ReactVideoPackage()); 53 | return packages; 54 | } 55 | 56 | @Override 57 | protected String getJSMainModuleName() { 58 | return "index"; 59 | } 60 | }; 61 | 62 | @Override 63 | public ReactNativeHost getReactNativeHost() { 64 | return mReactNativeHost; 65 | } 66 | 67 | @Override 68 | public void onCreate() { 69 | super.onCreate(); 70 | SoLoader.init(this, /* native exopackage */ false); 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/style.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {Dimensions, Platform, StyleSheet} from 'react-native'; 3 | 4 | const window = Dimensions.get('window'); 5 | 6 | const styles = StyleSheet.create({ 7 | screenStyle: { 8 | flex: 1, 9 | justifyContent: 'flex-start', 10 | alignItems: 'stretch', 11 | marginTop: Platform.select({ios: 20, android: 0}) 12 | }, 13 | headerViewStyle: { 14 | paddingTop: 16, 15 | paddingBottom: 10, 16 | backgroundColor: '#F46842' 17 | }, 18 | headerTextStyle: { 19 | alignSelf: 'center', 20 | height: 32, 21 | fontSize: 18, 22 | fontWeight: 'bold', 23 | color: '#fff', 24 | borderColor: 'lightgray', 25 | borderRadius: 5, 26 | borderWidth: 0 27 | }, 28 | buttonViewStyle: { 29 | alignSelf: 'center', 30 | paddingBottom: 20 31 | }, 32 | buttonStyle: { 33 | justifyContent: 'center', 34 | width: 120, 35 | height: 38, 36 | backgroundColor: '#2ecc71', 37 | borderColor: '#27AE60', 38 | borderRadius: 5, 39 | paddingLeft: 10, 40 | paddingRight: 10 41 | }, 42 | cancelButtonStyle: { 43 | justifyContent: 'center', 44 | width: 100, 45 | height: 38, 46 | backgroundColor: '#c5c5c5', 47 | borderRadius: 5 48 | }, 49 | buttonTextStyle: { 50 | textAlign: 'center', 51 | fontSize: 14, 52 | fontWeight: 'bold', 53 | color: '#fff' 54 | }, 55 | videoPlayerViewStyle: { 56 | backgroundColor: '#ECF0F1', 57 | borderColor: '#B9C3C7', 58 | borderRadius: 5, 59 | borderWidth: 1, 60 | height: window.height - 310, 61 | width: window.width - 40, 62 | marginVertical: 20, 63 | marginHorizontal: 20 64 | }, 65 | halfSizeVideoPlayerViewStyle: { 66 | backgroundColor: '#ECF0F1', 67 | borderColor: '#B9C3C7', 68 | borderRadius: 5, 69 | borderWidth: 1, 70 | height: (window.height - 250) / 2, 71 | width: window.width - 40, 72 | marginVertical: 20, 73 | marginHorizontal: 20 74 | }, 75 | outputViewStyle: { 76 | padding: 20, 77 | flex: 1, 78 | justifyContent: 'flex-start', 79 | alignItems: 'stretch' 80 | }, 81 | outputScrollViewStyle: { 82 | padding: 4, 83 | backgroundColor: '#f1c40f', 84 | borderColor: '#f39c12', 85 | borderRadius: 5, 86 | borderWidth: 1 87 | }, 88 | outputTextStyle: { 89 | color: 'black' 90 | }, 91 | textInputViewStyle: { 92 | paddingTop: 40, 93 | paddingBottom: 40, 94 | paddingRight: 20, 95 | paddingLeft: 20 96 | }, 97 | textInputStyle: { 98 | height: 36, 99 | fontSize: 12, 100 | borderColor: '#3498db', 101 | borderRadius: 5, 102 | borderWidth: 1 103 | } 104 | }); 105 | 106 | export {styles} 107 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto init 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto init 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :init 68 | @rem Get command-line arguments, handling Windows variants 69 | 70 | if not "%OS%" == "Windows_NT" goto win9xME_args 71 | 72 | :win9xME_args 73 | @rem Slurp the command line arguments. 74 | set CMD_LINE_ARGS= 75 | set _SKIP=2 76 | 77 | :win9xME_args_slurp 78 | if "x%~1" == "x" goto execute 79 | 80 | set CMD_LINE_ARGS=%* 81 | 82 | :execute 83 | @rem Setup the command line 84 | 85 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 86 | 87 | @rem Execute Gradle 88 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 89 | 90 | :end 91 | @rem End local scope for the variables with windows NT shell 92 | if "%ERRORLEVEL%"=="0" goto mainEnd 93 | 94 | :fail 95 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 96 | rem the _cmd.exe /c_ return code! 97 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 98 | exit /b 1 99 | 100 | :mainEnd 101 | if "%OS%"=="Windows_NT" endlocal 102 | 103 | :omega 104 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-native-ffmpeg-test 2 | Test application for [react-native-ffmpeg](https://github.com/tanersener/react-native-ffmpeg) 3 | 4 | Not maintained anymore, superseded by [FFmpegKit](https://github.com/tanersener/ffmpeg-kit) and [FFmpegKitTest](https://github.com/tanersener/ffmpeg-kit-test). See [react-native-ffmpeg to FFmpegKit Migration Guide](https://github.com/tanersener/ffmpeg-kit/wiki/Migrating-From-ReactNativeFFmpeg). 5 | 6 | 7 | Supports command execution, video encoding, accessing https, encoding audio, burning subtitles, video stabilisation, 8 | pipe operations and concurrent command execution. 9 | 10 | 11 | 12 | - Uses `cocoapods` to download IOS dependencies 13 | - Podfile 14 | ``` 15 | platform :ios, '11.0' 16 | 17 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 18 | 19 | target "ReactNativeFFmpegTest" do 20 | 21 | pod 'react-native-ffmpeg/full', :podspec => '../node_modules/react-native-ffmpeg/react-native-ffmpeg.podspec' 22 | 23 | use_native_modules! 24 | 25 | pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector" 26 | pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec" 27 | pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired" 28 | pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety" 29 | 30 | pod 'React', :path => '../node_modules/react-native/' 31 | pod 'React-Core', :path => '../node_modules/react-native/' 32 | pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules' 33 | pod 'React-Core/DevSupport', :path => '../node_modules/react-native/' 34 | pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS' 35 | pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation' 36 | pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob' 37 | pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image' 38 | pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS' 39 | pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network' 40 | pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings' 41 | pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text' 42 | pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration' 43 | pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/' 44 | 45 | pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact' 46 | pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi' 47 | pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor' 48 | pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector' 49 | pod 'React-callinvoker', :path => "../node_modules/react-native/ReactCommon/callinvoker" 50 | pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon" 51 | pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga' 52 | 53 | pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' 54 | pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' 55 | pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' 56 | 57 | end 58 | ``` 59 | -------------------------------------------------------------------------------- /ios/ReactNativeFFmpegTest.xcodeproj/xcshareddata/xcschemes/ReactNativeFFmpegTest.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 53 | 55 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {NavigationContainer} from '@react-navigation/native'; 3 | import CommandTab from './command-tab' 4 | import VideoTab from './video-tab' 5 | import VideoUtil from "./video-util"; 6 | import Test from "./test-api"; 7 | import {setLogLevel} from "./react-native-ffmpeg-api-wrapper"; 8 | import {LogLevel} from "react-native-ffmpeg"; 9 | import HttpsTab from "./https-tab"; 10 | import AudioTab from "./audio-tab"; 11 | import SubtitleTab from "./subtitle-tab"; 12 | import VidStabTab from "./vid-stab-tab"; 13 | import ConcurrentExecutionTab from "./concurrent-execution-tab"; 14 | import PipeTab from "./pipe-tab"; 15 | 16 | import {createMaterialTopTabNavigator} from '@react-navigation/material-top-tabs'; 17 | 18 | const Tab = createMaterialTopTabNavigator(); 19 | 20 | function BottomTabs() { 21 | return ( 22 | 39 | 40 | 47 | 54 | 61 | 68 | 75 | 82 | 89 | 96 | 97 | ); 98 | } 99 | 100 | export default class Main extends React.Component { 101 | constructor(props) { 102 | super(props); 103 | 104 | Test.testCommonApiMethods(); 105 | Test.testParseArguments(); 106 | 107 | VideoUtil.prepareAssets().then(_ => _); 108 | VideoUtil.registerAppFont().then(_ => _); 109 | 110 | setLogLevel(LogLevel.AV_LOG_INFO); 111 | } 112 | 113 | render() { 114 | return ( 115 | 116 | 117 | 118 | ); 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /src/react-native-ffmpeg-api-wrapper.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {RNFFmpeg, RNFFmpegConfig, RNFFprobe} from 'react-native-ffmpeg'; 3 | import {ffprint} from './util'; 4 | 5 | export async function executeFFmpeg(command) { 6 | return await RNFFmpeg.execute(command) 7 | } 8 | 9 | export function executeFFmpegWithArguments(commandArguments) { 10 | RNFFmpeg.executeWithArguments(commandArguments).then(rc => ffprint(`FFmpeg process exited with rc ${rc}`)); 11 | } 12 | 13 | export async function executeFFmpegAsync(command, callback) { 14 | return await RNFFmpeg.executeAsync(command, callback); 15 | } 16 | 17 | export function executeFFmpegAsyncWithArguments(commandArguments, callback) { 18 | RNFFmpeg.executeAsyncWithArguments(commandArguments, callback).then(executionId => ffprint(`FFmpeg process started with executionId ${executionId}.`)); 19 | } 20 | 21 | export function executeFFmpegCancel() { 22 | RNFFmpeg.cancel(); 23 | } 24 | 25 | export function executeFFmpegCancelExecution(executionId) { 26 | RNFFmpeg.cancelExecution(executionId); 27 | } 28 | 29 | export function getLastCommandOutput() { 30 | return RNFFmpegConfig.getLastCommandOutput(); 31 | } 32 | 33 | export function getLogLevel() { 34 | return RNFFmpegConfig.getLogLevel(); 35 | } 36 | 37 | export function setLogLevel(logLevel) { 38 | return RNFFmpegConfig.setLogLevel(logLevel); 39 | } 40 | 41 | export function enableLogCallback(logCallback) { 42 | RNFFmpegConfig.enableLogCallback(logCallback); 43 | } 44 | 45 | export function enableStatisticsCallback(statisticsCallback) { 46 | RNFFmpegConfig.enableStatisticsCallback(statisticsCallback); 47 | } 48 | 49 | export function listExecutions() { 50 | RNFFmpeg.listExecutions().then(executionList => { 51 | executionList.forEach(execution => { 52 | ffprint(`Execution id is ${execution.executionId}`); 53 | ffprint(`Execution start time is ` + new Date(execution.startTime)); 54 | ffprint(`Execution command is ${execution.command}`); 55 | }); 56 | }); 57 | } 58 | 59 | export async function executeFFprobe(command) { 60 | return await RNFFprobe.execute(command); 61 | } 62 | 63 | export function executeFFprobeWithArguments(commandArguments) { 64 | RNFFprobe.executeWithArguments(commandArguments).then(rc => ffprint(`FFprobe process exited with rc ${rc}`)); 65 | } 66 | 67 | export function resetStatistics() { 68 | RNFFmpegConfig.resetStatistics(); 69 | } 70 | 71 | export function parseArguments(command) { 72 | return RNFFmpeg.parseArguments(command); 73 | } 74 | 75 | export function getFFmpegVersion() { 76 | return RNFFmpegConfig.getFFmpegVersion(); 77 | } 78 | 79 | export function getPlatform() { 80 | return RNFFmpegConfig.getPlatform(); 81 | } 82 | 83 | export function getPackageName() { 84 | return RNFFmpegConfig.getPackageName(); 85 | } 86 | 87 | export function getExternalLibraries() { 88 | return RNFFmpegConfig.getExternalLibraries(); 89 | } 90 | 91 | export function getLastReturnCode() { 92 | return RNFFmpegConfig.getLastReturnCode(); 93 | } 94 | 95 | export function getLastReceivedStatistics() { 96 | return RNFFmpegConfig.getLastReceivedStatistics(); 97 | } 98 | 99 | export function setFontDirectory(path, mapping) { 100 | RNFFmpegConfig.setFontDirectory(path, mapping); 101 | } 102 | 103 | export function setFontconfigConfigurationPath(path) { 104 | RNFFmpegConfig.setFontconfigConfigurationPath(path); 105 | } 106 | 107 | export function setEnvironmentVariable(name, value) { 108 | RNFFmpegConfig.setEnvironmentVariable(name, value); 109 | } 110 | 111 | export function getMediaInformation(path) { 112 | return RNFFprobe.getMediaInformation(path); 113 | } 114 | 115 | export function registerNewFFmpegPipe() { 116 | return RNFFmpegConfig.registerNewFFmpegPipe(); 117 | } 118 | 119 | export function writeToPipe(inputPath, pipePath) { 120 | return RNFFmpegConfig.writeToPipe(inputPath, pipePath); 121 | } 122 | -------------------------------------------------------------------------------- /ios/Resources/sil_open_font_license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2012, Julieta Ulanovsky (julieta.ulanovsky@gmail.com), with Reserved Font Names 'Montserrat' 2 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 3 | This license is copied below, and is also available with a FAQ at: 4 | http://scripts.sil.org/OFL 5 | 6 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 7 | This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL 8 | 9 | ----------------------------------------------------------- 10 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 11 | ----------------------------------------------------------- 12 | 13 | PREAMBLE 14 | The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others. 15 | 16 | The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. 17 | 18 | DEFINITIONS 19 | "Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. 20 | 21 | "Reserved Font Name" refers to any names specified as such after the copyright statement(s). 22 | 23 | "Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s). 24 | 25 | "Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. 26 | 27 | "Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. 28 | 29 | PERMISSION & CONDITIONS 30 | Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: 31 | 32 | 1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. 33 | 34 | 2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. 35 | 36 | 3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. 37 | 38 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. 39 | 40 | 5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. 41 | 42 | TERMINATION 43 | This license becomes null and void if any of the above conditions are not met. 44 | 45 | DISCLAIMER 46 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. -------------------------------------------------------------------------------- /android/app/src/main/assets/sil_open_font_license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2012, Julieta Ulanovsky (julieta.ulanovsky@gmail.com), with Reserved Font Names 'Montserrat' 2 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 3 | This license is copied below, and is also available with a FAQ at: 4 | http://scripts.sil.org/OFL 5 | 6 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 7 | This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL 8 | 9 | ----------------------------------------------------------- 10 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 11 | ----------------------------------------------------------- 12 | 13 | PREAMBLE 14 | The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others. 15 | 16 | The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. 17 | 18 | DEFINITIONS 19 | "Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. 20 | 21 | "Reserved Font Name" refers to any names specified as such after the copyright statement(s). 22 | 23 | "Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s). 24 | 25 | "Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. 26 | 27 | "Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. 28 | 29 | PERMISSION & CONDITIONS 30 | Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: 31 | 32 | 1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. 33 | 34 | 2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. 35 | 36 | 3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. 37 | 38 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. 39 | 40 | 5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. 41 | 42 | TERMINATION 43 | This license becomes null and void if any of the above conditions are not met. 44 | 45 | DISCLAIMER 46 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. -------------------------------------------------------------------------------- /src/command-tab.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {ScrollView, Text, TextInput, TouchableOpacity, View} from 'react-native'; 3 | import {styles} from './style'; 4 | import {COMMAND_TEST_TOOLTIP_TEXT} from './tooltip'; 5 | import {showPopup, Toast} from './popup'; 6 | import { 7 | enableLogCallback, 8 | enableStatisticsCallback, 9 | executeFFmpeg, 10 | executeFFprobe, 11 | getLogLevel 12 | } from './react-native-ffmpeg-api-wrapper'; 13 | import {ffprint} from './util'; 14 | 15 | export default class CommandTab extends React.Component { 16 | constructor(props) { 17 | super(props); 18 | 19 | this.state = { 20 | commandText: '', 21 | outputText: '' 22 | }; 23 | 24 | this.popupReference = React.createRef(); 25 | } 26 | 27 | componentDidMount() { 28 | this.props.navigation.addListener('focus', (_) => { 29 | this.clearLog(); 30 | this.setActive(); 31 | }); 32 | } 33 | 34 | setActive() { 35 | ffprint("Command Tab Activated"); 36 | enableLogCallback(this.logCallback); 37 | enableStatisticsCallback(undefined); 38 | showPopup(this.popupReference, COMMAND_TEST_TOOLTIP_TEXT); 39 | } 40 | 41 | logCallback = (log) => { 42 | this.appendLog(log.message); 43 | }; 44 | 45 | appendLog(logMessage) { 46 | this.setState({outputText: this.state.outputText + logMessage}); 47 | }; 48 | 49 | clearLog() { 50 | this.setState({outputText: ''}); 51 | } 52 | 53 | runFFmpeg = () => { 54 | this.clearLog(); 55 | 56 | let ffmpegCommand = this.state.commandText; 57 | 58 | getLogLevel().then(logLevel => ffprint(`Current log level is ${logLevel}.`)); 59 | 60 | ffprint('Testing FFmpeg COMMAND synchronously.'); 61 | 62 | ffprint(`FFmpeg process started with arguments\n\'${ffmpegCommand}\'`); 63 | 64 | executeFFmpeg(ffmpegCommand).then((result) => { 65 | ffprint(`FFmpeg process exited with rc ${result}.`); 66 | if (result !== 0) { 67 | showPopup(this.popupReference, "Command failed. Please check output for the details."); 68 | } 69 | }); 70 | }; 71 | 72 | runFFprobe = () => { 73 | this.clearLog(); 74 | 75 | let ffprobeCommand = this.state.commandText; 76 | 77 | ffprint('Testing FFprobe COMMAND synchronously.'); 78 | 79 | ffprint(`FFprobe process started with arguments\n\'${ffprobeCommand}\'`); 80 | 81 | executeFFprobe(ffprobeCommand).then((result) => { 82 | ffprint(`FFprobe process exited with rc ${result}.`); 83 | if (result !== 0) { 84 | showPopup(this.popupReference, "Command failed. Please check output for the details."); 85 | } 86 | }); 87 | }; 88 | 89 | render() { 90 | return ( 91 | 92 | 93 | 94 | ReactNativeFFmpegTest 95 | 96 | 97 | 98 | this.setState({commandText})} 105 | value={this.state.commandText} 106 | /> 107 | 108 | 109 | 112 | RUN FFMPEG 113 | 114 | 115 | 116 | 117 | 120 | RUN FFPROBE 121 | 122 | 123 | 124 | { 126 | this.scrollViewReference = view; 127 | }} 128 | onContentSizeChange={(width, height) => this.scrollViewReference.scrollTo({y: height})} 129 | style={styles.outputScrollViewStyle}> 130 | {this.state.outputText} 131 | 132 | 133 | 134 | ); 135 | }; 136 | 137 | } 138 | -------------------------------------------------------------------------------- /ios/ReactNativeFFmpegTest/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 25 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /src/popup.js: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Copyright (c) 2016 Jia PengHui 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | // 24 | 25 | /** 26 | * react-native-easy-toast 27 | * https://github.com/crazycodeboy/react-native-easy-toast 28 | * Email:crazycodeboy@gmail.com 29 | * Blog:http://jiapenghui.com 30 | * @flow 31 | */ 32 | 33 | import React, {Component} from 'react'; 34 | import {Animated, Dimensions, StyleSheet, Text, View, ViewPropTypes as RNViewPropTypes,} from 'react-native' 35 | import PropTypes from 'prop-types'; 36 | import {ffprint} from './util'; 37 | 38 | const ViewPropTypes = RNViewPropTypes || View.propTypes; 39 | const DURATION = { 40 | LENGTH_SHORT: 1000, 41 | FOREVER: 0, 42 | }; 43 | 44 | const window = Dimensions.get('window'); 45 | 46 | export function showPopup(reference, text) { 47 | if (reference.current !== null && reference.current !== undefined) { 48 | reference.current.show(text, DURATION.LENGTH_SHORT); 49 | } else { 50 | ffprint('Popup reference is empty.'); 51 | } 52 | } 53 | 54 | export class Toast extends Component { 55 | 56 | constructor(props) { 57 | super(props); 58 | this.state = { 59 | isShow: false, 60 | text: '', 61 | opacityValue: new Animated.Value(this.props.opacity), 62 | } 63 | } 64 | 65 | show(text, duration, callback) { 66 | this.duration = typeof duration === 'number' ? duration : DURATION.LENGTH_SHORT; 67 | this.callback = callback; 68 | this.setState({ 69 | isShow: true, 70 | text: text, 71 | }); 72 | 73 | this.animation = Animated.timing( 74 | this.state.opacityValue, 75 | { 76 | toValue: this.props.opacity, 77 | duration: this.props.fadeInDuration, 78 | useNativeDriver: true 79 | } 80 | ) 81 | this.animation.start(() => { 82 | this.isShow = true; 83 | if (duration !== DURATION.FOREVER) this.close(); 84 | }); 85 | } 86 | 87 | close(duration) { 88 | let delay = typeof duration === 'undefined' ? this.duration : duration; 89 | 90 | if (delay === DURATION.FOREVER) delay = this.props.defaultCloseDelay || 250; 91 | 92 | if (!this.isShow && !this.state.isShow) return; 93 | this.timer && clearTimeout(this.timer); 94 | this.timer = setTimeout(() => { 95 | this.animation = Animated.timing( 96 | this.state.opacityValue, 97 | { 98 | toValue: 0.0, 99 | duration: this.props.fadeOutDuration, 100 | useNativeDriver: true 101 | } 102 | ) 103 | this.animation.start(() => { 104 | this.setState({ 105 | isShow: false, 106 | }); 107 | this.isShow = false; 108 | if (typeof this.callback === 'function') { 109 | this.callback(); 110 | } 111 | }); 112 | }, delay); 113 | } 114 | 115 | componentWillUnmount() { 116 | this.animation && this.animation.stop() 117 | this.timer && clearTimeout(this.timer); 118 | } 119 | 120 | render() { 121 | let vPos; 122 | switch (this.props.position) { 123 | case 'top': 124 | vPos = this.props.positionValue; 125 | break; 126 | case 'center': 127 | vPos = window.height / 2; 128 | break; 129 | case 'bottom': 130 | vPos = window.height - this.props.positionValue; 131 | break; 132 | } 133 | let hPos = 50; 134 | 135 | return this.state.isShow ? 136 | 139 | 140 | {React.isValidElement(this.state.text) ? this.state.text : 141 | {this.state.text}} 142 | 143 | : null; 144 | } 145 | } 146 | 147 | const styles = StyleSheet.create({ 148 | container: { 149 | position: 'absolute', 150 | left: 0, 151 | right: 0, 152 | elevation: 999, 153 | alignItems: 'center', 154 | zIndex: 10000, 155 | }, 156 | content: { 157 | backgroundColor: 'rgba(250, 250, 250, 0.7)', 158 | borderRadius: 5, 159 | padding: 10, 160 | }, 161 | text: { 162 | color: 'black' 163 | } 164 | }); 165 | 166 | Toast.propTypes = { 167 | style: ViewPropTypes.style, 168 | position: PropTypes.oneOf([ 169 | 'top', 170 | 'center', 171 | 'bottom', 172 | ]), 173 | textStyle: Text.propTypes.style, 174 | positionValue: PropTypes.number, 175 | fadeInDuration: PropTypes.number, 176 | fadeOutDuration: PropTypes.number, 177 | opacity: PropTypes.number 178 | } 179 | 180 | Toast.defaultProps = { 181 | position: 'bottom', 182 | textStyle: styles.text, 183 | positionValue: 120, 184 | fadeInDuration: 500, 185 | fadeOutDuration: 500, 186 | opacity: 1 187 | } 188 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ] ; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ] ; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 109 | MAX_FD_LIMIT=`ulimit -H -n` 110 | if [ $? -eq 0 ] ; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ] ; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin or MSYS, switch paths to Windows format before running java 129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 132 | JAVACMD=`cygpath --unix "$JAVACMD"` 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 136 | SEP="" 137 | for dir in $ROOTDIRSRAW ; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a user-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@" ; do 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 154 | else 155 | eval `echo args$i`="\"$arg\"" 156 | fi 157 | i=`expr $i + 1` 158 | done 159 | case $i in 160 | 0) set -- ;; 161 | 1) set -- "$args0" ;; 162 | 2) set -- "$args0" "$args1" ;; 163 | 3) set -- "$args0" "$args1" "$args2" ;; 164 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save () { 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 176 | echo " " 177 | } 178 | APP_ARGS=`save "$@"` 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 182 | 183 | exec "$JAVACMD" "$@" 184 | -------------------------------------------------------------------------------- /src/pipe-tab.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {Text, TouchableOpacity, View} from 'react-native'; 3 | import RNFS from 'react-native-fs'; 4 | import VideoUtil from './video-util'; 5 | import { 6 | enableLogCallback, 7 | enableStatisticsCallback, 8 | executeFFmpegAsync, 9 | registerNewFFmpegPipe, 10 | resetStatistics, 11 | writeToPipe 12 | } from './react-native-ffmpeg-api-wrapper'; 13 | import {styles} from './style'; 14 | import {showPopup, Toast} from "./popup"; 15 | import {PIPE_TEST_TOOLTIP_TEXT} from "./tooltip"; 16 | import {ProgressModal} from "./progress_modal"; 17 | import Video from 'react-native-video'; 18 | import {ffprint} from './util'; 19 | 20 | export default class PipeTab extends React.Component { 21 | constructor(props) { 22 | super(props); 23 | 24 | this.state = { 25 | statistics: undefined 26 | }; 27 | 28 | this.popupReference = React.createRef(); 29 | this.progressModalReference = React.createRef(); 30 | } 31 | 32 | componentDidMount() { 33 | this.props.navigation.addListener('focus', (_) => { 34 | this.pause(); 35 | this.setActive(); 36 | }); 37 | } 38 | 39 | setActive() { 40 | ffprint("Pipe Tab Activated"); 41 | enableLogCallback(this.logCallback); 42 | enableStatisticsCallback(this.statisticsCallback); 43 | showPopup(this.popupReference, PIPE_TEST_TOOLTIP_TEXT); 44 | } 45 | 46 | logCallback = (log) => { 47 | ffprint(log.message); 48 | } 49 | 50 | statisticsCallback = (statistics) => { 51 | this.setState({statistics: statistics}); 52 | this.updateProgressDialog(); 53 | } 54 | 55 | asyncAssetWriteToPipe(assetName, pipePath) { 56 | writeToPipe(VideoUtil.assetPath(assetName), pipePath); 57 | } 58 | 59 | createVideo = () => { 60 | let videoFile = this.getVideoFile(); 61 | registerNewFFmpegPipe().then((pipe1) => { 62 | registerNewFFmpegPipe().then((pipe2) => { 63 | registerNewFFmpegPipe().then((pipe3) => { 64 | 65 | // IF VIDEO IS PLAYING STOP PLAYBACK 66 | this.pause(); 67 | 68 | VideoUtil.deleteFile(videoFile); 69 | 70 | ffprint("Testing PIPE with 'mpeg4' codec"); 71 | 72 | this.hideProgressDialog(); 73 | this.showProgressDialog(); 74 | 75 | let ffmpegCommand = VideoUtil.generateCreateVideoWithPipesScript( 76 | pipe1, pipe2, pipe3, videoFile); 77 | 78 | executeFFmpegAsync(ffmpegCommand, completedExecution => { 79 | this.hideProgressDialog(); 80 | if (completedExecution.returnCode === 0) { 81 | ffprint("Create completed successfully; playing video."); 82 | this.playVideo(); 83 | } else { 84 | ffprint(`Create failed with rc=${completedExecution.returnCode}.`); 85 | showPopup(this.popupReference, "Create failed. Please check log for the details."); 86 | } 87 | } 88 | ).then(executionId => ffprint(`Async FFmpeg process started with arguments \'${ffmpegCommand}\' and executionId ${executionId}.`)); 89 | 90 | this.asyncAssetWriteToPipe(VideoUtil.ASSET_1, pipe1); 91 | this.asyncAssetWriteToPipe(VideoUtil.ASSET_2, pipe2); 92 | this.asyncAssetWriteToPipe(VideoUtil.ASSET_3, pipe3); 93 | }); 94 | }); 95 | }); 96 | } 97 | 98 | playVideo() { 99 | let player = this.player; 100 | if (player !== undefined) { 101 | player.seek(0); 102 | } 103 | this.setState({paused: false}); 104 | } 105 | 106 | pause() { 107 | this.setState({paused: true}); 108 | } 109 | 110 | getVideoFile() { 111 | return `${RNFS.CachesDirectoryPath}/video.mp4`; 112 | } 113 | 114 | showProgressDialog() { 115 | // CLEAN STATISTICS 116 | this.setState({statistics: undefined}); 117 | resetStatistics(); 118 | this.progressModalReference.current.show(`Creating video`); 119 | } 120 | 121 | updateProgressDialog() { 122 | let statistics = this.state.statistics; 123 | if (statistics === undefined) { 124 | return; 125 | } 126 | 127 | let timeInMilliseconds = statistics.time; 128 | if (timeInMilliseconds > 0) { 129 | let totalVideoDuration = 9000; 130 | let completePercentage = Math.round((timeInMilliseconds * 100) / totalVideoDuration); 131 | this.progressModalReference.current.update(`Creating video % ${completePercentage}`); 132 | } 133 | } 134 | 135 | hideProgressDialog() { 136 | this.progressModalReference.current.hide(); 137 | } 138 | 139 | onPlayError = (err) => { 140 | ffprint('Play error: ' + JSON.stringify(err)); 141 | } 142 | 143 | render() { 144 | return ( 145 | 146 | 147 | 149 | ReactNativeFFmpegTest 150 | 151 | 152 | 153 | 156 | CREATE 157 | 158 | 159 | 160 | 163 | 173 | ); 174 | } 175 | 176 | } 177 | -------------------------------------------------------------------------------- /src/progress_modal.js: -------------------------------------------------------------------------------- 1 | // 2 | // MIT License 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | // SOFTWARE. 21 | // 22 | 23 | // react-native-loading-spinner-overlay 24 | // Copyright (c) 2016- Nick Baugh 25 | // MIT Licensed 26 | 27 | // * Author: [@niftylettuce](https://twitter.com/#!/niftylettuce) 28 | // * Source: 29 | // 30 | 31 | // # react-native-loading-spinner-overlay 32 | // 33 | // 34 | // 35 | // 36 | // 37 | // 38 | 39 | import React from 'react'; 40 | import PropTypes from 'prop-types'; 41 | import {ActivityIndicator, Dimensions, Modal, StyleSheet, Text, TouchableOpacity, View} from 'react-native'; 42 | import {styles as sharedStyles} from "./style"; 43 | 44 | const window = Dimensions.get('window'); 45 | const transparent = 'transparent'; 46 | const ANIMATION = ['none', 'slide', 'fade']; 47 | 48 | export class ProgressModal extends React.PureComponent { 49 | constructor(props) { 50 | super(props); 51 | this.state = { 52 | visible: this.props.visible 53 | }; 54 | } 55 | 56 | static propTypes = { 57 | cancelable: PropTypes.bool, 58 | color: PropTypes.string, 59 | animation: PropTypes.oneOf(ANIMATION), 60 | overlayColor: PropTypes.string, 61 | textContent: PropTypes.string, 62 | textStyle: PropTypes.object, 63 | visible: PropTypes.bool, 64 | indicatorStyle: PropTypes.object, 65 | children: PropTypes.element, 66 | spinnerKey: PropTypes.string 67 | }; 68 | 69 | static defaultProps = { 70 | visible: false, 71 | cancelable: false, 72 | textContent: '', 73 | animation: 'fade', 74 | color: 'black', 75 | overlayColor: 'rgba(0, 0, 0, 0.4)' 76 | }; 77 | 78 | show(message, cancelFunction) { 79 | this.setState({visible: true, textContent: message, cancelFunction: cancelFunction}); 80 | } 81 | 82 | update(message) { 83 | this.setState({textContent: message}); 84 | } 85 | 86 | hide() { 87 | this.setState({visible: false}); 88 | } 89 | 90 | cancelFunction = () => { 91 | this.state.cancelFunction(); 92 | this.hide(); 93 | } 94 | 95 | render() { 96 | return ( 97 | 102 | 103 | 104 | 105 | 106 | 109 | 110 | 111 | 112 | {this.state.textContent} 113 | 114 | 115 | 116 | { 117 | this.state.cancelFunction ? 118 | ( 119 | 120 | 123 | CANCEL 124 | 125 | 126 | ) 127 | : 128 | null 129 | } 130 | 131 | 132 | 133 | ); 134 | } 135 | } 136 | 137 | const styles = StyleSheet.create({ 138 | container: { 139 | backgroundColor: transparent, 140 | bottom: 0, 141 | left: 0, 142 | position: 'absolute', 143 | right: 0, 144 | top: 0 145 | }, 146 | panel: { 147 | flexDirection: 'column', 148 | alignItems: 'stretch', 149 | justifyContent: 'flex-start', 150 | alignSelf: 'flex-start', 151 | backgroundColor: 'white', 152 | borderRadius: 5, 153 | position: 'absolute', 154 | width: Math.round(window.width - 80), 155 | left: 40, 156 | top: Math.round((window.height - 120) / 2) 157 | }, 158 | smallPanel: { 159 | height: 100 160 | }, 161 | largePanel: { 162 | height: 140, 163 | paddingBottom: 30 164 | }, 165 | loadingPanel: { 166 | flex: 1, 167 | flexDirection: 'row', 168 | position: 'relative', 169 | height: 80, 170 | left: 0, 171 | top: 0, 172 | paddingLeft: 0, 173 | paddingRight: 0, 174 | paddingTop: 40, 175 | paddingBottom: 40 176 | }, 177 | buttonPanel: { 178 | flex: 1, 179 | alignItems: 'center', 180 | justifyContent: 'center', 181 | position: 'relative', 182 | width: Math.round(window.width - 80), 183 | left: 0, 184 | top: 10 185 | }, 186 | activityIndicator: { 187 | alignItems: 'baseline', 188 | justifyContent: 'center', 189 | flex: 1, 190 | paddingLeft: 30 191 | }, 192 | textContainer: { 193 | alignItems: 'baseline', 194 | flex: 4, 195 | justifyContent: 'center', 196 | position: 'relative', 197 | left: 0 198 | }, 199 | textContent: { 200 | color: 'black', 201 | fontSize: 16, 202 | fontWeight: 'bold', 203 | paddingLeft: 20 204 | } 205 | }); 206 | 207 | const spinnerStyle = { 208 | color: 'dodgerblue', 209 | size: 50 210 | } 211 | -------------------------------------------------------------------------------- /src/test-api.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {LogLevel} from 'react-native-ffmpeg'; 3 | import {ffprint} from './util'; 4 | import { 5 | getExternalLibraries, 6 | getFFmpegVersion, 7 | getLastCommandOutput, 8 | getLastReceivedStatistics, 9 | getLastReturnCode, 10 | getLogLevel, 11 | getPackageName, 12 | getPlatform, 13 | parseArguments, 14 | setLogLevel 15 | } from "./react-native-ffmpeg-api-wrapper"; 16 | 17 | function assertNotNull(condition) { 18 | if (condition == null) { 19 | throw `Assertion failed: ${condition} is null`; 20 | } 21 | } 22 | 23 | function assertIsArray(variable) { 24 | if (!Array.isArray(variable)) { 25 | throw "Assertion failed"; 26 | } 27 | } 28 | 29 | function assertEquals(expected, real) { 30 | if (expected !== real) { 31 | throw `Assertion failed: ${real} != ${expected}`; 32 | } 33 | } 34 | 35 | function testParseSimpleCommand() { 36 | const argumentArray = parseArguments("-hide_banner -loop 1 -i file.jpg -filter_complex [0:v]setpts=PTS-STARTPTS[video] -map [video] -vsync 2 -async 1 video.mp4"); 37 | 38 | assertNotNull(argumentArray); 39 | assertIsArray(argumentArray); 40 | assertEquals(14, argumentArray.length); 41 | 42 | assertEquals("-hide_banner", argumentArray[0]); 43 | assertEquals("-loop", argumentArray[1]); 44 | assertEquals("1", argumentArray[2]); 45 | assertEquals("-i", argumentArray[3]); 46 | assertEquals("file.jpg", argumentArray[4]); 47 | assertEquals("-filter_complex", argumentArray[5]); 48 | assertEquals("[0:v]setpts=PTS-STARTPTS[video]", argumentArray[6]); 49 | assertEquals("-map", argumentArray[7]); 50 | assertEquals("[video]", argumentArray[8]); 51 | assertEquals("-vsync", argumentArray[9]); 52 | assertEquals("2", argumentArray[10]); 53 | assertEquals("-async", argumentArray[11]); 54 | assertEquals("1", argumentArray[12]); 55 | assertEquals("video.mp4", argumentArray[13]); 56 | } 57 | 58 | function testParseSingleQuotesInCommand() { 59 | const argumentArray = parseArguments("-loop 1 'file one.jpg' -filter_complex '[0:v]setpts=PTS-STARTPTS[video]' -map [video] video.mp4 "); 60 | 61 | assertNotNull(argumentArray); 62 | assertEquals(8, argumentArray.length); 63 | 64 | assertEquals("-loop", argumentArray[0]); 65 | assertEquals("1", argumentArray[1]); 66 | assertEquals("file one.jpg", argumentArray[2]); 67 | assertEquals("-filter_complex", argumentArray[3]); 68 | assertEquals("[0:v]setpts=PTS-STARTPTS[video]", argumentArray[4]); 69 | assertEquals("-map", argumentArray[5]); 70 | assertEquals("[video]", argumentArray[6]); 71 | assertEquals("video.mp4", argumentArray[7]); 72 | } 73 | 74 | function testParseDoubleQuotesInCommand() { 75 | let argumentArray = parseArguments("-loop 1 \"file one.jpg\" -filter_complex \"[0:v]setpts=PTS-STARTPTS[video]\" -map [video] video.mp4 "); 76 | 77 | assertNotNull(argumentArray); 78 | assertEquals(8, argumentArray.length); 79 | 80 | assertEquals("-loop", argumentArray[0]); 81 | assertEquals("1", argumentArray[1]); 82 | assertEquals("file one.jpg", argumentArray[2]); 83 | assertEquals("-filter_complex", argumentArray[3]); 84 | assertEquals("[0:v]setpts=PTS-STARTPTS[video]", argumentArray[4]); 85 | assertEquals("-map", argumentArray[5]); 86 | assertEquals("[video]", argumentArray[6]); 87 | assertEquals("video.mp4", argumentArray[7]); 88 | 89 | argumentArray = parseArguments(" -i file:///tmp/input.mp4 -vcodec libx264 -vf \"scale=1024:1024,pad=width=1024:height=1024:x=0:y=0:color=black\" -acodec copy -q:v 0 -q:a 0 video.mp4"); 90 | 91 | assertNotNull(argumentArray); 92 | assertEquals(13, argumentArray.length); 93 | 94 | assertEquals("-i", argumentArray[0]); 95 | assertEquals("file:///tmp/input.mp4", argumentArray[1]); 96 | assertEquals("-vcodec", argumentArray[2]); 97 | assertEquals("libx264", argumentArray[3]); 98 | assertEquals("-vf", argumentArray[4]); 99 | assertEquals("scale=1024:1024,pad=width=1024:height=1024:x=0:y=0:color=black", argumentArray[5]); 100 | assertEquals("-acodec", argumentArray[6]); 101 | assertEquals("copy", argumentArray[7]); 102 | assertEquals("-q:v", argumentArray[8]); 103 | assertEquals("0", argumentArray[9]); 104 | assertEquals("-q:a", argumentArray[10]); 105 | assertEquals("0", argumentArray[11]); 106 | assertEquals("video.mp4", argumentArray[12]); 107 | } 108 | 109 | function testParseDoubleQuotesAndEscapesInCommand() { 110 | let argumentArray = parseArguments(" -i file:///tmp/input.mp4 -vf \"subtitles=file:///tmp/subtitles.srt:force_style=\'FontSize=16,PrimaryColour=&HFFFFFF&\'\" -vcodec libx264 -acodec copy -q:v 0 -q:a 0 video.mp4"); 111 | 112 | assertNotNull(argumentArray); 113 | assertEquals(13, argumentArray.length); 114 | 115 | assertEquals("-i", argumentArray[0]); 116 | assertEquals("file:///tmp/input.mp4", argumentArray[1]); 117 | assertEquals("-vf", argumentArray[2]); 118 | assertEquals("subtitles=file:///tmp/subtitles.srt:force_style='FontSize=16,PrimaryColour=&HFFFFFF&'", argumentArray[3]); 119 | assertEquals("-vcodec", argumentArray[4]); 120 | assertEquals("libx264", argumentArray[5]); 121 | assertEquals("-acodec", argumentArray[6]); 122 | assertEquals("copy", argumentArray[7]); 123 | assertEquals("-q:v", argumentArray[8]); 124 | assertEquals("0", argumentArray[9]); 125 | assertEquals("-q:a", argumentArray[10]); 126 | assertEquals("0", argumentArray[11]); 127 | assertEquals("video.mp4", argumentArray[12]); 128 | 129 | argumentArray = parseArguments(" -i file:///tmp/input.mp4 -vf \"subtitles=file:///tmp/subtitles.srt:force_style=\\\"FontSize=16,PrimaryColour=&HFFFFFF&\\\"\" -vcodec libx264 -acodec copy -q:v 0 -q:a 0 video.mp4"); 130 | 131 | assertNotNull(argumentArray); 132 | assertEquals(13, argumentArray.length); 133 | 134 | assertEquals("-i", argumentArray[0]); 135 | assertEquals("file:///tmp/input.mp4", argumentArray[1]); 136 | assertEquals("-vf", argumentArray[2]); 137 | assertEquals("subtitles=file:///tmp/subtitles.srt:force_style=\\\"FontSize=16,PrimaryColour=&HFFFFFF&\\\"", argumentArray[3]); 138 | assertEquals("-vcodec", argumentArray[4]); 139 | assertEquals("libx264", argumentArray[5]); 140 | assertEquals("-acodec", argumentArray[6]); 141 | assertEquals("copy", argumentArray[7]); 142 | assertEquals("-q:v", argumentArray[8]); 143 | assertEquals("0", argumentArray[9]); 144 | assertEquals("-q:a", argumentArray[10]); 145 | assertEquals("0", argumentArray[11]); 146 | assertEquals("video.mp4", argumentArray[12]); 147 | } 148 | 149 | export default class Test { 150 | 151 | static testCommonApiMethods() { 152 | ffprint("Testing common api methods."); 153 | 154 | getFFmpegVersion().then(version => ffprint(`FFmpeg version: ${version}`)); 155 | getPlatform().then(platform => ffprint(`Platform: ${platform}`)); 156 | getLogLevel().then(level => ffprint(`Old log level: ${LogLevel.logLevelToString(level)}`)); 157 | setLogLevel(LogLevel.AV_LOG_INFO); 158 | getLogLevel().then(level => ffprint(`New log level: ${LogLevel.logLevelToString(level)}`)); 159 | getPackageName().then(packageName => ffprint(`Package name: ${packageName}`)); 160 | getExternalLibraries().then(packageList => packageList.forEach(value => ffprint(`External library: ${value}`))); 161 | } 162 | 163 | static testParseArguments() { 164 | ffprint("Testing parseArguments."); 165 | 166 | testParseSimpleCommand(); 167 | testParseSingleQuotesInCommand(); 168 | testParseDoubleQuotesInCommand(); 169 | testParseDoubleQuotesAndEscapesInCommand(); 170 | } 171 | 172 | static testPostExecutionCommands() { 173 | getLastCommandOutput() 174 | .then((output) => ffprint(`Last command output: ${output}`)); 175 | getLastReturnCode() 176 | .then((returnCode) => ffprint(`Last return code: ${returnCode}`)); 177 | getLastReceivedStatistics().then(statistics => 178 | ffprint(`Last received statistics: executionId: ${statistics.executionId}, video frame number: ${statistics.videoFrameNumber}, video fps: ${statistics.videoFps}, video quality: ${statistics.videoQuality}, size: ${statistics.size}, time: ${statistics.time}, bitrate: ${statistics.bitrate}, speed: ${statistics.speed}`) 179 | ); 180 | } 181 | 182 | } 183 | -------------------------------------------------------------------------------- /src/concurrent-execution-tab.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {ScrollView, Text, TouchableOpacity, View} from 'react-native'; 3 | import {styles} from './style'; 4 | import {CONCURRENT_EXECUTION_TEST_TOOLTIP_TEXT} from './tooltip'; 5 | import {showPopup, Toast} from './popup'; 6 | import { 7 | enableLogCallback, 8 | enableStatisticsCallback, 9 | executeFFmpegAsync, 10 | executeFFmpegCancel, 11 | executeFFmpegCancelExecution, 12 | listExecutions 13 | } from './react-native-ffmpeg-api-wrapper'; 14 | import {ffprint} from './util'; 15 | import VideoUtil from "./video-util"; 16 | import RNFS from "react-native-fs"; 17 | 18 | export default class ConcurrentExecutionTab extends React.Component { 19 | constructor(props) { 20 | super(props); 21 | 22 | this.state = { 23 | outputText: '', 24 | executionId1: 0, 25 | executionId2: 0, 26 | executionId3: 0 27 | }; 28 | 29 | this.popupReference = React.createRef(); 30 | } 31 | 32 | componentDidMount() { 33 | this.props.navigation.addListener('focus', (_) => { 34 | this.clearLog(); 35 | this.setActive(); 36 | }); 37 | } 38 | 39 | setActive() { 40 | ffprint("Concurrent Execution Tab Activated"); 41 | enableLogCallback(this.logCallback); 42 | enableStatisticsCallback(undefined); 43 | showPopup(this.popupReference, CONCURRENT_EXECUTION_TEST_TOOLTIP_TEXT); 44 | } 45 | 46 | logCallback = (log) => { 47 | this.appendLog(`${log.executionId}:${log.message}`); 48 | }; 49 | 50 | appendLog(logMessage) { 51 | this.setState({outputText: this.state.outputText + logMessage}); 52 | }; 53 | 54 | clearLog() { 55 | this.setState({outputText: ''}); 56 | } 57 | 58 | encodeVideoOne = () => { 59 | this.encodeVideo(1); 60 | } 61 | 62 | encodeVideoTwo = () => { 63 | this.encodeVideo(2); 64 | } 65 | 66 | encodeVideoThree = () => { 67 | this.encodeVideo(3); 68 | } 69 | 70 | encodeVideo(buttonNumber) { 71 | let image1Path = VideoUtil.assetPath(VideoUtil.ASSET_1); 72 | let image2Path = VideoUtil.assetPath(VideoUtil.ASSET_2); 73 | let image3Path = VideoUtil.assetPath(VideoUtil.ASSET_3); 74 | let videoFile = this.getVideoFile(buttonNumber); 75 | ffprint(`Testing CONCURRENT EXECUTION for button ${buttonNumber}.`); 76 | 77 | let ffmpegCommand = VideoUtil.generateEncodeVideoScript(image1Path, image2Path, image3Path, videoFile, "mpeg4", ""); 78 | 79 | executeFFmpegAsync(ffmpegCommand, completedExecution => { 80 | if (completedExecution.returnCode === 255) { 81 | ffprint(`FFmpeg process ended with cancel for button ${buttonNumber} with executionId ${completedExecution.executionId}.`); 82 | } else { 83 | ffprint(`FFmpeg process ended with rc ${completedExecution.returnCode} for button ${buttonNumber} with executionId ${completedExecution.executionId}.`); 84 | } 85 | } 86 | ).then(executionId => { 87 | ffprint(`Async FFmpeg process started for button ${buttonNumber} with arguments '${ffmpegCommand}' and executionId ${executionId}.`); 88 | switch (buttonNumber) { 89 | case 1: 90 | this.setState({executionId1: executionId}); 91 | break; 92 | case 2: 93 | this.setState({executionId2: executionId}); 94 | break; 95 | default: 96 | this.setState({executionId3: executionId}); 97 | } 98 | 99 | this.runListFFmpegExecutions(); 100 | }); 101 | } 102 | 103 | getVideoFile(buttonNumber) { 104 | return `${RNFS.CachesDirectoryPath}/video${buttonNumber}.mp4`; 105 | } 106 | 107 | runListFFmpegExecutions() { 108 | listExecutions(); 109 | } 110 | 111 | runCancelOne = () => { 112 | this.runCancel(1) 113 | } 114 | 115 | runCancelTwo = () => { 116 | this.runCancel(2) 117 | } 118 | 119 | runCancelThree = () => { 120 | this.runCancel(3) 121 | } 122 | 123 | runCancelAll = () => { 124 | this.runCancel(0) 125 | } 126 | 127 | runCancel(buttonNumber) { 128 | let executionId = 0; 129 | 130 | switch (buttonNumber) { 131 | case 1: 132 | executionId = this.state.executionId1; 133 | break; 134 | case 2: 135 | executionId = this.state.executionId2; 136 | break; 137 | case 3: 138 | executionId = this.state.executionId3; 139 | } 140 | 141 | ffprint( 142 | `Cancelling FFmpeg process for button ${buttonNumber} with executionId ${executionId}.`); 143 | 144 | if (executionId === 0) { 145 | executeFFmpegCancel(); 146 | } else { 147 | executeFFmpegCancelExecution(executionId); 148 | } 149 | } 150 | 151 | render() { 152 | return ( 153 | 154 | 155 | 156 | ReactNativeFFmpegTest 157 | 158 | 159 | 160 | 163 | ENCODE 1 164 | 165 | 168 | ENCODE 2 169 | 170 | 173 | ENCODE 3 174 | 175 | 176 | 177 | 178 | 181 | CANCEL 1 182 | 183 | 186 | CANCEL 2 187 | 188 | 191 | CANCEL 3 192 | 193 | 196 | CANCEL ALL 197 | 198 | 199 | 200 | { 202 | this.scrollViewReference = view; 203 | }} 204 | onContentSizeChange={(width, height) => this.scrollViewReference.scrollTo({y: height})} 205 | style={styles.outputScrollViewStyle}> 206 | {this.state.outputText} 207 | 208 | 209 | 210 | ); 211 | }; 212 | 213 | } 214 | -------------------------------------------------------------------------------- /src/vid-stab-tab.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {Text, TouchableOpacity, View} from 'react-native'; 3 | import RNFS from 'react-native-fs'; 4 | import VideoUtil from './video-util'; 5 | import {enableLogCallback, enableStatisticsCallback, executeFFmpegAsync} from './react-native-ffmpeg-api-wrapper'; 6 | import {styles} from './style'; 7 | import {showPopup, Toast} from "./popup"; 8 | import {VIDSTAB_TEST_TOOLTIP_TEXT} from "./tooltip"; 9 | import {ProgressModal} from "./progress_modal"; 10 | import Video from 'react-native-video'; 11 | import {ffprint} from './util'; 12 | 13 | export default class VidStabTab extends React.Component { 14 | constructor(props) { 15 | super(props); 16 | 17 | this.state = {}; 18 | 19 | this.popupReference = React.createRef(); 20 | this.progressModalReference = React.createRef(); 21 | } 22 | 23 | componentDidMount() { 24 | this.props.navigation.addListener('focus', (_) => { 25 | this.pauseVideo(); 26 | this.pauseStabilizedVideo(); 27 | this.setActive(); 28 | }); 29 | } 30 | 31 | setActive() { 32 | ffprint("VidStab Tab Activated"); 33 | enableLogCallback(this.logCallback); 34 | enableStatisticsCallback(undefined); 35 | showPopup(this.popupReference, VIDSTAB_TEST_TOOLTIP_TEXT); 36 | } 37 | 38 | logCallback = (log) => { 39 | ffprint(log.message); 40 | } 41 | 42 | stabilizeVideo = () => { 43 | let image1Path = VideoUtil.assetPath(VideoUtil.ASSET_1); 44 | let image2Path = VideoUtil.assetPath(VideoUtil.ASSET_2); 45 | let image3Path = VideoUtil.assetPath(VideoUtil.ASSET_3); 46 | let shakeResultsFile = this.getShakeResultsFile(); 47 | let videoFile = this.getVideoFile(); 48 | let stabilizedVideoFile = this.getStabilizedVideoFile(); 49 | 50 | // IF VIDEO IS PLAYING STOP PLAYBACK 51 | this.pauseVideo(); 52 | this.pauseStabilizedVideo(); 53 | 54 | VideoUtil.deleteFile(shakeResultsFile); 55 | VideoUtil.deleteFile(videoFile); 56 | VideoUtil.deleteFile(stabilizedVideoFile); 57 | 58 | ffprint("Testing VID.STAB"); 59 | 60 | this.hideProgressDialog(); 61 | this.showCreateProgressDialog(); 62 | 63 | let ffmpegCommand = VideoUtil.generateShakingVideoScript(image1Path, image2Path, image3Path, videoFile); 64 | 65 | executeFFmpegAsync(ffmpegCommand, completedExecution => { 66 | ffprint( 67 | `FFmpeg process exited with rc ${completedExecution.returnCode}.`); 68 | 69 | if (completedExecution.returnCode === 0) { 70 | ffprint( 71 | "Create completed successfully; stabilizing video."); 72 | 73 | let analyzeVideoCommand = `-y -i ${videoFile} -vf vidstabdetect=shakiness=10:accuracy=15:result=${shakeResultsFile} -f null -`; 74 | 75 | this.showStabilizeProgressDialog(); 76 | 77 | executeFFmpegAsync(analyzeVideoCommand, secondExecution => { 78 | ffprint( 79 | `FFmpeg process exited with rc ${secondExecution.returnCode}.`); 80 | 81 | if (secondExecution.returnCode === 0) { 82 | 83 | let stabilizeVideoCommand = `-y -i ${videoFile} -vf vidstabtransform=smoothing=30:input=${shakeResultsFile} -c:v mpeg4 ${stabilizedVideoFile}`; 84 | 85 | executeFFmpegAsync(stabilizeVideoCommand, thirdExecution => { 86 | 87 | this.hideProgressDialog(); 88 | 89 | if (thirdExecution.returnCode === 0) { 90 | ffprint( 91 | "Stabilize video completed successfully; playing videos."); 92 | this.playVideo(); 93 | this.playStabilizedVideo(); 94 | } else { 95 | showPopup(this.popupReference, 96 | "Stabilize video failed. Please check log for the details."); 97 | ffprint( 98 | `Stabilize video failed with rc=${thirdExecution.returnCode}.`); 99 | } 100 | 101 | }).then(executionId => ffprint(`Async FFmpeg process started with arguments \'${stabilizeVideoCommand}\' and executionId ${executionId}.`)); 102 | } else { 103 | ffprint( 104 | `Stabilize video failed with rc=${secondExecution.returnCode}.`); 105 | this.hideProgressDialog(); 106 | showPopup(this.popupReference, 107 | "Stabilize video failed. Please check log for the details."); 108 | } 109 | }).then(executionId => ffprint(`Async FFmpeg process started with arguments \'${analyzeVideoCommand}\' and executionId ${executionId}.`)); 110 | } else { 111 | this.hideProgressDialog(); 112 | } 113 | } 114 | ).then(executionId => ffprint(`Async FFmpeg process started with arguments \'${ffmpegCommand}\' and executionId ${executionId}.`)); 115 | } 116 | 117 | playVideo() { 118 | let player = this.videoPlayer; 119 | if (player !== undefined) { 120 | player.seek(0); 121 | } 122 | this.setState({videoPaused: false}); 123 | } 124 | 125 | pauseVideo() { 126 | this.setState({videoPaused: true}); 127 | } 128 | 129 | playStabilizedVideo() { 130 | let player = this.stabilizedVideoPlayer; 131 | if (player !== undefined) { 132 | player.seek(0); 133 | } 134 | this.setState({stabilizedVideoPaused: false}); 135 | } 136 | 137 | pauseStabilizedVideo() { 138 | this.setState({stabilizedVideoPaused: true}); 139 | } 140 | 141 | getShakeResultsFile() { 142 | return `${RNFS.CachesDirectoryPath}/transforms.trf`; 143 | } 144 | 145 | getVideoFile() { 146 | return `${RNFS.CachesDirectoryPath}/video-shaking.mp4`; 147 | } 148 | 149 | getStabilizedVideoFile() { 150 | return `${RNFS.CachesDirectoryPath}/video-stabilized.mp4`; 151 | } 152 | 153 | showCreateProgressDialog() { 154 | this.progressModalReference.current.show(`Creating video`); 155 | } 156 | 157 | showStabilizeProgressDialog() { 158 | this.progressModalReference.current.update(`Stabilizing video`); 159 | } 160 | 161 | hideProgressDialog() { 162 | this.progressModalReference.current.hide(); 163 | } 164 | 165 | onPlayError = (err) => { 166 | ffprint('Play error: ' + JSON.stringify(err)); 167 | } 168 | 169 | render() { 170 | return ( 171 | 172 | 173 | 175 | ReactNativeFFmpegTest 176 | 177 | 178 | 209 | ); 210 | } 211 | 212 | } 213 | -------------------------------------------------------------------------------- /src/subtitle-tab.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {Text, TouchableOpacity, View} from 'react-native'; 3 | import RNFS from 'react-native-fs'; 4 | import VideoUtil from './video-util'; 5 | import { 6 | enableLogCallback, 7 | enableStatisticsCallback, 8 | executeFFmpegAsync, 9 | executeFFmpegCancelExecution, 10 | resetStatistics 11 | } from './react-native-ffmpeg-api-wrapper'; 12 | import {styles} from './style'; 13 | import {showPopup, Toast} from "./popup"; 14 | import {SUBTITLE_TEST_TOOLTIP_TEXT} from "./tooltip"; 15 | import {ProgressModal} from "./progress_modal"; 16 | import Video from 'react-native-video'; 17 | import {ffprint} from './util'; 18 | 19 | export default class SubtitleTab extends React.Component { 20 | constructor(props) { 21 | super(props); 22 | 23 | this.state = { 24 | state: 'IDLE', 25 | statistics: undefined, 26 | executionId: 0 27 | }; 28 | 29 | this.popupReference = React.createRef(); 30 | this.progressModalReference = React.createRef(); 31 | } 32 | 33 | componentDidMount() { 34 | this.props.navigation.addListener('focus', (_) => { 35 | this.pause(); 36 | this.setActive(); 37 | }); 38 | } 39 | 40 | setActive() { 41 | ffprint("Subtitle Tab Activated"); 42 | enableLogCallback(this.logCallback); 43 | enableStatisticsCallback(this.statisticsCallback); 44 | showPopup(this.popupReference, SUBTITLE_TEST_TOOLTIP_TEXT); 45 | } 46 | 47 | logCallback = (log) => { 48 | ffprint(log.message); 49 | } 50 | 51 | statisticsCallback = (statistics) => { 52 | this.setState({statistics: statistics}); 53 | this.updateProgressDialog(); 54 | } 55 | 56 | burnSubtitles = () => { 57 | let image1Path = VideoUtil.assetPath(VideoUtil.ASSET_1); 58 | let image2Path = VideoUtil.assetPath(VideoUtil.ASSET_2); 59 | let image3Path = VideoUtil.assetPath(VideoUtil.ASSET_3); 60 | let subtitlePath = VideoUtil.assetPath(VideoUtil.SUBTITLE_ASSET); 61 | let videoFile = this.getVideoFile(); 62 | let videoWithSubtitlesFile = this.getVideoWithSubtitlesFile(); 63 | 64 | // IF VIDEO IS PLAYING STOP PLAYBACK 65 | this.pause(); 66 | 67 | VideoUtil.deleteFile(videoFile); 68 | VideoUtil.deleteFile(videoWithSubtitlesFile); 69 | 70 | ffprint("Testing SUBTITLE burning"); 71 | 72 | this.hideProgressDialog(); 73 | this.showCreateProgressDialog(); 74 | 75 | let ffmpegCommand = VideoUtil.generateEncodeVideoScript(image1Path, image2Path, image3Path, videoFile, "mpeg4", ""); 76 | 77 | this.setState({state: 'CREATING'}); 78 | 79 | executeFFmpegAsync(ffmpegCommand, completedExecution => { 80 | ffprint( 81 | `FFmpeg process exited with rc ${completedExecution.returnCode}.`); 82 | 83 | if (completedExecution.returnCode === 0) { 84 | ffprint( 85 | "Create completed successfully; burning subtitles."); 86 | 87 | let burnSubtitlesCommand = 88 | `-y -i ${videoFile} -vf subtitles=${subtitlePath}:force_style='FontName=MyFontName' -c:v mpeg4 ${videoWithSubtitlesFile}`; 89 | 90 | this.showBurnProgressDialog(); 91 | 92 | ffprint( 93 | `FFmpeg process started with arguments\n\'${burnSubtitlesCommand}\'.`); 94 | 95 | this.setState({state: 'BURNING'}); 96 | 97 | executeFFmpegAsync(burnSubtitlesCommand, secondCompletedExecution => { 98 | ffprint( 99 | `FFmpeg process exited with rc ${secondCompletedExecution.returnCode}.`); 100 | this.hideProgressDialog(); 101 | 102 | if (secondCompletedExecution.returnCode === 0) { 103 | ffprint( 104 | "Burn subtitles completed successfully; playing video."); 105 | this.playVideo(); 106 | } else if (secondCompletedExecution.returnCode === 255) { 107 | showPopup(this.popupReference, "Burn subtitles operation cancelled."); 108 | ffprint("Burn subtitles operation cancelled"); 109 | } else { 110 | showPopup(this.popupReference, 111 | "Burn subtitles failed. Please check log for the details."); 112 | ffprint( 113 | `Burn subtitles failed with rc=${secondCompletedExecution.returnCode}.`); 114 | } 115 | }).then(executionId => { 116 | this.setState({executionId: executionId}); 117 | ffprint(`Async FFmpeg process started with arguments \'${burnSubtitlesCommand}\' and executionId ${executionId}.`); 118 | } 119 | ); 120 | } else { 121 | this.hideProgressDialog(); 122 | } 123 | } 124 | ).then(executionId => { 125 | this.setState({executionId: executionId}); 126 | ffprint(`Async FFmpeg process started with arguments \'${ffmpegCommand}\' and executionId ${executionId}.`); 127 | }); 128 | } 129 | 130 | playVideo() { 131 | let player = this.player; 132 | if (player !== undefined) { 133 | player.seek(0); 134 | } 135 | this.setState({paused: false}); 136 | } 137 | 138 | pause() { 139 | this.setState({paused: true}); 140 | } 141 | 142 | getVideoFile() { 143 | return `${RNFS.CachesDirectoryPath}/video.mp4`; 144 | } 145 | 146 | getVideoWithSubtitlesFile() { 147 | return `${RNFS.CachesDirectoryPath}/video-with-subtitles.mp4`; 148 | } 149 | 150 | showCreateProgressDialog() { 151 | // CLEAN STATISTICS 152 | this.setState({statistics: undefined}); 153 | resetStatistics(); 154 | this.progressModalReference.current.show(`Creating video`, () => executeFFmpegCancelExecution(this.state.executionId)); 155 | } 156 | 157 | showBurnProgressDialog() { 158 | // CLEAN STATISTICS 159 | this.setState({statistics: undefined}); 160 | resetStatistics(); 161 | this.progressModalReference.current.show(`Burning subtitles`, () => executeFFmpegCancelExecution(this.state.executionId)); 162 | } 163 | 164 | updateProgressDialog() { 165 | let statistics = this.state.statistics; 166 | if (statistics === undefined) { 167 | return; 168 | } 169 | 170 | let timeInMilliseconds = statistics.time; 171 | if (timeInMilliseconds > 0) { 172 | let totalVideoDuration = 9000; 173 | let completePercentage = Math.round((timeInMilliseconds * 100) / totalVideoDuration); 174 | 175 | if (this.state.state === 'CREATING') { 176 | this.progressModalReference.current.update(`Creating video % ${completePercentage}`); 177 | } else if (this.state.state === 'BURNING') { 178 | this.progressModalReference.current.update(`Burning subtitles % ${completePercentage}`); 179 | } 180 | } 181 | } 182 | 183 | hideProgressDialog() { 184 | this.progressModalReference.current.hide(); 185 | } 186 | 187 | onPlayError = (err) => { 188 | ffprint('Play error: ' + JSON.stringify(err)); 189 | } 190 | 191 | render() { 192 | return ( 193 | 194 | 195 | 197 | ReactNativeFFmpegTest 198 | 199 | 200 | 201 | 204 | BURN SUBTITLES 205 | 206 | 207 | 208 | 211 | 221 | ); 222 | } 223 | 224 | } 225 | -------------------------------------------------------------------------------- /src/video-tab.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {Text, TouchableOpacity, View} from 'react-native'; 3 | import RNFS from 'react-native-fs'; 4 | import VideoUtil from './video-util'; 5 | import { 6 | enableLogCallback, 7 | enableStatisticsCallback, 8 | executeFFmpegAsync, 9 | resetStatistics 10 | } from './react-native-ffmpeg-api-wrapper'; 11 | import {Picker} from '@react-native-picker/picker'; 12 | import {styles} from './style'; 13 | import {showPopup, Toast} from "./popup"; 14 | import {VIDEO_TEST_TOOLTIP_TEXT} from "./tooltip"; 15 | import {ProgressModal} from "./progress_modal"; 16 | import Video from 'react-native-video'; 17 | import {ffprint} from './util'; 18 | import Test from "./test-api"; 19 | 20 | export default class VideoTab extends React.Component { 21 | constructor(props) { 22 | super(props); 23 | 24 | this.state = { 25 | selectedCodec: 'mpeg4', 26 | statistics: undefined 27 | }; 28 | 29 | this.popupReference = React.createRef(); 30 | this.progressModalReference = React.createRef(); 31 | } 32 | 33 | componentDidMount() { 34 | this.props.navigation.addListener('focus', (_) => { 35 | this.pause(); 36 | this.setActive(); 37 | }); 38 | } 39 | 40 | setActive() { 41 | ffprint("Video Tab Activated"); 42 | enableLogCallback(this.logCallback); 43 | enableStatisticsCallback(this.statisticsCallback); 44 | showPopup(this.popupReference, VIDEO_TEST_TOOLTIP_TEXT); 45 | } 46 | 47 | logCallback = (log) => { 48 | ffprint(log.message); 49 | } 50 | 51 | statisticsCallback = (statistics) => { 52 | this.setState({statistics: statistics}); 53 | this.updateProgressDialog(); 54 | } 55 | 56 | encodeVideo = () => { 57 | ffprint("Testing post execution commands before starting the new encoding."); 58 | Test.testPostExecutionCommands(); 59 | 60 | let image1Path = VideoUtil.assetPath(VideoUtil.ASSET_1); 61 | let image2Path = VideoUtil.assetPath(VideoUtil.ASSET_2); 62 | let image3Path = VideoUtil.assetPath(VideoUtil.ASSET_3); 63 | let videoFile = this.getVideoFile(); 64 | 65 | // IF VIDEO IS PLAYING STOP PLAYBACK 66 | this.pause(); 67 | 68 | VideoUtil.deleteFile(videoFile); 69 | 70 | let videoCodec = this.getSelectedVideoCodec(); 71 | 72 | ffprint(`Testing VIDEO encoding with '${videoCodec}' codec`); 73 | 74 | this.hideProgressDialog(); 75 | this.showProgressDialog(); 76 | 77 | let ffmpegCommand = VideoUtil.generateEncodeVideoScript(image1Path, image2Path, image3Path, videoFile, videoCodec, this.getCustomOptions()); 78 | 79 | executeFFmpegAsync(ffmpegCommand, completedExecution => { 80 | this.hideProgressDialog(); 81 | if (completedExecution.returnCode === 0) { 82 | ffprint("Encode completed successfully; playing video."); 83 | this.playVideo(); 84 | } else { 85 | ffprint(`Encode failed with rc=${completedExecution.returnCode}.`); 86 | showPopup(this.popupReference, "Encode failed. Please check log for the details."); 87 | } 88 | } 89 | ).then(executionId => ffprint(`Async FFmpeg process started with arguments \'${ffmpegCommand}\' and executionId ${executionId}.`)); 90 | } 91 | 92 | playVideo() { 93 | let player = this.player; 94 | if (player !== undefined) { 95 | player.seek(0); 96 | } 97 | this.setState({paused: false}); 98 | } 99 | 100 | pause() { 101 | this.setState({paused: true}); 102 | } 103 | 104 | getSelectedVideoCodec() { 105 | let videoCodec = this.state.selectedCodec; 106 | 107 | // VIDEO CODEC MENU HAS BASIC NAMES, FFMPEG NEEDS LONGER LIBRARY NAMES. 108 | // APPLYING NECESSARY TRANSFORMATION HERE 109 | switch (videoCodec) { 110 | case "x264": 111 | videoCodec = "libx264"; 112 | break; 113 | case "openh264": 114 | videoCodec = "libopenh264"; 115 | break; 116 | case "x265": 117 | videoCodec = "libx265"; 118 | break; 119 | case "xvid": 120 | videoCodec = "libxvid"; 121 | break; 122 | case "vp8": 123 | videoCodec = "libvpx"; 124 | break; 125 | case "vp9": 126 | videoCodec = "libvpx-vp9"; 127 | break; 128 | case "aom": 129 | videoCodec = "libaom-av1"; 130 | break; 131 | case "kvazaar": 132 | videoCodec = "libkvazaar"; 133 | break; 134 | case "theora": 135 | videoCodec = "libtheora"; 136 | break; 137 | } 138 | 139 | return videoCodec; 140 | } 141 | 142 | getVideoFile() { 143 | let videoCodec = this.state.selectedCodec; 144 | 145 | let extension; 146 | switch (videoCodec) { 147 | case "vp8": 148 | case "vp9": 149 | extension = "webm"; 150 | break; 151 | case "aom": 152 | extension = "mkv"; 153 | break; 154 | case "theora": 155 | extension = "ogv"; 156 | break; 157 | case "hap": 158 | extension = "mov"; 159 | break; 160 | default: 161 | // mpeg4, x264, x265, xvid, kvazaar 162 | extension = "mp4"; 163 | break; 164 | } 165 | 166 | return `${RNFS.CachesDirectoryPath}/video.${extension}`; 167 | } 168 | 169 | getCustomOptions() { 170 | let videoCodec = this.state.selectedCodec; 171 | 172 | switch (videoCodec) { 173 | case "x265": 174 | return "-crf 28 -preset fast "; 175 | case "vp8": 176 | return "-b:v 1M -crf 10 "; 177 | case "vp9": 178 | return "-b:v 2M "; 179 | case "aom": 180 | return "-crf 30 -strict experimental "; 181 | case "theora": 182 | return "-qscale:v 7 "; 183 | case "hap": 184 | return "-format hap_q "; 185 | default: 186 | // kvazaar, mpeg4, x264, xvid 187 | return ""; 188 | } 189 | } 190 | 191 | showProgressDialog() { 192 | // CLEAN STATISTICS 193 | this.setState({statistics: undefined}); 194 | resetStatistics(); 195 | this.progressModalReference.current.show(`Encoding video`); 196 | } 197 | 198 | updateProgressDialog() { 199 | let statistics = this.state.statistics; 200 | if (statistics === undefined) { 201 | return; 202 | } 203 | 204 | let timeInMilliseconds = statistics.time; 205 | if (timeInMilliseconds > 0) { 206 | let totalVideoDuration = 9000; 207 | let completePercentage = Math.round((timeInMilliseconds * 100) / totalVideoDuration); 208 | this.progressModalReference.current.update(`Encoding video % ${completePercentage}`); 209 | } 210 | } 211 | 212 | hideProgressDialog() { 213 | this.progressModalReference.current.hide(); 214 | } 215 | 216 | onPlayError = (err) => { 217 | ffprint('Play error: ' + JSON.stringify(err)); 218 | } 219 | 220 | render() { 221 | return ( 222 | 223 | 224 | 226 | ReactNativeFFmpegTest 227 | 228 | 229 | 230 | 233 | this.setState({selectedCodec: itemValue}) 234 | }> 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 252 | CREATE 253 | 254 | 255 | 256 | 259 | 270 | ); 271 | } 272 | 273 | } 274 | -------------------------------------------------------------------------------- /src/video-util.js: -------------------------------------------------------------------------------- 1 | import {Platform} from 'react-native'; 2 | import RNFS from 'react-native-fs'; 3 | import {ffprint, today} from './util'; 4 | import { 5 | setEnvironmentVariable, 6 | setFontconfigConfigurationPath, 7 | setFontDirectory 8 | } from './react-native-ffmpeg-api-wrapper'; 9 | 10 | export default class VideoUtil { 11 | static get ASSET_1() { 12 | return "pyramid.jpg"; 13 | } 14 | 15 | static get ASSET_2() { 16 | return "colosseum.jpg"; 17 | } 18 | 19 | static get ASSET_3() { 20 | return "tajmahal.jpg"; 21 | } 22 | 23 | static get SUBTITLE_ASSET() { 24 | return "subtitle.srt"; 25 | } 26 | 27 | static get FONT_ASSET_1() { 28 | return "doppioone_regular.ttf"; 29 | } 30 | 31 | static get FONT_ASSET_2() { 32 | return "truenorg.otf"; 33 | } 34 | 35 | static async registerAppFont() { 36 | let fontNameMapping = new Map(); 37 | fontNameMapping["MyFontName"] = "Doppio One"; 38 | setFontDirectory(RNFS.CachesDirectoryPath, fontNameMapping); 39 | setFontconfigConfigurationPath(RNFS.CachesDirectoryPath); 40 | setEnvironmentVariable("FFREPORT", "file=" + 41 | RNFS.CachesDirectoryPath + "/" + today() + "-ffreport.txt"); 42 | } 43 | 44 | static async prepareAssets() { 45 | await VideoUtil.assetToFile(VideoUtil.ASSET_1); 46 | await VideoUtil.assetToFile(VideoUtil.ASSET_2); 47 | await VideoUtil.assetToFile(VideoUtil.ASSET_3); 48 | await VideoUtil.assetToFile(VideoUtil.SUBTITLE_ASSET); 49 | await VideoUtil.assetToFile(VideoUtil.FONT_ASSET_1); 50 | await VideoUtil.assetToFile(VideoUtil.FONT_ASSET_2); 51 | } 52 | 53 | static async assetToFile(assetName) { 54 | let fullTemporaryPath = VideoUtil.assetPath(assetName); 55 | 56 | if (Platform.OS === 'android') { 57 | await RNFS.copyFileAssets(assetName, fullTemporaryPath) 58 | .then(_ => ffprint(`Asset ${assetName} saved to file at ${fullTemporaryPath}.`)) 59 | .catch((err) => { 60 | ffprint(`Failed to save asset ${assetName} to file at ${fullTemporaryPath}, err message: ${err.message}, err code: ${err.code}`); 61 | }); 62 | } else { 63 | ffprint(`Asset ${assetName} loaded as file at ${fullTemporaryPath}.`); 64 | } 65 | 66 | return fullTemporaryPath; 67 | } 68 | 69 | static deleteFile(videoFile) { 70 | return RNFS.unlink(videoFile).catch(_ => _); 71 | } 72 | 73 | static assetPath(assetName) { 74 | if (Platform.OS === 'ios') { 75 | return VideoUtil.iosAssetPath(assetName); 76 | } else { 77 | return VideoUtil.androidAssetPath(assetName); 78 | } 79 | } 80 | 81 | static androidAssetPath(assetName) { 82 | return `${RNFS.CachesDirectoryPath}/${assetName}`; 83 | } 84 | 85 | static iosAssetPath(assetName) { 86 | return `${RNFS.MainBundlePath}/${assetName}`; 87 | } 88 | 89 | static generateEncodeVideoScript(image1Path, image2Path, image3Path, videoFilePath, videoCodec, customOptions) { 90 | return "-hide_banner -y -loop 1 -i '" + image1Path + "' " + 91 | "-loop 1 -i \"" + image2Path + "\" " + 92 | "-loop 1 -i \"" + image3Path + "\" " + 93 | "-filter_complex " + 94 | "\"[0:v]setpts=PTS-STARTPTS,scale=w=\'if(gte(iw/ih,640/427),min(iw,640),-1)\':h=\'if(gte(iw/ih,640/427),-1,min(ih,427))\',scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=sar=1/1,split=2[stream1out1][stream1out2];" + 95 | "[1:v]setpts=PTS-STARTPTS,scale=w=\'if(gte(iw/ih,640/427),min(iw,640),-1)\':h=\'if(gte(iw/ih,640/427),-1,min(ih,427))\',scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=sar=1/1,split=2[stream2out1][stream2out2];" + 96 | "[2:v]setpts=PTS-STARTPTS,scale=w=\'if(gte(iw/ih,640/427),min(iw,640),-1)\':h=\'if(gte(iw/ih,640/427),-1,min(ih,427))\',scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=sar=1/1,split=2[stream3out1][stream3out2];" + 97 | "[stream1out1]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=3,select=lte(n\\,90)[stream1overlaid];" + 98 | "[stream1out2]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=1,select=lte(n\\,30)[stream1ending];" + 99 | "[stream2out1]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=2,select=lte(n\\,60)[stream2overlaid];" + 100 | "[stream2out2]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=1,select=lte(n\\,30),split=2[stream2starting][stream2ending];" + 101 | "[stream3out1]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=2,select=lte(n\\,60)[stream3overlaid];" + 102 | "[stream3out2]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=1,select=lte(n\\,30)[stream3starting];" + 103 | "[stream2starting][stream1ending]blend=all_expr=\'if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)\':shortest=1[stream2blended];" + 104 | "[stream3starting][stream2ending]blend=all_expr=\'if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)\':shortest=1[stream3blended];" + 105 | "[stream1overlaid][stream2blended][stream2overlaid][stream3blended][stream3overlaid]concat=n=5:v=1:a=0,scale=w=640:h=424,format=yuv420p[video]\"" + 106 | " -map [video] -vsync 2 -async 1 " + customOptions + "-c:v " + videoCodec.toLowerCase() + " -r 30 " + videoFilePath + " "; 107 | } 108 | 109 | static generateShakingVideoScript(image1Path, image2Path, image3Path, videoFilePath) { 110 | return "-hide_banner -y -loop 1 -i \"" + 111 | image1Path + 112 | "\" " + 113 | "-loop 1 -i '" + 114 | image2Path + 115 | "' " + 116 | "-loop 1 -i " + 117 | image3Path + 118 | " " + 119 | "-f lavfi -i color=black:s=640x427 " + 120 | "-filter_complex \"" + 121 | "[0:v]setpts=PTS-STARTPTS,scale=w=\'if(gte(iw/ih,640/427),min(iw,640),-1)\':h=\'if(gte(iw/ih,640/427),-1,min(ih,427))\',scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=sar=1/1[stream1out];" + 122 | "[1:v]setpts=PTS-STARTPTS,scale=w=\'if(gte(iw/ih,640/427),min(iw,640),-1)\':h=\'if(gte(iw/ih,640/427),-1,min(ih,427))\',scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=sar=1/1[stream2out];" + 123 | "[2:v]setpts=PTS-STARTPTS,scale=w=\'if(gte(iw/ih,640/427),min(iw,640),-1)\':h=\'if(gte(iw/ih,640/427),-1,min(ih,427))\',scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=sar=1/1[stream3out];" + 124 | "[stream1out]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=3[stream1overlaid];" + 125 | "[stream2out]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=3[stream2overlaid];" + 126 | "[stream3out]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=3[stream3overlaid];" + 127 | "[3:v][stream1overlaid]overlay=x=\'2*mod(n,4)\':y=\'2*mod(n,2)\',trim=duration=3[stream1shaking];" + 128 | "[3:v][stream2overlaid]overlay=x=\'2*mod(n,4)\':y=\'2*mod(n,2)\',trim=duration=3[stream2shaking];" + 129 | "[3:v][stream3overlaid]overlay=x=\'2*mod(n,4)\':y=\'2*mod(n,2)\',trim=duration=3[stream3shaking];" + 130 | "[stream1shaking][stream2shaking][stream3shaking]concat=n=3:v=1:a=0,scale=w=640:h=424,format=yuv420p[video]\"" + 131 | " -map [video] -vsync 2 -async 1 -c:v mpeg4 -r 30 " + 132 | videoFilePath; 133 | } 134 | 135 | static generateCreateVideoWithPipesScript(image1Pipe, image2Pipe, image3Pipe, videoFilePath) { 136 | return "-hide_banner -y -i \"" + 137 | image1Pipe + 138 | "\" " + 139 | "-i '" + 140 | image2Pipe + 141 | "' " + 142 | "-i " + 143 | image3Pipe + 144 | " " + 145 | "-filter_complex \"" + 146 | "[0:v]loop=loop=-1:size=1:start=0,setpts=PTS-STARTPTS,scale=w=\'if(gte(iw/ih,640/427),min(iw,640),-1)\':h=\'if(gte(iw/ih,640/427),-1,min(ih,427))\',scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=sar=1/1,split=2[stream1out1][stream1out2];" + 147 | "[1:v]loop=loop=-1:size=1:start=0,setpts=PTS-STARTPTS,scale=w=\'if(gte(iw/ih,640/427),min(iw,640),-1)\':h=\'if(gte(iw/ih,640/427),-1,min(ih,427))\',scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=sar=1/1,split=2[stream2out1][stream2out2];" + 148 | "[2:v]loop=loop=-1:size=1:start=0,setpts=PTS-STARTPTS,scale=w=\'if(gte(iw/ih,640/427),min(iw,640),-1)\':h=\'if(gte(iw/ih,640/427),-1,min(ih,427))\',scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=sar=1/1,split=2[stream3out1][stream3out2];" + 149 | "[stream1out1]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=3,select=lte(n\\,90)[stream1overlaid];" + 150 | "[stream1out2]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=1,select=lte(n\\,30)[stream1ending];" + 151 | "[stream2out1]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=2,select=lte(n\\,60)[stream2overlaid];" + 152 | "[stream2out2]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=1,select=lte(n\\,30),split=2[stream2starting][stream2ending];" + 153 | "[stream3out1]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=2,select=lte(n\\,60)[stream3overlaid];" + 154 | "[stream3out2]pad=width=640:height=427:x=(640-iw)/2:y=(427-ih)/2:color=#00000000,trim=duration=1,select=lte(n\\,30)[stream3starting];" + 155 | "[stream2starting][stream1ending]blend=all_expr=\'if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)\':shortest=1[stream2blended];" + 156 | "[stream3starting][stream2ending]blend=all_expr=\'if(gte(X,(W/2)*T/1)*lte(X,W-(W/2)*T/1),B,A)\':shortest=1[stream3blended];" + 157 | "[stream1overlaid][stream2blended][stream2overlaid][stream3blended][stream3overlaid]concat=n=5:v=1:a=0,scale=w=640:h=424,format=yuv420p[video]\"" + 158 | " -map [video] -vsync 2 -async 1 -c:v mpeg4 -r 30 " + 159 | videoFilePath; 160 | } 161 | 162 | } 163 | -------------------------------------------------------------------------------- /src/https-tab.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {styles} from './style'; 3 | import {showPopup, Toast} from './popup'; 4 | import {enableLogCallback, enableStatisticsCallback, getMediaInformation} from './react-native-ffmpeg-api-wrapper'; 5 | import {ffprint} from './util'; 6 | import {HTTPS_TEST_TOOLTIP_TEXT} from "./tooltip"; 7 | import {ScrollView, Text, TextInput, TouchableOpacity, View} from 'react-native'; 8 | 9 | const HTTPS_TEST_DEFAULT_URL = "https://download.blender.org/peach/trailer/trailer_1080p.ogg"; 10 | 11 | export default class HttpsTab extends React.Component { 12 | 13 | constructor(props) { 14 | super(props); 15 | 16 | this.state = { 17 | urlText: '', 18 | outputText: '' 19 | }; 20 | 21 | this.popupReference = React.createRef(); 22 | } 23 | 24 | componentDidMount() { 25 | this.props.navigation.addListener('focus', (_) => { 26 | this.clearLog(); 27 | this.setActive(); 28 | }); 29 | } 30 | 31 | setActive() { 32 | ffprint("Https Tab Activated"); 33 | enableLogCallback(this.logCallback); 34 | enableStatisticsCallback(undefined); 35 | showPopup(this.popupReference, HTTPS_TEST_TOOLTIP_TEXT); 36 | } 37 | 38 | logCallback = (log) => { 39 | this.appendLog(log.message); 40 | }; 41 | 42 | appendLog(logMessage) { 43 | this.setState({outputText: this.state.outputText + logMessage}); 44 | }; 45 | 46 | clearLog() { 47 | this.setState({outputText: ''}); 48 | } 49 | 50 | runGetMediaInformation = () => { 51 | this.clearLog(); 52 | 53 | let testUrl = this.state.urlText; 54 | if (testUrl !== undefined && testUrl.trim().length > 0) { 55 | ffprint(`Testing HTTPS with url '${testUrl}'.`); 56 | } else { 57 | testUrl = HTTPS_TEST_DEFAULT_URL; 58 | this.setState({urlText: testUrl}); 59 | ffprint( 60 | `Testing HTTPS with default url '${testUrl}'.` 61 | ); 62 | } 63 | 64 | // HTTPS COMMAND ARGUMENTS 65 | getMediaInformation(testUrl).then((information) => { 66 | if (information.getMediaProperties() !== undefined) { 67 | ffprint("---"); 68 | if (information.getMediaProperties().filename !== undefined) { 69 | ffprint(`Path: ${information.getMediaProperties().filename}`); 70 | } 71 | if (information.getMediaProperties().format_name !== undefined) { 72 | ffprint(`Format: ${information.getMediaProperties().format_name}`); 73 | } 74 | if (information.getMediaProperties().bit_rate !== undefined) { 75 | ffprint(`Bitrate: ${information.getMediaProperties().bit_rate}`); 76 | } 77 | if (information.getMediaProperties().duration !== undefined) { 78 | ffprint(`Duration: ${information.getMediaProperties().duration}`); 79 | } 80 | if (information.getMediaProperties().start_time !== undefined) { 81 | ffprint(`Start time: ${information.getMediaProperties().start_time}`); 82 | } 83 | if (information.getMediaProperties().nb_streams !== undefined) { 84 | ffprint(`Number of streams: ${information.getMediaProperties().nb_streams.toString()}`); 85 | } 86 | let tags = information.getMediaProperties().tags; 87 | if (tags !== undefined) { 88 | Object.keys(tags).forEach((key) => { 89 | ffprint(`Tag: ${key}:${tags[key]}`); 90 | }); 91 | } 92 | 93 | let streams = information.getStreams(); 94 | if (streams !== undefined) { 95 | for (let i = 0; i < streams.length; ++i) { 96 | let stream = streams[i]; 97 | ffprint("---"); 98 | if (stream.getAllProperties().index !== undefined) { 99 | ffprint(`Stream index: ${stream.getAllProperties().index.toString()}`); 100 | } 101 | if (stream.getAllProperties().codec_type !== undefined) { 102 | ffprint(`Stream type: ${stream.getAllProperties().codec_type}`); 103 | } 104 | if (stream.getAllProperties().codec_name !== undefined) { 105 | ffprint(`Stream codec: ${stream.getAllProperties().codec_name}`); 106 | } 107 | if (stream.getAllProperties().codec_long_name !== undefined) { 108 | ffprint(`Stream full codec: ${stream.getAllProperties().codec_long_name}`); 109 | } 110 | if (stream.getAllProperties().pix_fmt !== undefined) { 111 | ffprint(`Stream format: ${stream.getAllProperties().pix_fmt}`); 112 | } 113 | if (stream.getAllProperties().width !== undefined) { 114 | ffprint(`Stream width: ${stream.getAllProperties().width.toString()}`); 115 | } 116 | if (stream.getAllProperties().height !== undefined) { 117 | ffprint(`Stream height: ${stream.getAllProperties().height.toString()}`); 118 | } 119 | if (stream.getAllProperties().bit_rate !== undefined) { 120 | ffprint(`Stream bitrate: ${stream.getAllProperties().bit_rate}`); 121 | } 122 | if (stream.getAllProperties().sample_rate !== undefined) { 123 | ffprint(`Stream sample rate: ${stream.getAllProperties().sample_rate}`); 124 | } 125 | if (stream.getAllProperties().sample_fmt !== undefined) { 126 | ffprint(`Stream sample format: ${stream.getAllProperties().sample_fmt}`); 127 | } 128 | if (stream.getAllProperties().channel_layout !== undefined) { 129 | ffprint(`Stream channel layout: ${stream.getAllProperties().channel_layout}`); 130 | } 131 | if (stream.getAllProperties().sample_aspect_ratio !== undefined) { 132 | ffprint(`Stream sample aspect ratio: ${stream.getAllProperties().sample_aspect_ratio}`); 133 | } 134 | if (stream.getAllProperties().display_aspect_ratio !== undefined) { 135 | ffprint(`Stream display aspect ratio: ${stream.getAllProperties().display_aspect_ratio}`); 136 | } 137 | if (stream.getAllProperties().avg_frame_rate !== undefined) { 138 | ffprint(`Stream average frame rate: ${stream.getAllProperties().avg_frame_rate}`); 139 | } 140 | if (stream.getAllProperties().r_frame_rate !== undefined) { 141 | ffprint(`Stream real frame rate: ${stream.getAllProperties().r_frame_rate}`); 142 | } 143 | if (stream.getAllProperties().time_base !== undefined) { 144 | ffprint(`Stream time base: ${stream.getAllProperties().time_base}`); 145 | } 146 | if (stream.getAllProperties().codec_time_base !== undefined) { 147 | ffprint(`Stream codec time base: ${stream.getAllProperties().codec_time_base}`); 148 | } 149 | let tags = stream.getAllProperties().tags; 150 | if (tags !== undefined) { 151 | Object.keys(tags).forEach((key) => { 152 | ffprint(`Stream tag: ${key}:${tags[key]}`); 153 | }); 154 | } 155 | } 156 | } 157 | } 158 | }); 159 | }; 160 | 161 | render() { 162 | return ( 163 | 164 | 165 | 166 | ReactNativeFFmpegTest 167 | 168 | 169 | 170 | this.setState({urlText})} 177 | value={this.state.urlText} 178 | /> 179 | 180 | 181 | 184 | GET INFO 185 | 186 | 187 | 188 | 189 | { 191 | this.scrollViewReference = view; 192 | }} 193 | onContentSizeChange={(width, height) => this.scrollViewReference.scrollTo({y: height})} 194 | style={styles.outputScrollViewStyle}> 195 | {this.state.outputText} 196 | 197 | 198 | 199 | ); 200 | }; 201 | 202 | } 203 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation 19 | * entryFile: "index.android.js", 20 | * 21 | * // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format 22 | * bundleCommand: "ram-bundle", 23 | * 24 | * // whether to bundle JS and assets in debug mode 25 | * bundleInDebug: false, 26 | * 27 | * // whether to bundle JS and assets in release mode 28 | * bundleInRelease: true, 29 | * 30 | * // whether to bundle JS and assets in another build variant (if configured). 31 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 32 | * // The configuration property can be in the following formats 33 | * // 'bundleIn${productFlavor}${buildType}' 34 | * // 'bundleIn${buildType}' 35 | * // bundleInFreeDebug: true, 36 | * // bundleInPaidRelease: true, 37 | * // bundleInBeta: true, 38 | * 39 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 40 | * // for example: to disable dev mode in the staging build type (if configured) 41 | * devDisabledInStaging: true, 42 | * // The configuration property can be in the following formats 43 | * // 'devDisabledIn${productFlavor}${buildType}' 44 | * // 'devDisabledIn${buildType}' 45 | * 46 | * // the root of your project, i.e. where "package.json" lives 47 | * root: "../../", 48 | * 49 | * // where to put the JS bundle asset in debug mode 50 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 51 | * 52 | * // where to put the JS bundle asset in release mode 53 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 54 | * 55 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 56 | * // require('./image.png')), in debug mode 57 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 58 | * 59 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 60 | * // require('./image.png')), in release mode 61 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 62 | * 63 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 64 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 65 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 66 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 67 | * // for example, you might want to remove it from here. 68 | * inputExcludes: ["android/**", "ios/**"], 69 | * 70 | * // override which node gets called and with what additional arguments 71 | * nodeExecutableAndArgs: ["node"], 72 | * 73 | * // supply additional arguments to the packager 74 | * extraPackagerArgs: [] 75 | * ] 76 | */ 77 | 78 | project.ext.react = [ 79 | entryFile : "index.js", 80 | enableHermes: false, // clean and rebuild if changing 81 | ] 82 | 83 | apply from: "../../node_modules/react-native/react.gradle" 84 | 85 | /** 86 | * Set this to true to create two separate APKs instead of one: 87 | * - An APK that only works on ARM devices 88 | * - An APK that only works on x86 devices 89 | * The advantage is the size of the APK is reduced by about 4MB. 90 | * Upload all the APKs to the Play Store and people will download 91 | * the correct one based on the CPU architecture of their device. 92 | */ 93 | def enableSeparateBuildPerCPUArchitecture = false 94 | 95 | /** 96 | * Run Proguard to shrink the Java bytecode in release builds. 97 | */ 98 | def enableProguardInReleaseBuilds = true 99 | 100 | /** 101 | * The preferred build flavor of JavaScriptCore. 102 | * 103 | * For example, to use the international variant, you can use: 104 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 105 | * 106 | * The international variant includes ICU i18n library and necessary data 107 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 108 | * give correct results when using with locales other than en-US. Note that 109 | * this variant is about 6MiB larger per architecture than default. 110 | */ 111 | def jscFlavor = 'org.webkit:android-jsc:+' 112 | 113 | /** 114 | * Whether to enable the Hermes VM. 115 | * 116 | * This should be set on project.ext.react and mirrored here. If it is not set 117 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 118 | * and the benefits of using Hermes will therefore be sharply reduced. 119 | */ 120 | def enableHermes = project.ext.react.get("enableHermes", false); 121 | 122 | android { 123 | compileSdkVersion rootProject.ext.compileSdkVersion 124 | ndkVersion "21.4.7075529" 125 | 126 | compileOptions { 127 | sourceCompatibility JavaVersion.VERSION_1_8 128 | targetCompatibility JavaVersion.VERSION_1_8 129 | } 130 | 131 | defaultConfig { 132 | applicationId "com.arthenica.reactnative.ffmpeg.test" 133 | minSdkVersion rootProject.ext.minSdkVersion 134 | targetSdkVersion rootProject.ext.targetSdkVersion 135 | versionCode 1 136 | versionName "1.0" 137 | ndk { 138 | abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" 139 | } 140 | } 141 | signingConfigs { 142 | localConfig { 143 | keyAlias 'androiddebugkey' 144 | storeFile file('/home/taner/.android/debug.keystore') 145 | storePassword 'android' 146 | keyPassword 'android' 147 | } 148 | } 149 | splits { 150 | abi { 151 | reset() 152 | enable enableSeparateBuildPerCPUArchitecture 153 | universalApk false // If true, also generate a universal APK 154 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" 155 | } 156 | } 157 | signingConfigs { 158 | debug { 159 | storeFile file('debug.keystore') 160 | storePassword 'android' 161 | keyAlias 'androiddebugkey' 162 | keyPassword 'android' 163 | } 164 | } 165 | buildTypes { 166 | debug { 167 | signingConfig signingConfigs.debug 168 | } 169 | release { 170 | // Caution! In production, you need to generate your own keystore file. 171 | // see https://facebook.github.io/react-native/docs/signed-apk-android. 172 | signingConfig signingConfigs.debug 173 | minifyEnabled enableProguardInReleaseBuilds 174 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 175 | } 176 | } 177 | // applicationVariants are e.g. debug, release 178 | applicationVariants.all { variant -> 179 | variant.outputs.each { output -> 180 | // For each separate APK per architecture, set a unique version code as described here: 181 | // https://developer.android.com/studio/build/configure-apk-splits.html 182 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] 183 | def abi = output.getFilter(OutputFile.ABI) 184 | if (abi != null) { // null for the universal-debug, universal-release variants 185 | output.versionCodeOverride = 186 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 187 | } 188 | 189 | } 190 | } 191 | 192 | packagingOptions { 193 | pickFirst '**/armeabi-v7a/libc++_shared.so' 194 | pickFirst '**/x86/libc++_shared.so' 195 | pickFirst '**/arm64-v8a/libc++_shared.so' 196 | pickFirst '**/x86_64/libc++_shared.so' 197 | pickFirst '**/x86/libjsc.so' 198 | pickFirst '**/armeabi-v7a/libjsc.so' 199 | } 200 | } 201 | 202 | dependencies { 203 | implementation fileTree(dir: "libs", include: ["*.jar"]) 204 | implementation "com.facebook.react:react-native:+" // From node_modules 205 | 206 | if (enableHermes) { 207 | def hermesPath = "../../node_modules/hermesvm/android/"; 208 | debugImplementation files(hermesPath + "hermes-debug.aar") 209 | releaseImplementation files(hermesPath + "hermes-release.aar") 210 | } else { 211 | implementation jscFlavor 212 | } 213 | } 214 | 215 | // Run this once to be able to run the application with BUCK 216 | // puts all compile dependencies into folder libs for BUCK to use 217 | task copyDownloadableDepsToLibs(type: Copy) { 218 | from configurations.compile 219 | into 'libs' 220 | } 221 | 222 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) 223 | 224 | // react-native-0.60.x workaround for react-native-gesture-handler and react-native-gesture-fs 225 | preBuild.doFirst { 226 | ant.replaceregexp(match: 'android.support.v4.util.Pools;', replace: 'androidx.core.util.Pools;', flags: 'g', byline: true) { 227 | fileset(dir: '../../node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/', includes: '*.java') 228 | } 229 | ant.replaceregexp(match: 'import android.support.annotation.Nullable;', replace: '', flags: 'g', byline: true) { 230 | fileset(dir: '../../node_modules/react-native-fs/android/src/main/java/com/rnfs/', includes: '*.java') 231 | } 232 | ant.replaceregexp(match: '@Nullable', replace: '', flags: 'g', byline: true) { 233 | fileset(dir: '../../node_modules/react-native-fs/android/src/main/java/com/rnfs/', includes: '*.java') 234 | } 235 | } 236 | -------------------------------------------------------------------------------- /src/audio-tab.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {ScrollView, Text, TouchableOpacity, View} from 'react-native'; 3 | import RNFS from 'react-native-fs'; 4 | import { 5 | enableLogCallback, 6 | enableStatisticsCallback, 7 | executeFFmpeg, 8 | executeFFmpegAsync 9 | } from './react-native-ffmpeg-api-wrapper'; 10 | import {Picker} from '@react-native-picker/picker'; 11 | import {styles} from './style'; 12 | import {showPopup, Toast} from "./popup"; 13 | import {AUDIO_TEST_TOOLTIP_TEXT} from "./tooltip"; 14 | import {ProgressModal} from "./progress_modal"; 15 | import {ffprint} from './util'; 16 | import Test from "./test-api"; 17 | import VideoUtil from "./video-util"; 18 | 19 | export default class AudioTab extends React.Component { 20 | constructor(props) { 21 | super(props); 22 | 23 | this.state = { 24 | selectedCodec: 'mp2 (twolame)', 25 | outputText: '' 26 | }; 27 | 28 | this.popupReference = React.createRef(); 29 | this.progressModalReference = React.createRef(); 30 | } 31 | 32 | componentDidMount() { 33 | this.props.navigation.addListener('focus', (_) => { 34 | this.clearLog(); 35 | this.setActive(); 36 | }); 37 | } 38 | 39 | setActive() { 40 | ffprint("Audio Tab Activated"); 41 | enableLogCallback(undefined); 42 | this.createAudioSample(); 43 | enableStatisticsCallback(undefined); 44 | showPopup(this.popupReference, AUDIO_TEST_TOOLTIP_TEXT); 45 | } 46 | 47 | logCallback = (log) => { 48 | this.appendLog(log.message); 49 | }; 50 | 51 | appendLog(logMessage) { 52 | this.setState({outputText: this.state.outputText + logMessage}); 53 | }; 54 | 55 | clearLog() { 56 | this.setState({outputText: ''}); 57 | } 58 | 59 | encodeAudio = () => { 60 | let audioOutputFile = this.getAudioOutputFile(); 61 | 62 | VideoUtil.deleteFile(audioOutputFile); 63 | 64 | let audioCodec = this.state.selectedCodec; 65 | 66 | ffprint(`Testing AUDIO encoding with '${audioCodec}' codec`); 67 | 68 | let ffmpegCommand = this.generateAudioEncodeScript(); 69 | 70 | this.hideProgressDialog(); 71 | this.showProgressDialog(); 72 | 73 | this.clearLog(); 74 | 75 | executeFFmpegAsync(ffmpegCommand, completedExecution => { 76 | this.hideProgressDialog(); 77 | if (completedExecution.returnCode === 0) { 78 | showPopup(this.popupReference, "Encode completed successfully."); 79 | ffprint("Encode completed successfully."); 80 | } else { 81 | showPopup(this.popupReference, "Encode failed. Please check log for the details."); 82 | ffprint(`Encode failed with rc=${completedExecution.returnCode}.`); 83 | } 84 | 85 | ffprint("Testing post execution commands."); 86 | Test.testPostExecutionCommands(); 87 | } 88 | ).then(executionId => ffprint(`Async FFmpeg process started with arguments \'${ffmpegCommand}\' and executionId ${executionId}.`)); 89 | } 90 | 91 | createAudioSample() { 92 | let audioSampleFile = this.getAudioSampleFile(); 93 | 94 | ffprint("Creating AUDIO sample before the test."); 95 | 96 | VideoUtil.deleteFile(audioSampleFile); 97 | 98 | let ffmpegCommand = `-hide_banner -y -f lavfi -i sine=frequency=1000:duration=5 -c:a pcm_s16le ${audioSampleFile}`; 99 | 100 | ffprint(`Creating audio sample with '${ffmpegCommand}'.`); 101 | 102 | executeFFmpeg(ffmpegCommand).then((result) => { 103 | if (result === 0) { 104 | ffprint("AUDIO sample created"); 105 | } else { 106 | ffprint(`Creating AUDIO sample failed with rc=${result}.`); 107 | showPopup(this.popupReference, "Creating AUDIO sample failed. Please check log for the details."); 108 | } 109 | enableLogCallback(this.logCallback); 110 | } 111 | ); 112 | } 113 | 114 | getAudioOutputFile() { 115 | let audioCodec = this.state.selectedCodec; 116 | 117 | let extension; 118 | switch (audioCodec) { 119 | case "mp2 (twolame)": 120 | extension = "mpg"; 121 | break; 122 | case "mp3 (liblame)": 123 | case "mp3 (libshine)": 124 | extension = "mp3"; 125 | break; 126 | case "vorbis": 127 | extension = "ogg"; 128 | break; 129 | case "opus": 130 | extension = "opus"; 131 | break; 132 | case "amr-nb": 133 | extension = "amr"; 134 | break; 135 | case "amr-wb": 136 | extension = "amr"; 137 | break; 138 | case "ilbc": 139 | extension = "lbc"; 140 | break; 141 | case "speex": 142 | extension = "spx"; 143 | break; 144 | case "wavpack": 145 | extension = "wv"; 146 | break; 147 | default: 148 | // soxr 149 | extension = "wav"; 150 | break; 151 | } 152 | 153 | return `${RNFS.CachesDirectoryPath}/audio.${extension}`; 154 | } 155 | 156 | getAudioSampleFile() { 157 | return `${RNFS.CachesDirectoryPath}/audio-sample.wav`; 158 | } 159 | 160 | showProgressDialog() { 161 | this.progressModalReference.current.show(`Encoding video`); 162 | } 163 | 164 | hideProgressDialog() { 165 | this.progressModalReference.current.hide(); 166 | } 167 | 168 | generateAudioEncodeScript() { 169 | let audioCodec = this.state.selectedCodec; 170 | let audioSampleFile = this.getAudioSampleFile(); 171 | let audioOutputFile = this.getAudioOutputFile(); 172 | 173 | switch (audioCodec) { 174 | case "mp2 (twolame)": 175 | return `-hide_banner -y -i ${audioSampleFile} -c:a mp2 -b:a 192k ${audioOutputFile}`; 176 | case "mp3 (liblame)": 177 | return `-hide_banner -y -i ${audioSampleFile} -c:a libmp3lame -qscale:a 2 ${audioOutputFile}`; 178 | case "mp3 (libshine)": 179 | return `-hide_banner -y -i ${audioSampleFile} -c:a libshine -qscale:a 2 ${audioOutputFile}`; 180 | case "vorbis": 181 | return `-hide_banner -y -i ${audioSampleFile} -c:a libvorbis -b:a 64k ${audioOutputFile}`; 182 | case "opus": 183 | return `-hide_banner -y -i ${audioSampleFile} -c:a libopus -b:a 64k -vbr on -compression_level 10 ${audioOutputFile}`; 184 | case "amr-nb": 185 | return `-hide_banner -y -i ${audioSampleFile} -ar 8000 -ab 12.2k -c:a libopencore_amrnb ${audioOutputFile}`; 186 | case "amr-wb": 187 | return `-hide_banner -y -i ${audioSampleFile} -ar 8000 -ab 12.2k -c:a libvo_amrwbenc -strict experimental ${audioOutputFile}`; 188 | case "ilbc": 189 | return `-hide_banner -y -i ${audioSampleFile} -c:a ilbc -ar 8000 -b:a 15200 ${audioOutputFile}`; 190 | case "speex": 191 | return `-hide_banner -y -i ${audioSampleFile} -c:a libspeex -ar 16000 ${audioOutputFile}`; 192 | case "wavpack": 193 | return `-hide_banner -y -i ${audioSampleFile} -c:a wavpack -b:a 64k ${audioOutputFile}`; 194 | default: 195 | // soxr 196 | return `-hide_banner -y -i ${audioSampleFile} -af aresample=resampler=soxr -ar 44100 ${audioOutputFile}`; 197 | } 198 | } 199 | 200 | render() { 201 | return ( 202 | 203 | 204 | 206 | ReactNativeFFmpegTest 207 | 208 | 209 | 210 | 213 | this.setState({selectedCodec: itemValue}) 214 | }> 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 232 | CREATE 233 | 234 | 235 | 236 | 239 | 240 | { 242 | this.scrollViewReference = view; 243 | }} 244 | onContentSizeChange={(width, height) => this.scrollViewReference.scrollTo({y: height})} 245 | style={styles.outputScrollViewStyle}> 246 | {this.state.outputText} 247 | 248 | 249 | 250 | ); 251 | } 252 | 253 | } 254 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - boost-for-react-native (1.63.0) 3 | - CocoaAsyncSocket (7.6.5) 4 | - DoubleConversion (1.1.6) 5 | - FBLazyVector (0.65.1) 6 | - FBReactNativeSpec (0.65.1): 7 | - RCT-Folly (= 2021.04.26.00) 8 | - RCTRequired (= 0.65.1) 9 | - RCTTypeSafety (= 0.65.1) 10 | - React-Core (= 0.65.1) 11 | - React-jsi (= 0.65.1) 12 | - ReactCommon/turbomodule/core (= 0.65.1) 13 | - Flipper (0.93.0): 14 | - Flipper-Folly (~> 2.6) 15 | - Flipper-RSocket (~> 1.4) 16 | - Flipper-Boost-iOSX (1.76.0.1.11) 17 | - Flipper-DoubleConversion (3.1.7) 18 | - Flipper-Fmt (7.1.7) 19 | - Flipper-Folly (2.6.7): 20 | - Flipper-Boost-iOSX 21 | - Flipper-DoubleConversion 22 | - Flipper-Fmt (= 7.1.7) 23 | - Flipper-Glog 24 | - libevent (~> 2.1.12) 25 | - OpenSSL-Universal (= 1.1.180) 26 | - Flipper-Glog (0.3.6) 27 | - Flipper-PeerTalk (0.0.4) 28 | - Flipper-RSocket (1.4.3): 29 | - Flipper-Folly (~> 2.6) 30 | - FlipperKit (0.93.0): 31 | - FlipperKit/Core (= 0.93.0) 32 | - FlipperKit/Core (0.93.0): 33 | - Flipper (~> 0.93.0) 34 | - FlipperKit/CppBridge 35 | - FlipperKit/FBCxxFollyDynamicConvert 36 | - FlipperKit/FBDefines 37 | - FlipperKit/FKPortForwarding 38 | - FlipperKit/CppBridge (0.93.0): 39 | - Flipper (~> 0.93.0) 40 | - FlipperKit/FBCxxFollyDynamicConvert (0.93.0): 41 | - Flipper-Folly (~> 2.6) 42 | - FlipperKit/FBDefines (0.93.0) 43 | - FlipperKit/FKPortForwarding (0.93.0): 44 | - CocoaAsyncSocket (~> 7.6) 45 | - Flipper-PeerTalk (~> 0.0.4) 46 | - FlipperKit/FlipperKitHighlightOverlay (0.93.0) 47 | - FlipperKit/FlipperKitLayoutHelpers (0.93.0): 48 | - FlipperKit/Core 49 | - FlipperKit/FlipperKitHighlightOverlay 50 | - FlipperKit/FlipperKitLayoutTextSearchable 51 | - FlipperKit/FlipperKitLayoutIOSDescriptors (0.93.0): 52 | - FlipperKit/Core 53 | - FlipperKit/FlipperKitHighlightOverlay 54 | - FlipperKit/FlipperKitLayoutHelpers 55 | - YogaKit (~> 1.18) 56 | - FlipperKit/FlipperKitLayoutPlugin (0.93.0): 57 | - FlipperKit/Core 58 | - FlipperKit/FlipperKitHighlightOverlay 59 | - FlipperKit/FlipperKitLayoutHelpers 60 | - FlipperKit/FlipperKitLayoutIOSDescriptors 61 | - FlipperKit/FlipperKitLayoutTextSearchable 62 | - YogaKit (~> 1.18) 63 | - FlipperKit/FlipperKitLayoutTextSearchable (0.93.0) 64 | - FlipperKit/FlipperKitNetworkPlugin (0.93.0): 65 | - FlipperKit/Core 66 | - FlipperKit/FlipperKitReactPlugin (0.93.0): 67 | - FlipperKit/Core 68 | - FlipperKit/FlipperKitUserDefaultsPlugin (0.93.0): 69 | - FlipperKit/Core 70 | - FlipperKit/SKIOSNetworkPlugin (0.93.0): 71 | - FlipperKit/Core 72 | - FlipperKit/FlipperKitNetworkPlugin 73 | - fmt (6.2.1) 74 | - glog (0.3.5) 75 | - libevent (2.1.12) 76 | - mobile-ffmpeg-full (4.4) 77 | - OpenSSL-Universal (1.1.180) 78 | - RCT-Folly (2021.04.26.00): 79 | - boost-for-react-native 80 | - DoubleConversion 81 | - fmt (~> 6.2.1) 82 | - glog 83 | - RCT-Folly/Default (= 2021.04.26.00) 84 | - RCT-Folly/Default (2021.04.26.00): 85 | - boost-for-react-native 86 | - DoubleConversion 87 | - fmt (~> 6.2.1) 88 | - glog 89 | - RCTRequired (0.65.1) 90 | - RCTTypeSafety (0.65.1): 91 | - FBLazyVector (= 0.65.1) 92 | - RCT-Folly (= 2021.04.26.00) 93 | - RCTRequired (= 0.65.1) 94 | - React-Core (= 0.65.1) 95 | - React (0.65.1): 96 | - React-Core (= 0.65.1) 97 | - React-Core/DevSupport (= 0.65.1) 98 | - React-Core/RCTWebSocket (= 0.65.1) 99 | - React-RCTActionSheet (= 0.65.1) 100 | - React-RCTAnimation (= 0.65.1) 101 | - React-RCTBlob (= 0.65.1) 102 | - React-RCTImage (= 0.65.1) 103 | - React-RCTLinking (= 0.65.1) 104 | - React-RCTNetwork (= 0.65.1) 105 | - React-RCTSettings (= 0.65.1) 106 | - React-RCTText (= 0.65.1) 107 | - React-RCTVibration (= 0.65.1) 108 | - React-callinvoker (0.65.1) 109 | - React-Core (0.65.1): 110 | - glog 111 | - RCT-Folly (= 2021.04.26.00) 112 | - React-Core/Default (= 0.65.1) 113 | - React-cxxreact (= 0.65.1) 114 | - React-jsi (= 0.65.1) 115 | - React-jsiexecutor (= 0.65.1) 116 | - React-perflogger (= 0.65.1) 117 | - Yoga 118 | - React-Core/CoreModulesHeaders (0.65.1): 119 | - glog 120 | - RCT-Folly (= 2021.04.26.00) 121 | - React-Core/Default 122 | - React-cxxreact (= 0.65.1) 123 | - React-jsi (= 0.65.1) 124 | - React-jsiexecutor (= 0.65.1) 125 | - React-perflogger (= 0.65.1) 126 | - Yoga 127 | - React-Core/Default (0.65.1): 128 | - glog 129 | - RCT-Folly (= 2021.04.26.00) 130 | - React-cxxreact (= 0.65.1) 131 | - React-jsi (= 0.65.1) 132 | - React-jsiexecutor (= 0.65.1) 133 | - React-perflogger (= 0.65.1) 134 | - Yoga 135 | - React-Core/DevSupport (0.65.1): 136 | - glog 137 | - RCT-Folly (= 2021.04.26.00) 138 | - React-Core/Default (= 0.65.1) 139 | - React-Core/RCTWebSocket (= 0.65.1) 140 | - React-cxxreact (= 0.65.1) 141 | - React-jsi (= 0.65.1) 142 | - React-jsiexecutor (= 0.65.1) 143 | - React-jsinspector (= 0.65.1) 144 | - React-perflogger (= 0.65.1) 145 | - Yoga 146 | - React-Core/RCTActionSheetHeaders (0.65.1): 147 | - glog 148 | - RCT-Folly (= 2021.04.26.00) 149 | - React-Core/Default 150 | - React-cxxreact (= 0.65.1) 151 | - React-jsi (= 0.65.1) 152 | - React-jsiexecutor (= 0.65.1) 153 | - React-perflogger (= 0.65.1) 154 | - Yoga 155 | - React-Core/RCTAnimationHeaders (0.65.1): 156 | - glog 157 | - RCT-Folly (= 2021.04.26.00) 158 | - React-Core/Default 159 | - React-cxxreact (= 0.65.1) 160 | - React-jsi (= 0.65.1) 161 | - React-jsiexecutor (= 0.65.1) 162 | - React-perflogger (= 0.65.1) 163 | - Yoga 164 | - React-Core/RCTBlobHeaders (0.65.1): 165 | - glog 166 | - RCT-Folly (= 2021.04.26.00) 167 | - React-Core/Default 168 | - React-cxxreact (= 0.65.1) 169 | - React-jsi (= 0.65.1) 170 | - React-jsiexecutor (= 0.65.1) 171 | - React-perflogger (= 0.65.1) 172 | - Yoga 173 | - React-Core/RCTImageHeaders (0.65.1): 174 | - glog 175 | - RCT-Folly (= 2021.04.26.00) 176 | - React-Core/Default 177 | - React-cxxreact (= 0.65.1) 178 | - React-jsi (= 0.65.1) 179 | - React-jsiexecutor (= 0.65.1) 180 | - React-perflogger (= 0.65.1) 181 | - Yoga 182 | - React-Core/RCTLinkingHeaders (0.65.1): 183 | - glog 184 | - RCT-Folly (= 2021.04.26.00) 185 | - React-Core/Default 186 | - React-cxxreact (= 0.65.1) 187 | - React-jsi (= 0.65.1) 188 | - React-jsiexecutor (= 0.65.1) 189 | - React-perflogger (= 0.65.1) 190 | - Yoga 191 | - React-Core/RCTNetworkHeaders (0.65.1): 192 | - glog 193 | - RCT-Folly (= 2021.04.26.00) 194 | - React-Core/Default 195 | - React-cxxreact (= 0.65.1) 196 | - React-jsi (= 0.65.1) 197 | - React-jsiexecutor (= 0.65.1) 198 | - React-perflogger (= 0.65.1) 199 | - Yoga 200 | - React-Core/RCTSettingsHeaders (0.65.1): 201 | - glog 202 | - RCT-Folly (= 2021.04.26.00) 203 | - React-Core/Default 204 | - React-cxxreact (= 0.65.1) 205 | - React-jsi (= 0.65.1) 206 | - React-jsiexecutor (= 0.65.1) 207 | - React-perflogger (= 0.65.1) 208 | - Yoga 209 | - React-Core/RCTTextHeaders (0.65.1): 210 | - glog 211 | - RCT-Folly (= 2021.04.26.00) 212 | - React-Core/Default 213 | - React-cxxreact (= 0.65.1) 214 | - React-jsi (= 0.65.1) 215 | - React-jsiexecutor (= 0.65.1) 216 | - React-perflogger (= 0.65.1) 217 | - Yoga 218 | - React-Core/RCTVibrationHeaders (0.65.1): 219 | - glog 220 | - RCT-Folly (= 2021.04.26.00) 221 | - React-Core/Default 222 | - React-cxxreact (= 0.65.1) 223 | - React-jsi (= 0.65.1) 224 | - React-jsiexecutor (= 0.65.1) 225 | - React-perflogger (= 0.65.1) 226 | - Yoga 227 | - React-Core/RCTWebSocket (0.65.1): 228 | - glog 229 | - RCT-Folly (= 2021.04.26.00) 230 | - React-Core/Default (= 0.65.1) 231 | - React-cxxreact (= 0.65.1) 232 | - React-jsi (= 0.65.1) 233 | - React-jsiexecutor (= 0.65.1) 234 | - React-perflogger (= 0.65.1) 235 | - Yoga 236 | - React-CoreModules (0.65.1): 237 | - FBReactNativeSpec (= 0.65.1) 238 | - RCT-Folly (= 2021.04.26.00) 239 | - RCTTypeSafety (= 0.65.1) 240 | - React-Core/CoreModulesHeaders (= 0.65.1) 241 | - React-jsi (= 0.65.1) 242 | - React-RCTImage (= 0.65.1) 243 | - ReactCommon/turbomodule/core (= 0.65.1) 244 | - React-cxxreact (0.65.1): 245 | - boost-for-react-native (= 1.63.0) 246 | - DoubleConversion 247 | - glog 248 | - RCT-Folly (= 2021.04.26.00) 249 | - React-callinvoker (= 0.65.1) 250 | - React-jsi (= 0.65.1) 251 | - React-jsinspector (= 0.65.1) 252 | - React-perflogger (= 0.65.1) 253 | - React-runtimeexecutor (= 0.65.1) 254 | - React-jsi (0.65.1): 255 | - boost-for-react-native (= 1.63.0) 256 | - DoubleConversion 257 | - glog 258 | - RCT-Folly (= 2021.04.26.00) 259 | - React-jsi/Default (= 0.65.1) 260 | - React-jsi/Default (0.65.1): 261 | - boost-for-react-native (= 1.63.0) 262 | - DoubleConversion 263 | - glog 264 | - RCT-Folly (= 2021.04.26.00) 265 | - React-jsiexecutor (0.65.1): 266 | - DoubleConversion 267 | - glog 268 | - RCT-Folly (= 2021.04.26.00) 269 | - React-cxxreact (= 0.65.1) 270 | - React-jsi (= 0.65.1) 271 | - React-perflogger (= 0.65.1) 272 | - React-jsinspector (0.65.1) 273 | - react-native-ffmpeg/full (0.5.2): 274 | - mobile-ffmpeg-full (= 4.4) 275 | - React 276 | - react-native-video (5.1.1): 277 | - React-Core 278 | - react-native-video/Video (= 5.1.1) 279 | - react-native-video/Video (5.1.1): 280 | - React-Core 281 | - React-perflogger (0.65.1) 282 | - React-RCTActionSheet (0.65.1): 283 | - React-Core/RCTActionSheetHeaders (= 0.65.1) 284 | - React-RCTAnimation (0.65.1): 285 | - FBReactNativeSpec (= 0.65.1) 286 | - RCT-Folly (= 2021.04.26.00) 287 | - RCTTypeSafety (= 0.65.1) 288 | - React-Core/RCTAnimationHeaders (= 0.65.1) 289 | - React-jsi (= 0.65.1) 290 | - ReactCommon/turbomodule/core (= 0.65.1) 291 | - React-RCTBlob (0.65.1): 292 | - FBReactNativeSpec (= 0.65.1) 293 | - RCT-Folly (= 2021.04.26.00) 294 | - React-Core/RCTBlobHeaders (= 0.65.1) 295 | - React-Core/RCTWebSocket (= 0.65.1) 296 | - React-jsi (= 0.65.1) 297 | - React-RCTNetwork (= 0.65.1) 298 | - ReactCommon/turbomodule/core (= 0.65.1) 299 | - React-RCTImage (0.65.1): 300 | - FBReactNativeSpec (= 0.65.1) 301 | - RCT-Folly (= 2021.04.26.00) 302 | - RCTTypeSafety (= 0.65.1) 303 | - React-Core/RCTImageHeaders (= 0.65.1) 304 | - React-jsi (= 0.65.1) 305 | - React-RCTNetwork (= 0.65.1) 306 | - ReactCommon/turbomodule/core (= 0.65.1) 307 | - React-RCTLinking (0.65.1): 308 | - FBReactNativeSpec (= 0.65.1) 309 | - React-Core/RCTLinkingHeaders (= 0.65.1) 310 | - React-jsi (= 0.65.1) 311 | - ReactCommon/turbomodule/core (= 0.65.1) 312 | - React-RCTNetwork (0.65.1): 313 | - FBReactNativeSpec (= 0.65.1) 314 | - RCT-Folly (= 2021.04.26.00) 315 | - RCTTypeSafety (= 0.65.1) 316 | - React-Core/RCTNetworkHeaders (= 0.65.1) 317 | - React-jsi (= 0.65.1) 318 | - ReactCommon/turbomodule/core (= 0.65.1) 319 | - React-RCTSettings (0.65.1): 320 | - FBReactNativeSpec (= 0.65.1) 321 | - RCT-Folly (= 2021.04.26.00) 322 | - RCTTypeSafety (= 0.65.1) 323 | - React-Core/RCTSettingsHeaders (= 0.65.1) 324 | - React-jsi (= 0.65.1) 325 | - ReactCommon/turbomodule/core (= 0.65.1) 326 | - React-RCTText (0.65.1): 327 | - React-Core/RCTTextHeaders (= 0.65.1) 328 | - React-RCTVibration (0.65.1): 329 | - FBReactNativeSpec (= 0.65.1) 330 | - RCT-Folly (= 2021.04.26.00) 331 | - React-Core/RCTVibrationHeaders (= 0.65.1) 332 | - React-jsi (= 0.65.1) 333 | - ReactCommon/turbomodule/core (= 0.65.1) 334 | - React-runtimeexecutor (0.65.1): 335 | - React-jsi (= 0.65.1) 336 | - ReactCommon/turbomodule/core (0.65.1): 337 | - DoubleConversion 338 | - glog 339 | - RCT-Folly (= 2021.04.26.00) 340 | - React-callinvoker (= 0.65.1) 341 | - React-Core (= 0.65.1) 342 | - React-cxxreact (= 0.65.1) 343 | - React-jsi (= 0.65.1) 344 | - React-perflogger (= 0.65.1) 345 | - RNCPicker (1.16.8): 346 | - React-Core 347 | - RNFS (2.18.0): 348 | - React 349 | - RNGestureHandler (1.10.3): 350 | - React-Core 351 | - RNReanimated (1.13.3): 352 | - React-Core 353 | - RNScreens (2.18.1): 354 | - React-Core 355 | - Yoga (1.14.0) 356 | - YogaKit (1.18.1): 357 | - Yoga (~> 1.14) 358 | 359 | DEPENDENCIES: 360 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) 361 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) 362 | - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`) 363 | - Flipper (= 0.93.0) 364 | - Flipper-Boost-iOSX (= 1.76.0.1.11) 365 | - Flipper-DoubleConversion (= 3.1.7) 366 | - Flipper-Fmt (= 7.1.7) 367 | - Flipper-Folly (= 2.6.7) 368 | - Flipper-Glog (= 0.3.6) 369 | - Flipper-PeerTalk (= 0.0.4) 370 | - Flipper-RSocket (= 1.4.3) 371 | - FlipperKit (= 0.93.0) 372 | - FlipperKit/Core (= 0.93.0) 373 | - FlipperKit/CppBridge (= 0.93.0) 374 | - FlipperKit/FBCxxFollyDynamicConvert (= 0.93.0) 375 | - FlipperKit/FBDefines (= 0.93.0) 376 | - FlipperKit/FKPortForwarding (= 0.93.0) 377 | - FlipperKit/FlipperKitHighlightOverlay (= 0.93.0) 378 | - FlipperKit/FlipperKitLayoutPlugin (= 0.93.0) 379 | - FlipperKit/FlipperKitLayoutTextSearchable (= 0.93.0) 380 | - FlipperKit/FlipperKitNetworkPlugin (= 0.93.0) 381 | - FlipperKit/FlipperKitReactPlugin (= 0.93.0) 382 | - FlipperKit/FlipperKitUserDefaultsPlugin (= 0.93.0) 383 | - FlipperKit/SKIOSNetworkPlugin (= 0.93.0) 384 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) 385 | - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) 386 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) 387 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) 388 | - React (from `../node_modules/react-native/`) 389 | - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`) 390 | - React-Core (from `../node_modules/react-native/`) 391 | - React-Core/DevSupport (from `../node_modules/react-native/`) 392 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`) 393 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`) 394 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) 395 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) 396 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) 397 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) 398 | - react-native-ffmpeg/full (from `../node_modules/react-native-ffmpeg/react-native-ffmpeg.podspec`) 399 | - react-native-video (from `../node_modules/react-native-video`) 400 | - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`) 401 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) 402 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) 403 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) 404 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`) 405 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`) 406 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) 407 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) 408 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`) 409 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) 410 | - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`) 411 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) 412 | - "RNCPicker (from `../node_modules/@react-native-picker/picker`)" 413 | - RNFS (from `../node_modules/react-native-fs`) 414 | - RNGestureHandler (from `../node_modules/react-native-gesture-handler`) 415 | - RNReanimated (from `../node_modules/react-native-reanimated`) 416 | - RNScreens (from `../node_modules/react-native-screens`) 417 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) 418 | 419 | SPEC REPOS: 420 | trunk: 421 | - boost-for-react-native 422 | - CocoaAsyncSocket 423 | - Flipper 424 | - Flipper-Boost-iOSX 425 | - Flipper-DoubleConversion 426 | - Flipper-Fmt 427 | - Flipper-Folly 428 | - Flipper-Glog 429 | - Flipper-PeerTalk 430 | - Flipper-RSocket 431 | - FlipperKit 432 | - fmt 433 | - libevent 434 | - mobile-ffmpeg-full 435 | - OpenSSL-Universal 436 | - YogaKit 437 | 438 | EXTERNAL SOURCES: 439 | DoubleConversion: 440 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" 441 | FBLazyVector: 442 | :path: "../node_modules/react-native/Libraries/FBLazyVector" 443 | FBReactNativeSpec: 444 | :path: "../node_modules/react-native/React/FBReactNativeSpec" 445 | glog: 446 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" 447 | RCT-Folly: 448 | :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec" 449 | RCTRequired: 450 | :path: "../node_modules/react-native/Libraries/RCTRequired" 451 | RCTTypeSafety: 452 | :path: "../node_modules/react-native/Libraries/TypeSafety" 453 | React: 454 | :path: "../node_modules/react-native/" 455 | React-callinvoker: 456 | :path: "../node_modules/react-native/ReactCommon/callinvoker" 457 | React-Core: 458 | :path: "../node_modules/react-native/" 459 | React-CoreModules: 460 | :path: "../node_modules/react-native/React/CoreModules" 461 | React-cxxreact: 462 | :path: "../node_modules/react-native/ReactCommon/cxxreact" 463 | React-jsi: 464 | :path: "../node_modules/react-native/ReactCommon/jsi" 465 | React-jsiexecutor: 466 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor" 467 | React-jsinspector: 468 | :path: "../node_modules/react-native/ReactCommon/jsinspector" 469 | react-native-ffmpeg: 470 | :podspec: "../node_modules/react-native-ffmpeg/react-native-ffmpeg.podspec" 471 | react-native-video: 472 | :path: "../node_modules/react-native-video" 473 | React-perflogger: 474 | :path: "../node_modules/react-native/ReactCommon/reactperflogger" 475 | React-RCTActionSheet: 476 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS" 477 | React-RCTAnimation: 478 | :path: "../node_modules/react-native/Libraries/NativeAnimation" 479 | React-RCTBlob: 480 | :path: "../node_modules/react-native/Libraries/Blob" 481 | React-RCTImage: 482 | :path: "../node_modules/react-native/Libraries/Image" 483 | React-RCTLinking: 484 | :path: "../node_modules/react-native/Libraries/LinkingIOS" 485 | React-RCTNetwork: 486 | :path: "../node_modules/react-native/Libraries/Network" 487 | React-RCTSettings: 488 | :path: "../node_modules/react-native/Libraries/Settings" 489 | React-RCTText: 490 | :path: "../node_modules/react-native/Libraries/Text" 491 | React-RCTVibration: 492 | :path: "../node_modules/react-native/Libraries/Vibration" 493 | React-runtimeexecutor: 494 | :path: "../node_modules/react-native/ReactCommon/runtimeexecutor" 495 | ReactCommon: 496 | :path: "../node_modules/react-native/ReactCommon" 497 | RNCPicker: 498 | :path: "../node_modules/@react-native-picker/picker" 499 | RNFS: 500 | :path: "../node_modules/react-native-fs" 501 | RNGestureHandler: 502 | :path: "../node_modules/react-native-gesture-handler" 503 | RNReanimated: 504 | :path: "../node_modules/react-native-reanimated" 505 | RNScreens: 506 | :path: "../node_modules/react-native-screens" 507 | Yoga: 508 | :path: "../node_modules/react-native/ReactCommon/yoga" 509 | 510 | SPEC CHECKSUMS: 511 | boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c 512 | CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 513 | DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662 514 | FBLazyVector: 33c82491102f20ecddb6c6a2c273696ace3191e0 515 | FBReactNativeSpec: df8f81d2a7541ee6755a047b398a5cb5a72acd0e 516 | Flipper: b1fddf9a17c32097b2b4c806ad158b2f36bb2692 517 | Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c 518 | Flipper-DoubleConversion: 57ffbe81ef95306cc9e69c4aa3aeeeeb58a6a28c 519 | Flipper-Fmt: 60cbdd92fc254826e61d669a5d87ef7015396a9b 520 | Flipper-Folly: 83af37379faa69497529e414bd43fbfc7cae259a 521 | Flipper-Glog: 1dfd6abf1e922806c52ceb8701a3599a79a200a6 522 | Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 523 | Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541 524 | FlipperKit: aec2d931adeee48a07bab1ea8bcc8a6bb87dfce4 525 | fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 526 | glog: 5337263514dd6f09803962437687240c5dc39aa4 527 | libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 528 | mobile-ffmpeg-full: 505c583d91ac1c4fb2b015787e69d83f83fb8f29 529 | OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b 530 | RCT-Folly: 0dd9e1eb86348ecab5ba76f910b56f4b5fef3c46 531 | RCTRequired: 6cf071ab2adfd769014b3d94373744ee6e789530 532 | RCTTypeSafety: b829c59453478bb5b02487b8de3336386ab93ab1 533 | React: 29d8a785041b96a2754c25cc16ddea57b7a618ce 534 | React-callinvoker: 2857b61132bd7878b736e282581f4b42fd93002b 535 | React-Core: 001e21bad5ca41e59e9d90df5c0b53da04c3ce8e 536 | React-CoreModules: 0a0410ab296a62ab38e2f8d321e822d1fcc2fe49 537 | React-cxxreact: 8d904967134ae8ff0119c5357c42eaae976806f8 538 | React-jsi: 12913c841713a15f64eabf5c9ad98592c0ec5940 539 | React-jsiexecutor: 43f2542aed3c26e42175b339f8d37fe3dd683765 540 | React-jsinspector: 41e58e5b8e3e0bf061fdf725b03f2144014a8fb0 541 | react-native-ffmpeg: 587fa045f985d775107f4b8cbb6c79df0ad68e63 542 | react-native-video: 0bb76b6d6b77da3009611586c7dbf817b947f30e 543 | React-perflogger: fd28ee1f2b5b150b00043f0301d96bd417fdc339 544 | React-RCTActionSheet: 7f3fa0855c346aa5d7c60f9ced16e067db6d29fa 545 | React-RCTAnimation: 2119a18ee26159004b001bc56404ca5dbaae6077 546 | React-RCTBlob: a493cc306deeaba0c0efa8ecec2da154afd3a798 547 | React-RCTImage: 54999ddc896b7db6650af5760607aaebdf30425c 548 | React-RCTLinking: 7fb3fa6397d3700c69c3d361870a299f04f1a2e6 549 | React-RCTNetwork: 329ee4f75bd2deb8cf6c4b14231b5bb272cbd9af 550 | React-RCTSettings: 1a659d58e45719bc77c280dbebce6a5a5a2733f5 551 | React-RCTText: e12d7aae2a038be9ae72815436677a7c6549dd26 552 | React-RCTVibration: 92d41c2442e5328cc4d342cd7f78e5876b68bae5 553 | React-runtimeexecutor: 85187f19dd9c47a7c102f9994f9d14e4dc2110de 554 | ReactCommon: eafed38eec7b591c31751bfa7494801618460459 555 | RNCPicker: 0991c56da7815c0cf946d6f63cf920b25296e5f6 556 | RNFS: 3ab21fa6c56d65566d1fb26c2228e2b6132e5e32 557 | RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211 558 | RNReanimated: 514a11da3a2bcc6c3dfd9de32b38e2b9bf101926 559 | RNScreens: f7ad633b2e0190b77b6a7aab7f914fad6f198d8d 560 | Yoga: aa0cb45287ebe1004c02a13f279c55a95f1572f4 561 | YogaKit: f782866e155069a2cca2517aafea43200b01fd5a 562 | 563 | PODFILE CHECKSUM: 29b985c20fcad533541308e4b526efb71af813fe 564 | 565 | COCOAPODS: 1.11.2 566 | --------------------------------------------------------------------------------