8 | /// @class overlay overlay one image or video on top of another
9 | ///
10 | /// @desc x is the x coordinate of the overlayed video on the main video,
11 | /// y is the y coordinate. The parameters are expressions containing
12 | /// the following parameters:
13 | ///
14 | /// main_w, main_h
15 | /// main input width and height
16 | ///
17 | /// W, H
18 | /// same as main_w and main_h
19 | ///
20 | /// overlay_w, overlay_h
21 | /// overlay input width and height
22 | ///
23 | /// w, h
24 | /// same as overlay_w and overlay_h
25 | ///
26 | /// @examples
27 | /// draw the overlay at 10 pixels from the bottom right
28 | /// corner of the main video.
29 | /// main_w-overlay_w-10
30 | /// main_h-overlay_h-10
31 | /// draw the overlay in the bottom left corner of the input
32 | /// 10
33 | /// main_h-overlay_h-10 [out]
34 | ///
35 | ///
36 | public class OverlayVideoFilter : VideoFilter
37 | {
38 |
39 | public File overlayFile;
40 | public string xParam, yParam;
41 |
42 | public OverlayVideoFilter()
43 | {
44 |
45 | }
46 |
47 | public OverlayVideoFilter(File fileMovieOverlay, int x, int y)
48 | {
49 | this.overlayFile = fileMovieOverlay;
50 | this.xParam = Convert.ToString(x);
51 | this.yParam = Convert.ToString(y);
52 | }
53 |
54 | public OverlayVideoFilter(File fileMovieOverlay, string xExpression, string yExpression)
55 | {
56 | this.overlayFile = fileMovieOverlay;
57 | this.xParam = xExpression;
58 | this.yParam = yExpression;
59 | }
60 |
61 | public override string FilterString
62 | {
63 | get
64 | {
65 | if (overlayFile != null)
66 | {
67 | return "movie=" + overlayFile.AbsolutePath + " [logo];[in][logo] " + "overlay=" + xParam + ":" + yParam + " [out]";
68 | }
69 | else
70 | {
71 | return "";
72 | }
73 |
74 | }
75 | }
76 | }
77 |
78 | //"\"movie="+ overlayImage.getPath() +" [logo];[in][logo] overlay=0:0 [out]\"",
79 | }
--------------------------------------------------------------------------------
/XamarinAndroidFFmpeg/Helpers/ffmpeg/filters/RedactVideoFilter.cs:
--------------------------------------------------------------------------------
1 | using Java.IO;
2 |
3 | namespace XamarinAndroidFFmpeg
4 | {
5 |
6 | public class RedactVideoFilter : VideoFilter
7 | {
8 |
9 | private File fileRedactList;
10 |
11 | public RedactVideoFilter(File fileRedactList)
12 | {
13 | this.fileRedactList = fileRedactList;
14 | }
15 |
16 | public override string FilterString
17 | {
18 | get
19 | {
20 | if (fileRedactList != null)
21 | {
22 | return "redact=" + fileRedactList.AbsolutePath;
23 | }
24 | else
25 | {
26 | return "";
27 | }
28 |
29 | }
30 | }
31 | }
32 |
33 | //redact=blurbox.txt [out] [d], [d]nullsink
34 | //"redact=" + Environment.getExternalStorageDirectory().getPath() + "/" + PACKAGENAME + "/redact_unsort.txt",
35 | }
--------------------------------------------------------------------------------
/XamarinAndroidFFmpeg/Helpers/ffmpeg/filters/TransposeVideoFilter.cs:
--------------------------------------------------------------------------------
1 | namespace XamarinAndroidFFmpeg
2 | {
3 | /*
4 | * works for video and images
5 | * 0 = 90CounterCLockwise and Vertical Flip (default)
6 | 1 = 90Clockwise
7 | 2 = 90CounterClockwise
8 | 3 = 90Clockwise and Vertical Flip
9 | */
10 | public class TransposeVideoFilter : VideoFilter
11 | {
12 | private int mTranspose = -1;
13 |
14 | public const int NINETY_COUNTER_CLOCKWISE_AND_VERTICAL_FLIP = 0;
15 | public const int NINETY_CLOCKWISE = 1;
16 | public const int NINETY_COUNTER_CLOCKWISE = 2;
17 | public const int NINETY_CLOCKWISE_AND_VERTICAL_FLIP = 3;
18 |
19 | public TransposeVideoFilter(int transpose)
20 | {
21 | mTranspose = transpose;
22 | }
23 |
24 | public override string FilterString
25 | {
26 | get
27 | {
28 | return "transpose=" + mTranspose;
29 | }
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/XamarinAndroidFFmpeg/Helpers/ffmpeg/filters/VideoFilter.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Text;
3 |
4 | namespace XamarinAndroidFFmpeg
5 | {
6 |
7 |
8 | public abstract class VideoFilter
9 | {
10 |
11 | public abstract string FilterString {get;}
12 |
13 | public static string Build(List