Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.

Commit b99e712

Browse files
committed
implement react-native plugin
1 parent 5a3224b commit b99e712

24 files changed

+6775
-56
lines changed

README.md

+37-30
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# FFmpegKit ![GitHub release](https://img.shields.io/badge/release-v4.5-blue.svg) ![Maven Central](https://img.shields.io/maven-central/v/com.arthenica/ffmpeg-kit-min) ![CocoaPods](https://img.shields.io/cocoapods/v/ffmpeg-kit-ios-min)
1+
# FFmpegKit ![GitHub release](https://img.shields.io/badge/release-v4.5-blue.svg) ![Maven Central](https://img.shields.io/maven-central/v/com.arthenica/ffmpeg-kit-min) ![CocoaPods](https://img.shields.io/cocoapods/v/ffmpeg-kit-ios-min) [![npm](https://img.shields.io/npm/v/ffmpeg-kit-react-native.svg)](ffmpeg-kit-react-native)
22

33
FFmpeg Kit for applications.
44

@@ -7,42 +7,48 @@ FFmpeg Kit for applications.
77
### 1. Features
88
- Scripts to build FFmpeg libraries
99
- `FFmpegKit` wrapper library to run `FFmpeg`/`FFprobe` commands in applications
10-
- Supports Android, iOS, macOS and tvOS
10+
- Supports native platforms: Android, iOS, macOS and tvOS
11+
- Supports hybrid platforms: React Native
1112
- Based on FFmpeg `v4.5-dev` with optional system and external libraries
12-
- 8 prebuilt binary packages available at [Github](https://github.com/tanersener/ffmpeg-kit/releases), [Maven Central](https://search.maven.org) and [CocoaPods](https://cocoapods.org).
13+
- 8 prebuilt binary packages available at [Github](https://github.com/tanersener/ffmpeg-kit/releases), [Maven Central](https://search.maven.org), [CocoaPods](https://cocoapods.org) and [npm](https://www.npmjs.com)
1314
- Licensed under `LGPL 3.0`, or `GPL v3.0` if GPL licensed libraries are enabled
1415

1516
### 2. Android
1617

17-
See [Android](https://github.com/tanersener/ffmpeg-kit/tree/development/android) to learn more about `FFmpegKit` for
18+
See [Android](https://github.com/tanersener/ffmpeg-kit/tree/main/android) to learn more about `FFmpegKit` for
1819
`Android`.
1920

2021
### 3. iOS, macOS, tvOS
2122

22-
See [Apple](https://github.com/tanersener/ffmpeg-kit/tree/development/apple) to use `FFmpegKit` on `Apple` platforms
23+
See [Apple](https://github.com/tanersener/ffmpeg-kit/tree/main/apple) to use `FFmpegKit` on `Apple` platforms
2324
(`iOS`, `macOS`, `tvOS`).
2425

25-
### 4. Build Scripts
26+
### 4. React Native
2627

27-
Use `android.sh`, `ios.sh`, `macos.sh` and `tvos.sh` to build `FFmpegKit` for each platform.
28+
See [React Native](https://github.com/tanersener/ffmpeg-kit/tree/main/react-native) to learn more about `FFmpegKit` for
29+
`React Native`.
30+
31+
### 5. Build Scripts
32+
33+
Use `android.sh`, `ios.sh`, `macos.sh` and `tvos.sh` to build `FFmpegKit` for each native platform.
2834

2935
All scripts support additional options to enable optional libraries and disable platform architectures.
3036

31-
### 5. FFmpegKit Library
37+
### 6. FFmpegKit Library
3238

3339
`FFmpegKit` is a wrapper library that allows you to easily run `FFmpeg`/`FFprobe` commands in applications. It
3440
provides additional features on top of `FFmpeg` to enable platform specific resources, control how commands are
3541
executed and how the results are handled.
3642

37-
`Android` library has a `Java` API and `Apple` libraries (`iOS`, `macOS`, `tvOS`) have an `Objective-C` API,
38-
which are identical in terms of features and capabilities.
43+
`Android` library of `FFmpegKit` has a `Java` API, `Apple` libraries (`iOS`, `macOS`, `tvOS`) have an `Objective-C`
44+
API and `React Native` library provides a `JavaScript` API, which are identical in terms of features and capabilities.
3945

40-
### 6. Binary Packages
46+
### 7. Packages
4147

4248
There are eight different `ffmpeg-kit` packages distributed on
4349
[Github](https://github.com/tanersener/ffmpeg-kit/releases),
44-
[Maven Central](https://search.maven.org) and [CocoaPods](https://cocoapods.org).
45-
Below you can see which system libraries and external libraries are enabled in each one of them.
50+
[Maven Central](https://search.maven.org), [CocoaPods](https://cocoapods.org) and [npm](https://www.npmjs.com).
51+
Below you can see which system libraries and external libraries are enabled in each one of them.
4652

4753
Please remember that some parts of `FFmpeg` are licensed under the `GPL` and only `GPL` licensed `ffmpeg-kit` packages
4854
include them.
@@ -96,21 +102,22 @@ include them.
96102
- `AVFoundation` is not available on `tvOS`
97103
- `VideoToolbox` is not available on LTS releases of `iOS` and `tvOS`
98104

99-
### 7. Versions
105+
### 8. Versions
100106

101107
`FFmpegKit` binaries generated use the same major and minor version numbers as the upstream `FFmpeg` project.
102108

103109
The exact version number of `FFmpeg` is obtained using `git describe --tags`. `dev` part in the version string
104110
indicates that `FFmpeg` source code is cloned from the `FFmpeg` `master` branch.
105111

106-
| FFmpegKit Version | FFmpeg Version | Release Date |
107-
| :----: | :----: |:----: |
108-
| [4.5](https://github.com/tanersener/ffmpeg-kit/releases/tag/v4.5) | 4.5-dev-2008 | Sep 18, 2021 |
109-
| [4.5.LTS](https://github.com/tanersener/ffmpeg-kit/releases/tag/v4.5.LTS) | 4.5-dev-2008 | Sep 18, 2021 |
110-
| [4.4](https://github.com/tanersener/ffmpeg-kit/releases/tag/v4.4) | 4.4-dev-3015 | Mar 03, 2021 |
111-
| [4.4.LTS](https://github.com/tanersener/ffmpeg-kit/releases/tag/v4.4.LTS) | 4.4-dev-3015 | Mar 03, 2021 |
112+
| Platforms | FFmpegKit Version | FFmpeg Version | Release Date |
113+
| :----: | :----: | :----: | :----: |
114+
| React Native | [4.5.0](https://github.com/tanersener/ffmpeg-kit/releases/tag/react.native.v4.5.0) | 4.5-dev-2008 | Oct 01, 2021 |
115+
| Android<br>Apple | [4.5](https://github.com/tanersener/ffmpeg-kit/releases/tag/v4.5) | 4.5-dev-2008 | Sep 18, 2021 |
116+
| Android<br>Apple | [4.5.LTS](https://github.com/tanersener/ffmpeg-kit/releases/tag/v4.5.LTS) | 4.5-dev-2008 | Sep 18, 2021 |
117+
| Android<br>Apple | [4.4](https://github.com/tanersener/ffmpeg-kit/releases/tag/v4.4) | 4.4-dev-3015 | Mar 03, 2021 |
118+
| Android<br>Apple | [4.4.LTS](https://github.com/tanersener/ffmpeg-kit/releases/tag/v4.4.LTS) | 4.4-dev-3015 | Mar 03, 2021 |
112119

113-
### 8. LTS Releases
120+
### 9. LTS Releases
114121

115122
`FFmpegKit` binaries are published in two release variants: `Main Release` and `LTS Release`.
116123

@@ -139,24 +146,24 @@ This table shows the differences between two variants.
139146
| tvOS Architectures | arm64<br/>x86-64<br/>arm64-simulator | arm64<br/>x86-64 |
140147
| tvOS Bundle Format | XCFrameworks | Frameworks |
141148

142-
### 9. Documentation
149+
### 10. Documentation
143150

144151
A more detailed documentation is available under [Wiki](https://github.com/tanersener/ffmpeg-kit/wiki).
145152

146-
### 10. Test Applications
153+
### 11. Test Applications
147154

148155
You can see how `FFmpegKit` is used inside an application by running test applications created under
149156
[FFmpegKit Test](https://github.com/tanersener/ffmpeg-kit-test) project.
150157

151158
All applications are identical and supports command execution, video encoding, accessing https urls, encoding audio,
152159
burning subtitles, video stabilisation, pipe operations and concurrent command execution.
153160

154-
### 11. License
161+
### 12. License
155162

156163
`FFmpegKit` is licensed under the `LGPL v3.0`. However, if source code is built using the optional `--enable-gpl` flag
157164
or prebuilt binaries with `-gpl` postfix are used, then `FFmpegKit` is subject to the `GPL v3.0` license.
158165

159-
### 12. Patents
166+
### 13. Patents
160167

161168
It is not clearly explained in their documentation, but it is believed that `FFmpeg`, `kvazaar`, `x264` and `x265`
162169
include algorithms which are subject to software patents. If you live in a country where software algorithms are
@@ -167,15 +174,15 @@ that you seek legal advice first. See [FFmpeg Patent Mini-FAQ](https://ffmpeg.or
167174
distribute that library, then you are subject to pay MPEG LA licensing fees. Refer to
168175
[OpenH264 FAQ](https://www.openh264.org/faq.html) page for the details.
169176

170-
### 13. Contributing
177+
### 14. Contributing
171178

172179
Feel free to submit issues or pull requests.
173180

174-
Please note that `main` includes only the latest released source code. Changes planned for the next release are
175-
developed under the `development` branch. Therefore, if you want to create a pull request, please open it against
176-
the `development`.
181+
Please note that `main` includes only the latest released source code. Changes planned for the next release are
182+
developed under the `development` branches (`development` for native platforms, `development-react-native` for
183+
`react-native`). Therefore, if you want to create a pull request, please open it against them.
177184

178-
### 14. See Also
185+
### 15. See Also
179186

180187
- [FFmpeg API Documentation](https://ffmpeg.org/doxygen/4.0/index.html)
181188
- [FFmpeg Wiki](https://trac.ffmpeg.org/wiki/WikiStart)

docs/index.md

+33-26
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ FFmpeg Kit for applications.
77
### 1. Features
88
- Scripts to build FFmpeg libraries
99
- `FFmpegKit` wrapper library to run `FFmpeg`/`FFprobe` commands in applications
10-
- Supports Android, iOS, macOS and tvOS
10+
- Supports native platforms: Android, iOS, macOS and tvOS
11+
- Supports hybrid platforms: React Native
1112
- Based on FFmpeg `v4.5-dev` with optional system and external libraries
12-
- 8 prebuilt binary packages available at [Github](https://github.com/tanersener/ffmpeg-kit/releases), [Maven Central](https://search.maven.org) and [CocoaPods](https://cocoapods.org).
13+
- 8 prebuilt binary packages available at [Github](https://github.com/tanersener/ffmpeg-kit/releases), [Maven Central](https://search.maven.org), [CocoaPods](https://cocoapods.org) and [npm](https://www.npmjs.com)
1314
- Licensed under `LGPL 3.0`, or `GPL v3.0` if GPL licensed libraries are enabled
1415

1516
### 2. Android
@@ -22,27 +23,32 @@ See [Android](https://github.com/tanersener/ffmpeg-kit/tree/development/android)
2223
See [Apple](https://github.com/tanersener/ffmpeg-kit/tree/development/apple) to use `FFmpegKit` on `Apple` platforms
2324
(`iOS`, `macOS`, `tvOS`).
2425

25-
### 4. Build Scripts
26+
### 4. React Native
2627

27-
Use `android.sh`, `ios.sh`, `macos.sh` and `tvos.sh` to build `FFmpegKit` for each platform.
28+
See [React Native](https://github.com/tanersener/ffmpeg-kit/tree/main/react-native) to learn more about `FFmpegKit` for
29+
`React Native`.
30+
31+
### 5. Build Scripts
32+
33+
Use `android.sh`, `ios.sh`, `macos.sh` and `tvos.sh` to build `FFmpegKit` for each native platform.
2834

2935
All scripts support additional options to enable optional libraries and disable platform architectures.
3036

31-
### 5. FFmpegKit Library
37+
### 6. FFmpegKit Library
3238

3339
`FFmpegKit` is a wrapper library that allows you to easily run `FFmpeg`/`FFprobe` commands in applications. It
3440
provides additional features on top of `FFmpeg` to enable platform specific resources, control how commands are
3541
executed and how the results are handled.
3642

37-
`Android` library has a `Java` API and `Apple` libraries (`iOS`, `macOS`, `tvOS`) have an `Objective-C` API,
38-
which are identical in terms of features and capabilities.
43+
`Android` library of `FFmpegKit` has a `Java` API, `Apple` libraries (`iOS`, `macOS`, `tvOS`) have an `Objective-C`
44+
API and `React Native` library provides a `JavaScript` API, which are identical in terms of features and capabilities.
3945

40-
### 6. Binary Packages
46+
### 7. Packages
4147

4248
There are eight different `ffmpeg-kit` packages distributed on
4349
[Github](https://github.com/tanersener/ffmpeg-kit/releases),
44-
[Maven Central](https://search.maven.org) and [CocoaPods](https://cocoapods.org).
45-
Below you can see which external libraries are enabled in each one of them.
50+
[Maven Central](https://search.maven.org), [CocoaPods](https://cocoapods.org) and [npm](https://www.npmjs.com).
51+
Below you can see which system libraries and external libraries are enabled in each one of them.
4652

4753
Please remember that some parts of `FFmpeg` are licensed under the `GPL` and only `GPL` licensed `ffmpeg-kit` packages
4854
include them.
@@ -79,21 +85,22 @@ include them.
7985
- `AVFoundation` is not available on `tvOS`
8086
- `VideoToolbox` is not available on LTS releases of `iOS` and `tvOS`
8187

82-
### 7. Versions
88+
### 8. Versions
8389

8490
`FFmpegKit` binaries generated use the same major and minor version numbers as the upstream `FFmpeg` project.
8591

8692
The exact version number of `FFmpeg` is obtained using `git describe --tags`. `dev` part in the version string
8793
indicates that `FFmpeg` source code is cloned from the `FFmpeg` `master` branch.
8894

89-
| FFmpegKit Version | FFmpeg Version | Release Date |
90-
| :----: | :----: |:----: |
91-
| [4.5](https://github.com/tanersener/ffmpeg-kit/releases/tag/v4.5) | 4.5-dev-2008 | Sep 18, 2021 |
92-
| [4.5.LTS](https://github.com/tanersener/ffmpeg-kit/releases/tag/v4.5.LTS) | 4.5-dev-2008 | Sep 18, 2021 |
93-
| [4.4](https://github.com/tanersener/ffmpeg-kit/releases/tag/v4.4) | 4.4-dev-3015 | Mar 03, 2021 |
94-
| [4.4.LTS](https://github.com/tanersener/ffmpeg-kit/releases/tag/v4.4.LTS) | 4.4-dev-3015 | Mar 03, 2021 |
95+
| Platforms | FFmpegKit Version | FFmpeg Version | Release Date |
96+
| :----: | :----: | :----: | :----: |
97+
| React Native | [4.5.0](https://github.com/tanersener/ffmpeg-kit/releases/tag/react.native.v4.5.0) | 4.5-dev-2008 | Oct 01, 2021 |
98+
| Android<br>Apple | [4.5](https://github.com/tanersener/ffmpeg-kit/releases/tag/v4.5) | 4.5-dev-2008 | Sep 18, 2021 |
99+
| Android<br>Apple | [4.5.LTS](https://github.com/tanersener/ffmpeg-kit/releases/tag/v4.5.LTS) | 4.5-dev-2008 | Sep 18, 2021 |
100+
| Android<br>Apple | [4.4](https://github.com/tanersener/ffmpeg-kit/releases/tag/v4.4) | 4.4-dev-3015 | Mar 03, 2021 |
101+
| Android<br>Apple | [4.4.LTS](https://github.com/tanersener/ffmpeg-kit/releases/tag/v4.4.LTS) | 4.4-dev-3015 | Mar 03, 2021 |
95102

96-
### 8. LTS Releases
103+
### 9. LTS Releases
97104

98105
`FFmpegKit` binaries are published in two release variants: `Main Release` and `LTS Release`.
99106

@@ -122,24 +129,24 @@ This table shows the differences between two variants.
122129
| tvOS Architectures | arm64<br/>x86-64<br/>arm64-simulator | arm64<br/>x86-64 |
123130
| tvOS Bundle Format | XCFrameworks | Frameworks |
124131

125-
### 9. Documentation
132+
### 10. Documentation
126133

127134
A more detailed documentation is available under [Wiki](https://github.com/tanersener/ffmpeg-kit/wiki).
128135

129-
### 10. Test Applications
136+
### 11. Test Applications
130137

131138
You can see how `FFmpegKit` is used inside an application by running test applications created under
132139
[FFmpegKit Test](https://github.com/tanersener/ffmpeg-kit-test) project.
133140

134141
All applications are identical and supports command execution, video encoding, accessing https urls, encoding audio,
135142
burning subtitles, video stabilisation, pipe operations, concurrent command execution.
136143

137-
### 11. License
144+
### 12. License
138145

139146
`FFmpegKit` is licensed under the `LGPL v3.0`. However, if source code is built using the optional `--enable-gpl` flag
140147
or prebuilt binaries with `-gpl` postfix are used, then `FFmpegKit` is subject to the `GPL v3.0` license.
141148

142-
### 12. Patents
149+
### 13. Patents
143150

144151
It is not clearly explained in their documentation, but it is believed that `FFmpeg`, `kvazaar`, `x264` and `x265`
145152
include algorithms which are subject to software patents. If you live in a country where software algorithms are
@@ -150,15 +157,15 @@ that you seek legal advice first. See [FFmpeg Patent Mini-FAQ](https://ffmpeg.or
150157
distribute that library, then you are subject to pay MPEG LA licensing fees. Refer to
151158
[OpenH264 FAQ](https://www.openh264.org/faq.html) page for the details.
152159

153-
### 13. Contributing
160+
### 14. Contributing
154161

155162
Feel free to submit issues or pull requests.
156163

157164
Please note that `main` includes only the latest released source code. Changes planned for the next release are
158-
developed under the `development` branch. Therefore, if you want to create a pull request, please open it against
159-
the `development`.
165+
developed under the `development` branches (`development` for native platforms, `development-react-native` for
166+
`react-native`). Therefore, if you want to create a pull request, please open it against them.
160167

161-
### 14. See Also
168+
### 15. See Also
162169

163170
- [FFmpeg API Documentation](https://ffmpeg.org/doxygen/4.0/index.html)
164171
- [FFmpeg Wiki](https://trac.ffmpeg.org/wiki/WikiStart)

react-native/.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
9+
indent_style = space
10+
indent_size = 2
11+
12+
end_of_line = lf
13+
charset = utf-8
14+
trim_trailing_whitespace = true
15+
insert_final_newline = true

react-native/.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.pbxproj -text
2+
# specific for windows script files
3+
*.bat text eol=crlf

react-native/.gitignore

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# XDE
6+
.expo/
7+
8+
# VSCode
9+
.vscode/
10+
jsconfig.json
11+
12+
# Xcode
13+
#
14+
build/
15+
*.pbxuser
16+
!default.pbxuser
17+
*.mode1v3
18+
!default.mode1v3
19+
*.mode2v3
20+
!default.mode2v3
21+
*.perspectivev3
22+
!default.perspectivev3
23+
xcuserdata
24+
*.xccheckout
25+
*.moved-aside
26+
DerivedData
27+
*.hmap
28+
*.ipa
29+
*.xcuserstate
30+
project.xcworkspace
31+
32+
# Android/IJ
33+
#
34+
.idea
35+
.gradle
36+
local.properties
37+
android.iml
38+
39+
# Cocoapods
40+
#
41+
example/ios/Pods
42+
43+
# node.js
44+
#
45+
node_modules/
46+
npm-debug.log
47+
yarn-debug.log
48+
yarn-error.log
49+
50+
# BUCK
51+
buck-out/
52+
\.buckd/
53+
android/app/libs
54+
android/keystores/debug.keystore
55+
56+
# Expo
57+
.expo/*
58+
59+
# generated by bob
60+
lib/

0 commit comments

Comments
 (0)