android-ffmpeg

How to crop video with ffmpeg library in Android?

旧时模样 提交于 2019-12-06 15:31:13
To crop video in Android app I use ffmpeg library In SO example I found for cropping the video the following command: ffmpeg -i in.mp4 -filter:v "crop=out_w:out_h:x:y" out.mp4 I created a String array: String[] cmd = {"ffmpeg", "-i", originalVideoPath, "-vf", "\"crop=" + imageWidth + ":" + imageHeight + ":" + xCoordinate + ":" + yCoordinate + "\"", "-c:a", "copy", croppedVideoPath}; And I pass this array to execute() method: try { ffmpeg = FFmpeg.getInstance(getContext()); ffmpeg.execute(cmd, new ExecuteBinaryResponseHandler() { @Override public void onStart() { Log.i(TAG, "onStart: Crop Video

ffmpeg output separate channel from an input with multiple channels

我的梦境 提交于 2019-12-06 02:36:31
问题 i run this command to be able to stream a udp live stream to a http live stream that is playable using a mobile application that am building. its just a stream with audio streams only. ffmpeg -i udp://@localhost:1111 -map 0:a http://localhost:8090/feed1.ffm Input #0, mpegts, from 'udp://@localhost:1111': Duration: N/A, start: 54616.264622, bitrate: 768 kb/s Program 1 Metadata: service_name : Service 1 service_provider: TLK Stream #0:0[0x101]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz,

Xamarin Android merge audio files with FFMpeg

邮差的信 提交于 2019-12-05 11:54:01
I am using this binding library for FFMpeg: https://github.com/gperozzo/XamarinAndroidFFmpeg My goal is to mix two audio files. String s = "-i " + "test.wav" + " -i " + test2.mp3 + " -filter_complex amix=inputs=2:duration=first " + "result.mp3"; Device.BeginInvokeOnMainThread(async () => { await FFMpeg.Xamarin.FFmpegLibrary.Run(Forms.Context, s); }); So I have 2 input files: one is .mp3 and another one is .wav. I've tried also next commands: String s= "-i "+ "test.wav" +" -i "+ "test2.mp3" + " -filter_complex [0:0][1:0]concat=n=2:v=0:a=1[out] -map [out] " + "result.mp3"; String s = "-i " +

Error in building FFMPEG-3.4 with Android-NDK-16.1

余生长醉 提交于 2019-12-03 08:33:05
Trying to compile the FFMPEG-3.4 with Android-NDK-16.1. Compiling the source on Mac. Getting below Warnings/Errors: WARNING: /Users/strehan/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-pkg-config not found, library detection may fail. Error: In file included from libavdevice/avdevice.c:19:0:./libavutil/avassert.h:30:20: fatal error: stdlib.h: No such file or directory Error: /Users/strehan/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/include

FFMPEG : overlay image on video and retain size

ぃ、小莉子 提交于 2019-12-02 21:12:20
问题 I'm trying to overlay an image (transparent background with shape in the middle) "on top" of the video and get the image back. The image size is bigger then the video. Here is the command that I'm using: "-i", video.mp4, "-i", image.mp4, "-filter_complex", "[1:v][0:v]scale2ref=iw:ih[ovr][base];[ovr]colorchannelmixer=aa=1.0[ovrl];[base][ovrl]overlay[v]", "-map", "[v]", "-q:v", "2", directoryToStore + "/" + ImageName + ".jpeg" The above scales the image to the size of the video. I want the

Where do I find the Saved Image in Android?

时光怂恿深爱的人放手 提交于 2019-12-02 10:33:23
问题 Excuse me, quick question: I have this routine of video stream, where I receive packets, convert them to byte[] ,then to bitmaps, then display them on the screen: dsocket.receive(packetReceived); // receive packet byte[] buff = packetReceived.getData(); // convert packet to byte[] final Bitmap ReceivedImage = BitmapFactory.decodeByteArray(buff, 0, buff.length); // convert byte[] to bitmap image runOnUiThread(new Runnable() { @Override public void run() { // this is executed on the main (UI)

FFmpeg adding image watermark to video process is very slow

寵の児 提交于 2019-12-02 10:26:43
I am adding image watermark to video with help of FFmpeg but FFmpeg takes an inordinate amount of time with the below command- String[] cmd = {"-i",videoPath, "-i", waterMark.toString(),"-filter_complex","overlay=5:5","-codec:a", "copy", outputPath}; so i tried another command which was little bit faster but increase output file size(which i do not want) String[] cmd = {"-y","-i", videoPath, "-i", waterMark.toString(), "-filter_complex", "overlay=5:5", "-c:v","libx264","-preset", "ultrafast", outputPath}; Some one please explain to me how to increase the speed of FFmpeg watermarking speed

Where do I find the Saved Image in Android?

亡梦爱人 提交于 2019-12-02 03:52:10
Excuse me, quick question: I have this routine of video stream, where I receive packets, convert them to byte[] ,then to bitmaps, then display them on the screen: dsocket.receive(packetReceived); // receive packet byte[] buff = packetReceived.getData(); // convert packet to byte[] final Bitmap ReceivedImage = BitmapFactory.decodeByteArray(buff, 0, buff.length); // convert byte[] to bitmap image runOnUiThread(new Runnable() { @Override public void run() { // this is executed on the main (UI) thread imageView.setImageBitmap(ReceivedImage); } }); Now, I want to implementing a Recording feature.

Build FFMPEG 3.1.4 for Android

柔情痞子 提交于 2019-12-01 08:18:50
问题 I used this and this methods to build latest (3.1.4) FFMPEG version for Android. Build was succeed. I got several folders with sources / headers / .o files. But unfortunately there are no .so files I need. Are there some updated script for building latest FFMPEG for android? Or, how to convert .o and other files to .so ? 回答1: I've actually posted this as a few answers now. This works perfectly for ffmpeg 3.1.4: #!/bin/bash NDK=$HOME/Android/Sdk/ndk-bundle SYSROOT=$NDK/platforms/android-19

FFMPEG progress CANNOT LINK EXECUTABLE … ffmpeg: has text relocations

强颜欢笑 提交于 2019-11-29 17:07:48
I want to cut and merge the videos.I used FFMPEG. I have implemented this library https://github.com/WritingMinds/ffmpeg-android-java . When i tested in android 8.0(Oreao) version. I got this issue " CANNOT LINK EXECUTABLE ... ffmpeg: has text relocations". I found they opened issue for that... https://github.com/WritingMinds/ffmpeg-android-java/issues/141...is that any library that support all devices. Please anyone help me. This is a "known problem" and concerns x86 (not Arm). This problem is present in other libraries too which are based on FFMpeg. Here are some links where you can read