Code Monkey home page Code Monkey logo

tapioca's Introduction

Tapioca - a Flutter plugin for video editing

Version Generic badge Discord tippin.me

codecov Tapioca is a Flutter plugin for video editing on Android and iOS.

Note: Feedback welcome and Pull Requests are most welcome!

Previews


No filter

Apply pink filter

Apply blue filter

Apply text filter

Apply image filter

Features

  • Develop for iOS and Android from a single codebase
  • Edit videos(Apply filter, Overlay text and images)

Installation

First, add tapioca as a dependency in your pubspec.yaml file.

iOS

Add the following entry to your Info.plist file, located in <project root>/ios/Runner/Info.plist:

  • NSPhotoLibraryUsageDescription - Specifies the reason for your app to access the user’s photo library. This is called Privacy - Photo Library Usage Description in the visual editor.
  • NSPhotoLibraryAddUsageDescription - Specifies the reason for your app to get write-only access to the user’s photo library. This is called Privacy - Photo Library Additions Usage Description in the visual editor.

Android

Step 1. Ensure the following permission is present in your Android Manifest file, located in <project root>/android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Step 2. Add the JitPack repository to your Android build file, located in <project root>/android/build.gradle:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Usage

import 'package:tapioca/tapioca.dart';
import 'package:path_provider/path_provider.dart';

final tapiocaBalls = [
    TapiocaBall.filter(Filters.pink),
    TapiocaBall.imageOverlay(imageBitmap, 300, 300),
    TapiocaBall.textOverlay("text",100,10,100,Color(0xffffc0cb)),
];
var tempDir = await getTemporaryDirectory();
final path = '${tempDir.path}/result.mp4';
final cup = Cup(Content(videoPath), tapiocaBalls);
cup.suckUp(path).then((_) {
  print("finish processing");
});

TapiocaBall

TapiocaBall is a effect to apply to the video.

TapiocaBall Effect
TapiocaBall.filter(Filters filter) Apply color filter
TapiocaBall.textOverlay(String text, int x, int y, int size, Color color) Overlay text
TapiocaBall.imageOverlay(Uint8List bitmap, int x, int y) Overlay images

Content

Content is a class to wrap a video file.

Cup

Cup is a class to wrap a Content object and List<TapiocaBall> object.

You can edit the video by executing .suckUp().

Supported Formats

  • On iOS, the backing video editor is AVFoundation. please refer here for list of supported video formats.
  • On Android, the backing video editor is Mp4Composer-android, The supported format is only MP4.

Articles

Contributing

Contributions are welcomed!

  • Report bugs and scenarios that are difficult to implement
  • Report parts of the documentation that are unclear
  • Update the documentation / add examples
  • Implement new features by making a pull-request

Please see the following guidelines when modifying the repository
Contributing

Community

Questions and proposals are most welcome!
Discord Banner 4

tapioca's People

Contributors

anharu2394 avatar baneeishaque avatar gorter-dev avatar j-j-gajjar avatar mhdaslam790 avatar tokku5552 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tapioca's Issues

Code stucks at cup.suckUp methord ???

try {
final String path = await _getTempPath();
log('applyFiltersToVideo Filter Index ${state.filterIndex}');
Cup cup = Cup(
Content(state.videoFile!.path), tapiocaBalls[state.filterIndex]);
log('cup created');
await cup.suckUp(path).then((value) => log('suckUp value: $value'));/////// stucks here /////
log('return value');
return path;
} catch (e) {
log("error on filter applying ==================$e");
}
}

[Request] Any solution for stream media?

Hi, I was wondering: is tapioca capable for live video processing?

Such as filtering video data from local camera directly etc..
// camera input comes in the form of buffer object

Filters

Where to get more filter image to overlay in video.

support adding gif to video

i want to edit video by adding gif file to operate repeatedly in video and place it with choose height and width.

Android APP Crash when selecting video

Hello, I cloned the git repository and run the app on my device, and when i select a video, the app crashes giving the following errors:

Tested on both device and simulator, but there errors are on device. Any help woul be appriciated, thank you.

for what is this path:
final path = '${tempDir.path}/result.mp4';
isnt this supposed to be the path of the selected or recorded video?

i added on

 cup.suckUp ....... }, onError: (err) {
                            inspect(err);
                          });

and the inspect is giving the following error:

code:"video_processing_failed"
details:null
message:"video processing is failed."
stacktrace:null
hashCode:323881052

/EGL_emulation(10870): eglMakeCurrent: 0xdeece3c0: ver 2 0 (tinfo 0xd6e0f3f0)
D/eglCodecCommon(10870): setVertexArrayObject: set vao to 0 (0) 1 0
I/flutter (10870): clicked!
D/EGL_emulation(10870): eglMakeCurrent: 0xd6e1a0c0: ver 2 0 (tinfo 0xd6e0f6e0)
I/flutter (10870): /data/user/0/me.anharu.video_editor_example/cache/image_picker7717197437664952230.jpg
D/EGL_emulation(10870): eglMakeCurrent: 0xdeece3c0: ver 2 0 (tinfo 0xd6e0f3f0)
D/EGL_emulation(10870): eglMakeCurrent: 0xd6e1a0c0: ver 2 0 (tinfo 0xd6e0f6e0)
I/flutter (10870): Directory: '/data/user/0/me.anharu.video_editor_example/cache'
D/EGL_emulation(10870): eglMakeCurrent: 0xdeece3c0: ver 2 0 (tinfo 0xd6e0f3f0)
D/eglCodecCommon(10870): setVertexArrayObject: set vao to 0 (0) 7 0
D/Mp4Composer(10870): rotation = 90
D/Mp4Composer(10870): rotation = ROTATION_90
D/Mp4Composer(10870): inputResolution width = 1280 height = 720
D/Mp4Composer(10870): outputResolution width = 720 height = 1280
D/Mp4Composer(10870): fillMode = PRESERVE_ASPECT_FIT
D/Mp4Composer(10870): bitrate=6912000
W/ClearFileSource(10870): offset/length adjusted from 0/576460752303423487 to 0/8496856
D/Mp4ComposerEngine(10870): Duration (us): 11080000
I/VideoCapabilities(10870): Unsupported profile 4 for video/mp4v-es
I/OMXClient(10870): IOmx service obtained
W/OMXUtils(10870): do not know color format 0x7f000789 = 2130708361
I/ACodec  (10870): [OMX.google.h263.encoder] cannot encode color aspects. Ignoring.
I/ACodec  (10870): [OMX.google.h263.encoder] cannot encode HDR static metadata. Ignoring.
I/ACodec  (10870): setupVideoEncoder succeeded
W/OMXUtils(10870): do not know color format 0x7f000789 = 2130708361
D/HostConnection(10870): HostConnection::get() New Host Connection established 0xb414e5f0, tid 10999
D/HostConnection(10870): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_free_memory_sync GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_2
D/eglCodecCommon(10870): setVertexArrayObject: set vao to 0 (0) 0 0
D/EGL_emulation(10870): eglCreateContext: 0xb40d24a0: maj 2 min 0 rcv 2
D/EGL_emulation(10870): eglMakeCurrent: 0xb40d24a0: ver 2 0 (tinfo 0xb40e5d70)
E/ACodec  (10870): [OMX.google.h263.encoder] ERROR(0x80001001)
E/ACodec  (10870): signalError(omxError 0x80001001, internalError -2147483648)
E/MediaCodec(10870): Codec reported err 0x80001001, actionCode 0, while in state 6
W/_editor_exampl(10870): Accessing hidden field Ljava/nio/Buffer;->position:I (greylist, JNI, allowed)
W/_editor_exampl(10870): Accessing hidden field Ljava/nio/Buffer;->limit:I (greylist, JNI, allowed)
W/_editor_exampl(10870): Accessing hidden field Ljava/nio/Buffer;->_elementSizeShift:I (greylist, JNI, allowed)
W/_editor_exampl(10870): Accessing hidden field Ljava/nio/Buffer;->address:J (greylist, JNI, allowed)
W/System  (10870): A resource failed to call close.
E/EGL_emulation(10870): eglQueryContext 32c0  EGL_BAD_ATTRIBUTE
E/EGL_emulation(10870): tid 10999: eglQueryContext(1902): error 0x3004 (EGL_BAD_ATTRIBUTE)
I/OMXClient(10870): IOmx service obtained
D/SurfaceUtils(10870): connecting to surface 0xba1fc008, reason connectToSurface
I/MediaCodec(10870): [OMX.google.h264.decoder] setting surface generation to 11130881
D/SurfaceUtils(10870): disconnecting from surface 0xba1fc008, reason connectToSurface(reconnect)
D/SurfaceUtils(10870): connecting to surface 0xba1fc008, reason connectToSurface(reconnect)
E/ACodec  (10870): [OMX.google.h264.decoder] setPortMode on output to DynamicANWBuffer failed w/ err -1010
I/OMXClient(10870): IOmx service obtained
I/OMXClient(10870): IOmx service obtained
E/Surface (10870): getSlotFromBufferLocked: unknown buffer: 0x0
D/SurfaceUtils(10870): disconnecting from surface 0xba1fc008, reason disconnectFromSurface
E/Mp4ComposerEngine(10870): Could not shutdown mediaExtractor, codecs and mediaMuxer pipeline.
E/Mp4ComposerEngine(10870): java.lang.IllegalStateException
E/Mp4ComposerEngine(10870): 	at android.media.MediaCodec.native_stop(Native Method)
E/Mp4ComposerEngine(10870): 	at android.media.MediaCodec.stop(MediaCodec.java:2147)
E/Mp4ComposerEngine(10870): 	at com.daasuu.mp4compose.composer.VideoComposer.release(VideoComposer.java:161)
E/Mp4ComposerEngine(10870): 	at com.daasuu.mp4compose.composer.Mp4ComposerEngine.compose(Mp4ComposerEngine.java:144)
E/Mp4ComposerEngine(10870): 	at com.daasuu.mp4compose.composer.Mp4Composer$2.run(Mp4Composer.java:297)
E/Mp4ComposerEngine(10870): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/Mp4ComposerEngine(10870): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/Mp4ComposerEngine(10870): 	at java.lang.Thread.run(Thread.java:919)
E/Mp4Composer(10870): Unable to compose the engine
E/Mp4Composer(10870): java.lang.IllegalStateException
E/Mp4Composer(10870): 	at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
E/Mp4Composer(10870): 	at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:2789)
E/Mp4Composer(10870): 	at com.daasuu.mp4compose.composer.VideoComposer.drainEncoder(VideoComposer.java:222)
E/Mp4Composer(10870): 	at com.daasuu.mp4compose.composer.VideoComposer.stepPipeline(VideoComposer.java:118)
E/Mp4Composer(10870): 	at com.daasuu.mp4compose.composer.Mp4ComposerEngine.runPipelines(Mp4ComposerEngine.java:267)
E/Mp4Composer(10870): 	at com.daasuu.mp4compose.composer.Mp4ComposerEngine.compose(Mp4ComposerEngine.java:133)
E/Mp4Composer(10870): 	at com.daasuu.mp4compose.composer.Mp4Composer$2.run(Mp4Composer.java:297)
E/Mp4Composer(10870): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/Mp4Composer(10870): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/Mp4Composer(10870): 	at java.lang.Thread.run(Thread.java:919)
I/System.out(10870): java.lang.IllegalStateException
E/flutter (10870): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: PlatformException(video_processing_failed, video processing is failed., null, null)
E/flutter (10870): #0      StandardMethodCodec.decodeEnvelope
package:flutter/…/services/message_codecs.dart:582
E/flutter (10870): #1      MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:159
E/flutter (10870): <asynchronous suspension>
E/flutter (10870): #2      MethodChannel.invokeMethod
package:flutter/…/services/platform_channel.dart:332
E/flutter (10870): #3      VideoEditor.writeVideofile
package:tapioca/src/video_editor.dart:14
E/flutter (10870): #4      Cup.suckUp
package:tapioca/src/cup.dart:19
E/flutter (10870): #5      _MyAppState.build.<anonymous closure>
package:tapioca_example/main.dart:98
E/flutter (10870): <asynchronous suspension>
E/flutter (10870): #6      _MyAppState.build.<anonymous closure> (package:tapioca_example/main.dart)
package:tapioca_example/main.dart:1
E/flutter (10870): #7      _InkResponseState._handleTap
package:flutter/…/material/ink_well.dart:993
E/flutter (10870): #8      _InkResponseState.build.<anonymous closure>
package:flutter/…/material/ink_well.dart:1111
E/flutter (10870): #9      GestureRecognizer.invokeCallback
package:flutter/…/gestures/recognizer.dart:183
E/flutter (10870): #10     TapGestureRecognizer.handleTapUp
package:flutter/…/gestures/tap.dart:598
E/flutter (10870): #11     BaseTapGestureRecognizer._checkUp
package:flutter/…/gestures/tap.dart:287
E/flutter (10870): #12     BaseTapGestureRecognizer.handlePrimaryPointer
package:flutter/…/gestures/tap.dart:222
E/flutter (10870): #13     PrimaryPointerGestureRecognizer.handleEvent
package:flutter/…/gestures/recognizer.dart:476
E/flutter (10870): #14     PointerRouter._dispatch
package:flutter/…/gestures/pointer_router.dart:77
E/flutter (10870): #15     PointerRouter._dispatchEventToRoutes.<anonymous closure>
package:flutter/…/gestures/pointer_router.dart:122
E/flutter (10870): #16     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:377:8)
E/flutter (10870): #17     PointerRouter._dispatchEventToRoutes
package:flutter/…/gestures/pointer_router.dart:120
E/flutter (10870): #18     PointerRouter.route
package:flutter/…/gestures/pointer_router.dart:106
E/flutter (10870): #19     GestureBinding.handleEvent
package:flutter/…/gestures/binding.dart:358
E/flutter (10870): #20     GestureBinding.dispatchEvent
package:flutter/…/gestures/binding.dart:338
E/flutter (10870): #21     RendererBinding.dispatchEvent
package:flutter/…/rendering/binding.dart:267
E/flutter (10870): #22     GestureBinding._handlePointerEvent
package:flutter/…/gestures/binding.dart:295
E/flutter (10870): #23     GestureBinding._flushPointerEventQueue
package:flutter/…/gestures/binding.dart:240
E/flutter (10870): #24     GestureBinding._handlePointerDataPacket
package:flutter/…/gestures/binding.dart:213
E/flutter (10870): #25     _rootRunUnary (dart:async/zone.dart:1206:13)
E/flutter (10870): #26     _CustomZone.runUnary (dart:async/zone.dart:1100:19)
E/flutter (10870): #27     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
E/flutter (10870): #28     _invoke1 (dart:ui/hooks.dart:265:10)
E/flutter (10870): #29     _dispatchPointerDataPacket (dart:ui/hooks.dart:174:5)
E/flutter (10870):
Application finished.
Exited (sigterm)

I Also tried with the example on the pub.dev, but still with the same issue the app crashes and gives these errors:

/flutter (17791): clicked!
I/Timeline(17791): Timeline: Activity_launch_request time:25151987
W/Activity(17791): Slow Operation: Activity com.example.videoEditor/.MainActivity onActivityResult took 125ms
I/flutter (17791): /data/user/0/com.example.videoEditor/cache/image_picker7509116096101189781.jpg
W/ple.videoEdito(17791): Accessing hidden method Lsun/misc/Unsafe;->getUnsafe()Lsun/misc/Unsafe; (greylist,core-platform-api, linking, allowed)
W/ple.videoEdito(17791): Accessing hidden method Lsun/misc/Unsafe;->objectFieldOffset(Ljava/lang/reflect/Field;)J (greylist,core-platform-api, linking, allowed)
W/ple.videoEdito(17791): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
I/flutter (17791): Directory: '/data/user/0/com.example.videoEditor/cache'
D/Mp4Composer(17791): rotation = 270
D/Mp4Composer(17791): rotation = ROTATION_270
D/Mp4Composer(17791): inputResolution width = 1920 height = 1080
D/Mp4Composer(17791): outputResolution width = 1080 height = 1920
D/Mp4Composer(17791): fillMode = PRESERVE_ASPECT_FIT
D/Mp4Composer(17791): bitrate=15552000
W/ClearFileSource(17791): offset/length adjusted from 0/576460752303423487 to 0/19487528
D/Mp4ComposerEngine(17791): Duration (us): 7278000
W/VideoCapabilities(17791): Unsupported mime image/vnd.android.heic
W/VideoCapabilities(17791): Unsupported mime video/divx
W/VideoCapabilities(17791): Unsupported mime video/divx4
W/VideoCapabilities(17791): Unrecognized profile/level 0/3 for video/mpeg2
W/VideoCapabilities(17791): Unrecognized profile/level 0/3 for video/mpeg2
I/OMXClient(17791): IOmx service obtained
I/ExtendedACodec(17791): setupVideoEncoder()
W/OMXUtils(17791): do not know color format 0x7fa30c06 = 2141391878
W/OMXUtils(17791): do not know color format 0x7fa30c04 = 2141391876
W/OMXUtils(17791): do not know color format 0x7fa30c00 = 2141391872
W/OMXUtils(17791): do not know color format 0x7fa30c09 = 2141391881
W/OMXUtils(17791): do not know color format 0x7fa30c0a = 2141391882
W/OMXUtils(17791): do not know color format 0x7fa30c08 = 2141391880
W/OMXUtils(17791): do not know color format 0x7fa30c07 = 2141391879
W/OMXUtils(17791): do not know color format 0x7f000789 = 2130708361
I/ACodec  (17791): [OMX.qcom.video.encoder.hevc] cannot encode HDR static metadata. Ignoring.
I/ACodec  (17791): setupVideoEncoder succeeded
I/ExtendedACodec(17791): [OMX.qcom.video.encoder.hevc] configure, AMessage : AMessage(what = 'conf', target = 1) = {
I/ExtendedACodec(17791):   int32_t color-format = 2130708361
I/ExtendedACodec(17791):   int32_t i-frame-interval = 1
I/ExtendedACodec(17791):   string mime = "video/hevc"
I/ExtendedACodec(17791):   int32_t width = 1080
I/ExtendedACodec(17791):   int32_t bitrate = 15552000
I/ExtendedACodec(17791):   int32_t frame-rate = 30
I/ExtendedACodec(17791):   int32_t height = 1920
I/ExtendedACodec(17791):   int32_t encoder = 1
I/ExtendedACodec(17791): }
W/OMXUtils(17791): do not know color format 0x7f000789 = 2130708361
I/OMXClient(17791): IOmx service obtained
D/SurfaceUtils(17791): connecting to surface 0x756039f010, reason connectToSurface
I/MediaCodec(17791): [OMX.qcom.video.decoder.avc] setting surface generation to 18217985
D/SurfaceUtils(17791): disconnecting from surface 0x756039f010, reason connectToSurface(reconnect)
D/SurfaceUtils(17791): connecting to surface 0x756039f010, reason connectToSurface(reconnect)
I/ExtendedACodec(17791): setupVideoDecoder()
I/ExtendedACodec(17791): Decoder will be in frame by frame mode
D/SurfaceUtils(17791): set up nativeWindow 0x756039f010 for 1920x1080, color 0x7fa30c06, rotation 0, usage 0x20002900
W/Gralloc3(17791): allocator 3.x is not supported
D/VideoComposer(17791): drainExtractor trackIndex:0
D/VideoComposer(17791): drainExtractor trackIndex:1
D/VideoComposer(17791): drainExtractor trackIndex:1
D/AudioComposer(17791): stepPipeline trackIndex:1
D/VideoComposer(17791): drainExtractor trackIndex:1
D/AudioComposer(17791): stepPipeline trackIndex:1
D/VideoComposer(17791): drainExtractor trackIndex:1
D/AudioComposer(17791): stepPipeline trackIndex:1
D/VideoComposer(17791): drainExtractor trackIndex:0
D/VideoComposer(17791): drainExtractor trackIndex:1
D/VideoComposer(17791): drainExtractor trackIndex:1
D/AudioComposer(17791): stepPipeline trackIndex:1
D/VideoComposer(17791): drainExtractor trackIndex:0
D/SurfaceUtils(17791): set up nativeWindow 0x756039f010 for 1920x1088, color 0x7fa30c06, rotation 0, usage 0x20002900
D/VideoComposer(17791): drainExtractor trackIndex:1
I/chatty  (17791): uid=10354(com.example.videoEditor) pool-4-thread-1 identical 1 line
D/VideoComposer(17791): drainExtractor trackIndex:1
D/AudioComposer(17791): stepPipeline trackIndex:1
D/VideoComposer(17791): drainExtractor trackIndex:1
D/AudioComposer(17791): stepPipeline trackIndex:1
E/BufferQueueProducer(17791): [SurfaceTexture-3-17791-0] cancelBuffer: BufferQueue has been abandoned
I/chatty  (17791): uid=10354(com.example.videoEditor) CodecLooper identical 1 line
E/BufferQueueProducer(17791): [SurfaceTexture-3-17791-0] cancelBuffer: BufferQueue has been abandoned
D/SurfaceUtils(17791): disconnecting from surface 0x756039f010, reason disconnectFromSurface
E/AndroidRuntime(17791): FATAL EXCEPTION: pool-4-thread-1
E/AndroidRuntime(17791): Process: com.example.videoEditor, PID: 17791
E/AndroidRuntime(17791): java.lang.AbstractMethodError: abstract method "void com.daasuu.mp4compose.composer.Mp4Composer$Listener.onCurrentWrittenVideoTime(long)"
E/AndroidRuntime(17791): 	at com.daasuu.mp4compose.composer.Mp4Composer$2$1.onCurrentWrittenVideoTime(Mp4Composer.java:250)
E/AndroidRuntime(17791): 	at com.daasuu.mp4compose.composer.Mp4ComposerEngine.runPipelines(Mp4ComposerEngine.java:282)
E/AndroidRuntime(17791): 	at com.daasuu.mp4compose.composer.Mp4ComposerEngine.compose(Mp4ComposerEngine.java:142)
E/AndroidRuntime(17791): 	at com.daasuu.mp4compose.composer.Mp4Composer$2.run(Mp4Composer.java:312)
E/AndroidRuntime(17791): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/AndroidRuntime(17791): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/AndroidRuntime(17791): 	at java.lang.Thread.run(Thread.java:919)
I/Process (17791): Sending signal. PID: 17791 SIG: 9
Lost connection to device.

App is using a deprecated version of the Android embedding

When trying to run the example via flutter run from the example/ folder, I get the following error.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It is being deprecated in favor of Android embedding v2. Follow the
steps at

https://flutter.dev/go/android-project-migration

to migrate your project. You may also pass the --ignore-deprecation flag to
ignore this check and continue with the deprecated v1 embedding. However,
the v1 Android embedding will be removed in future versions of Flutter.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The detected reason was:

  /Users/tobiaslygren/Projects/tapioca/example/android/app/src/main/AndroidManifest.xml uses `android:name="io.flutter.app.FutterApplication"`
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

This app is using a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to migrate this app to the V2 embedding.
Take a look at the docs for migrating an app: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
The plugin `gallery_saver` requires your app to be migrated to the Android embedding v2. Follow the steps on
https://flutter.dev/go/android-project-migration and re-run this command.

As a result, I am not able to start the example app. Providing the --ignore-deprecation argument also does not help unfortunately.

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.4, on macOS 12.3.1)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 13.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.66.2)

Compilation Error after Xcode was updated to 12.5

/flutter/.pub-cache/hosted/pub.dartlang.org/tapioca-1.0.2+1/ios/Classes/VideoGeneratorService.swift:171:18: error: 'AVAssetExportSessionStatus' has been renamed to 'AVAssetExportSession.Status'
case AVAssetExportSessionStatus.failed:
^~~~~~~~~~~~~~~~~~~~~~~~~~
AVAssetExportSession.Status
AVFoundation.AVAssetExportSessionStatus:2:18: note: 'AVAssetExportSessionStatus' was obsoleted in Swift 4.2
public typealias AVAssetExportSessionStatus = AVAssetExportSession.Status
^
/flutter/.pub-cache/hosted/pub.dartlang.org/tapioca-1.0.2+1/ios/Classes/VideoGeneratorService.swift:173:17: error: 'AVAssetExportSessionStatus' has been renamed to 'AVAssetExportSession.Status'
case AVAssetExportSessionStatus.cancelled:
^~~~~~~~~~~~~~~~~~~~~~~~~~
AVAssetExportSession.Status
AVFoundation.AVAssetExportSessionStatus:2:18: note: 'AVAssetExportSessionStatus' was obsoleted in Swift 4.2
public typealias AVAssetExportSessionStatus = AVAssetExportSession.Status

Build failed with an exception

The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
The following dependencies do not satisfy the required version:
project ':tapioca' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50

Capture
sasa

video_processing_failed

Unhandled Exception: PlatformException(video_processing_failed, video processing is failed., null, null)

[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: PlatformException(video_processing_failed, video processing is failed., null, null)
StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7)
MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:177:18)

VideoEditor.writeVideofile (package:tapioca/src/video_editor.dart:14:5)

Getting this error after selection of file and send "Cup" for Video editing.

try {
var tempDir = await getTemporaryDirectory();
final path = '${tempDir.path}/result2.mp4';
final tapiocaBalls = [
TapiocaBall.filter(Filters.pink),
//TapiocaBall.imageOverlay(imageBitmap, 300, 300),
TapiocaBall.textOverlay("text", 100, 10, 100, const Color(0xffffc0cb)),
];
final cup = Cup(Content(video.path), tapiocaBalls);
cup.suckUp(path).then((
) async {
print("finished");
print(path);
GallerySaver.saveVideo(path).then((bool? success) {
print(success.toString());
});

    setState(() {});
  });
} on Exception {
  print("error!!!!");
}

Fails to compile on android

Summary

When trying to compile example on android (once you've added the --ignore-deprecation flag) it fails and emits:

e: /Users/user/.pub-cache/hosted/pub.dartlang.org/tapioca-1.0.5+3/android/src/main/kotlin/me/anharu/video_editor/VideoEditorPlugin.kt: (27, 8): Class 'VideoEditorPlugin' is not abstract and does not implement abstract member public abstract fun onRequestPermissionsResult(p0: Int, p1: Array<(out) String!>, p2: IntArray): Boolean defined in io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener
e: /Users/user/.pub-cache/hosted/pub.dartlang.org/tapioca-1.0.5+3/android/src/main/kotlin/me/anharu/video_editor/VideoEditorPlugin.kt: (105, 5): 'onRequestPermissionsResult' overrides nothing

flutter doctor:

[✓] Flutter (Channel stable, 3.0.5, on macOS 12.5.1 21G83 darwin-arm, locale en-NZ)
    • Flutter version 3.0.5 at /Users/user/Development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1875d570e (9 weeks ago), 2022-07-13 11:24:16 -0700
    • Engine revision e85ea0e79c
    • Dart version 2.17.6
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0-rc1)
    • Android SDK at /Users/user/Library/Android/sdk
    • Platform android-33, build-tools 31.0.0-rc1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

react native?

Hi, first thanks for useful library, do you support react native?

video_processing_failed when add more than one text.

final tapiocaBalls = [ TapiocaBall.textOverlay("text",100,10,100,Color(0xffffc0cb)),];
 var tempDir = await getTemporaryDirectory();
 final path = '${tempDir.path}/result.mp4';
  final cup = Cup(Content(videoPath), tapiocaBalls);
   cup.suckUp(path).then((_) {
    print("finish processing"); 
   });

If I implement the above code for adding single text so it's working perfectly.
So my issue is if use the whole code inside of the loop and add more than one text so that time getting an error.

void videomakerMultipleWidgets() async {

for(int i = 0;i<listDragdrop.length;i++){
  
  if(listDragdrop[i].llWidget.runtimeType == Text){
    
    Text textwidget = listDragdrop[i].llWidget;
    
    TextStyle stylewidget= textwidget.style;
   
   final tapiocaBalls = [
      TapiocaBall.textOverlay(textwidget.data, listDragdrop[i].left.toInt(), listDragdrop[i].top.toInt(), 100, Color(0xffffc0cb)),
    ];

    var tempDir = await getTemporaryDirectory();
    final path = '${tempDir.path}/result2.mp4';
    final cup = Cup(Content(updatedFile.path), tapiocaBalls);
  await cup.suckUp(path).then((value) => {
      updatedFile = File(path),
 
    });
  }

}

ll_to(page: LLDummyScreen(mediaFile: updatedFile,isPicture: false,)); }

E/Mp4Composer( 3470): Unable to compose the engine
E/Mp4Composer( 3470): java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
E/Mp4Composer( 3470): at android.media.MediaMetadataRetriever.setDataSource(Native Method)
E/Mp4Composer( 3470): at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:321)
E/Mp4Composer( 3470): at com.daasuu.mp4compose.composer.Mp4ComposerEngine.compose(Mp4ComposerEngine.java:82)
E/Mp4Composer( 3470): at com.daasuu.mp4compose.composer.Mp4Composer$2.run(Mp4Composer.java:297)
E/Mp4Composer( 3470): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/Mp4Composer( 3470): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/Mp4Composer( 3470): at java.lang.Thread.run(Thread.java:923)
I/System.out( 3470): java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
E/flutter ( 3470): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: PlatformException(video_processing_failed, video processing is failed., null, null)
E/flutter ( 3470): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:581:7)
E/flutter ( 3470): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:158:18)
E/flutter ( 3470):
E/flutter ( 3470): #2 VideoEditor.writeVideofile (package:tapioca/src/video_editor.dart:14:5)
E/flutter ( 3470):
E/flutter ( 3470): #3 _LLShortVideo_PictureSaveScreenState.videomakerMultipleWidgets. (package:legit/LLScreen/LLShortVideo_PictureSaveScreen.dart)
E/flutter ( 3470):
E/flutter ( 3470):

Android Video output not playing any browser

Hi, i tried adding text overlay on video. but the video output file from android app not supporting in any browser(only able to hear voice, video frame is not showing up). whereas video from iOS is working fine in browser. can you please help me to solve this. thanks in advance.

Result file size is too big

I just add simple text and have results:
Origin file 1,48MB to > 10MB
Origin file 10,61MB to > 26MB
and it doesn't add new lines even though text has extra lines

Feature Request: Ability to Remove Filters (Tapioca Balls) Once Applied

Description of the Issue:
Currently, the Tapioca package for Flutter lacks the functionality to remove filters (tapiocaBalls) once they have been applied. This limitation hinders users from dynamically adjusting or removing filters without having to reprocess the entire video from the original source.

Current Implementation:
When adding a filter, we use the following code:

final cup = Cup(Content(inputPath), tapiocaBalls ?? []);
await cup.suckUp(outputPath);

Once the filter is applied, there is no provided method to remove or reset the applied filter from the video.

Proposed Feature:
Introduce a method or functionality within the Tapioca package that allows users to remove or reset the applied filters (tapiocaBalls) without needing to reprocess the video from scratch. This will enable more flexible and dynamic video editing capabilities.

Benefits:

  1. Improved user experience by allowing dynamic changes to video filters.
  2. Increased flexibility in video editing workflows.
  3. Reduced processing time and resource usage by avoiding reprocessing the entire video.
// Applying a filter
final cup = Cup(Content(inputPath), [tapiocaBall]);
await cup.suckUp(outputPath);

// Removing the applied filter
await cup.removeTapiocaBall(outputPath); 

If anyone have implementatoin regarding the removing/ clearing functionality :

await cup.removeTapiocaBall(outputPath); 

then please make a Pull Request and merge in the main, so others can use also.

Additional Information:
If there are existing workarounds or suggestions for achieving this functionality with the current version of the package, please provide guidance.

Thank you for considering this feature request!

App crashes while processing video

When running the example project on iOS, the app crashes with the following error

2021-03-06 18:20:04.090003+0900 Runner[33367:2019938] flutter: clicked!
2021-03-06 18:20:08.659434+0900 Runner[33367:2019938] flutter: /Users/<USERNAME>/Library/Developer/CoreSimulator/Devices/899678CD-E107-4F59-B876-A3C50CCC93AE/data/Containers/Data/Application/29AF98C2-387B-4090-AC98-FB546CB27593/tmp/trim.F38E201F-547E-4ED9-BCF8-425758833DA2.MOV
2021-03-06 18:20:08.691215+0900 Runner[33367:2019938] flutter: Directory: '/Users/<USERNAME>/Library/Developer/CoreSimulator/Devices/899678CD-E107-4F59-B876-A3C50CCC93AE/data/Containers/Data/Application/29AF98C2-387B-4090-AC98-FB546CB27593/Library/Caches'
eee
tabunn
Optional((304.0, 100.0))
file:///Users/<USERNAME>/Library/Developer/CoreSimulator/Devices/899678CD-E107-4F59-B876-A3C50CCC93AE/data/Containers/Data/Application/29AF98C2-387B-4090-AC98-FB546CB27593/Library/Caches/result.mp4
2021-03-06 18:20:09.033009+0900 Runner[33367:2019694] [] [18:20:09.033] H264VideoDecoder_SetProperty signalled err=-12900 (kVTPropertyNotSupportedErr) (unrecognised property key) at /Library/Caches/com.apple.xbs/Sources/CoreMediaH264SWLib_Bundle_Sim/CoreMediaH264SWLib-574/VCPAVC/H264VideoDecoder.c:1231
2021-03-06 18:20:09.033867+0900 Runner[33367:2019694] [] [18:20:09.034] VTCompressionSessionSetProperty signalled err=-12900 (kVTPropertyNotSupportedErr) (Unsupported property key (it's not in the SupportedPropertyDictionary)) at /Library/Caches/com.apple.xbs/Sources/EmbeddedCoreMedia_Sim/EmbeddedCoreMedia-2765.6/Sources/VideoToolbox/VTCompressionSession.c:2997
2021-03-06 18:20:09.211986+0900 Runner[33367:2020315] Metal API Validation Enabled

The following error was output in the stack trace of XCode

Thread 40 Queue : com.apple.coremedia.basicvideocompositor.output (serial)
Thread 40: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)

error: initializer for conditional binding must have Optional type, not 'AVAssetTrack'

I get the following error when I run on Xcode 12.3.0, Flutter 2.0.0, tapioca ^1.0.1

/Users/distiller/flutter/.pub-cache/hosted/pub.dartlang.org/tapioca-1.0.1/ios/Classes/VideoGeneratorService.swift:20:11: error: initializer for conditional binding must have Optional type, not 'AVAssetTrack'
        guard let videoTrack:AVAssetTrack = vtrack[0] else {

[wanted]Looking for collaborators

now, Due to studying for college entrance exams(Feb 2022), I can not manage the repository.
I want to develop the repo to add new features after finishing the exam.
Please manage the repo while i am studying for this.
Could you manage the repo?
Are there someone to manage it?

'onRequestPermissionsResult' overrides nothing

C:\Users\user\Downloads\tapioca-master\tapioca-master\android\src\main\kotlin\me\anharu\video_editor\VideoEditorPlugin.kt: (27, 8): Class 'VideoEditorPlugin' is not abstract and does not implement abstract member public abstract fun onRequestPermissionsResult(p0: Int, p1: Array<(out) String!>, p2: IntArray): Boolean defined in io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener
e: C:\Users\user\Downloads\tapioca-master\tapioca-master\android\src\main\kotlin\me\anharu\video_editor\VideoEditorPlugin.kt: (105, 5): 'onRequestPermissionsResult' overrides nothing

iOS image overlay does not work

Hi all
Currently, working on app that use tapioca for video overlay creation, on android everything works like a charm, but on ios image overlays are not working. Even when i build an example with pink color overlay, text and image, - first two TapioaBalls works, but no image on result video.

I am ready to be a contributor, cause i need this functionality asap. Can you send me a tutorial how to build ?
iOS 15.3 (Iphone 11)
P.S. Same result for iOS emulator, no image overlay
Thank you!

Add Full Screen Image Overlay Option

I recently discovered this repository, but when implementing it, I needed my Bitmap to fit 100% of the height and width of the video (very useful for working with layers of processes, where I insert text enriched with emojis, capture them as an image and insert them into the video). I searched for several ways from Flutter, but since I was not successful, I made some modifications. I created a GlImageOverlayFilterFull on Android and I am working on getting the same result on IOS.

If you would like to add this feature, just let me know and I will create a pull request.

Video-Path is not generated in Android Real device.

I have tried so many times to generate the video with Logo and text as watermark in Android Real device, but it stuck and doing long process and It could not generated any video path in Android real device. I used latest package.
Yeah It's working fine in iOS device but not Android real device. Any solution ? please help.
Below my code:

final generatedDestinationPath = await getOutputVideoPath();
final tapiocaBalls = [
TapiocaBall.textOverlay(timeStamp, 20, 35, 24, Colors.orange),
];
final cup = Cup(Content(outputVideoPath), tapiocaBalls);
await cup.suckUp(generatedDestinationPath).then((
) async {
if (await File(outputVideoPath).exists()) {
await File(outputVideoPath).delete();
}
Navigator.of(GlobalVariable.navigatorState.currentContext!)
.pop(); // Dismiss the dialog.
Navigator.of(GlobalVariable.navigatorState.currentContext!).push(
MaterialPageRoute(
builder: (_) => VideoAndPhotoPreviewScreen(
filePath: generatedDestinationPath,
isTypeVideo: true,
),
),
);
})

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.