Skip to content
This repository was archived by the owner on May 30, 2023. It is now read-only.

Commit ee8ba1e

Browse files
committed
adding test package
1 parent 7fc3633 commit ee8ba1e

File tree

4 files changed

+67
-2
lines changed

4 files changed

+67
-2
lines changed

src/org/ffmpeg/android/FfmpegController.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,16 @@ public MediaDesc convertToMP4Stream (MediaDesc mediaIn, String outPath, boolean
361361
cmd.add(mediaIn.duration);
362362
}
363363

364-
cmd.add(FFMPEGArg.ARG_VIDEOCODEC);
365-
cmd.add("copy");
364+
if (mediaIn.videoFilter == null)
365+
{
366+
cmd.add(FFMPEGArg.ARG_VIDEOCODEC);
367+
cmd.add("copy");
368+
}
369+
else
370+
{
371+
cmd.add("-vf");
372+
cmd.add(mediaIn.videoFilter);
373+
}
366374

367375
cmd.add(FFMPEGArg.ARG_VIDEOBITSTREAMFILTER);
368376
cmd.add("h264_mp4toannexb");
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package org.ffmpeg.android.test;
2+
3+
public class ConcatTest {
4+
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package org.ffmpeg.android.test;
2+
3+
public class ConvertTest {
4+
5+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package org.ffmpeg.android.test;
2+
3+
import java.io.File;
4+
import java.util.ArrayList;
5+
6+
import org.ffmpeg.android.filters.DrawBoxVideoFilter;
7+
import org.ffmpeg.android.filters.DrawTextVideoFilter;
8+
import org.ffmpeg.android.filters.FadeVideoFilter;
9+
import org.ffmpeg.android.filters.VideoFilter;
10+
11+
import android.app.Activity;
12+
import android.content.Context;
13+
14+
public class FilterTest {
15+
16+
17+
public void test (Context context)
18+
{
19+
ArrayList<VideoFilter> listFilters = new ArrayList<VideoFilter>();
20+
21+
int height = 480;
22+
int width = 720;
23+
int lowerThird = height / 3;
24+
DrawBoxVideoFilter vf = new DrawBoxVideoFilter(0,height-lowerThird,width,lowerThird,100,"blue",context);
25+
26+
DrawTextVideoFilter vfTitle =
27+
new DrawTextVideoFilter("Rikshaw Rock and Roll",
28+
DrawTextVideoFilter.X_CENTERED,DrawTextVideoFilter.Y_CENTERED,
29+
"green",
30+
38,
31+
new File("/system/fonts/DroidSerif-Regular.ttf"),
32+
true,
33+
"yellow",
34+
"0.5");
35+
36+
FadeVideoFilter vfFadeIn = new FadeVideoFilter("in",0,50);
37+
38+
int totalFrames = (int)(14.37*29.97);
39+
40+
FadeVideoFilter vfFadeOut = new FadeVideoFilter("out",totalFrames-50,50);
41+
42+
//listFilters.add(vfTitle);
43+
listFilters.add(vfFadeIn);
44+
listFilters.add(vfFadeOut);
45+
46+
}
47+
}

0 commit comments

Comments
 (0)