react-native-video-trim 1.0.15 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ public class VideoTrimmerUtil {
|
|
|
31
31
|
private static final int THUMB_RESOLUTION_RES = 2; // double thumb resolution for better quality
|
|
32
32
|
|
|
33
33
|
public static void trim(String inputFile, String outputFile, int videoDuration, long startMs, long endMs, final VideoTrimListener callback) {
|
|
34
|
-
String cmd = "-
|
|
34
|
+
String cmd = "-ss " + startMs + "ms" + " -to " + endMs + "ms -i " + inputFile + " -c copy " + outputFile;
|
|
35
35
|
callback.onStartTrim();
|
|
36
36
|
FFmpegKit.executeAsync(cmd, session -> {
|
|
37
37
|
SessionState state = session.getState();
|
package/ios/VideoTrim.swift
CHANGED
|
@@ -279,7 +279,7 @@ class VideoTrim: RCTEventEmitter {
|
|
|
279
279
|
let timestamp = Int(Date().timeIntervalSince1970)
|
|
280
280
|
let outputName = "\(FILE_PREFIX)_\(timestamp).mp4" // use mp4 to prevent any issue with ffmpeg about file extension
|
|
281
281
|
let outputFile = "\(inputFile.deletingLastPathComponent().absoluteURL)\(outputName)"
|
|
282
|
-
let cmd = "-
|
|
282
|
+
let cmd = "-ss \(startTime * 1000)ms -to \(endTime * 1000)ms -i \(inputFile) -c copy \(outputFile)";
|
|
283
283
|
|
|
284
284
|
self.emitEventToJS("onStartTrimming", eventData: nil)
|
|
285
285
|
|