After a lot of struggle I finally did what I want, i.e., save filters using ffmpeg now for now I'm using the Vintage filter command line from FFMPEG in order to add Vintage Filter to it. But there is a certain problem, and the problem is that The output is coming 90 degree clockwise rotated which is not what I wanted.
I've used this command from FFMPEG documentation, and the vintage filter application is working fine.
String complexCommand[] = {"-y", "-i", stringBuilder.toString(), "-strict", "experimental", "-vf", "curves=vintage",
"-s", "640x480", "-r", "30", "-aspect", "4:3", "-ab",
"48000","-ac", "2", "-ar", "22050", "-b:a", "2097k", "-vcodec", "mpeg4", savingPath};
I've read about how to do the rotation from this link : Video Rotation using FFMPEG
Now what I've tried is rotating the video 90 degree counterclockwise which transpose=2 after -vf from the documentation.
1.This is what I've done :
String complexCommand[] = {"-y", "-i", stringBuilder.toString(), "-strict", "experimental", "-vf", "transpose=2", "curves=vintage",
"-s", "640x480", "-r", "30", "-aspect", "4:3", "-ab",
"48000","-ac", "2", "-ar", "22050", "-b:a", "2097k", "-vcodec", "mpeg4", savingPath};
But I got this problem in my logcat, i.e.,
[NULL @ 0xaaab0c00] Unable to find a suitable output format for 'curves=vintage' curves=vintage: Invalid argument
2. I've also done this in order to get the desired result :
String complexCommand[] = {"-y", "-i", stringBuilder.toString(), "-strict", "experimental", "-vf", "transpose=2",
"-s", "640x480", "-r", "30", "-aspect", "4:3", "-ab",
"48000","-ac", "2", "-ar", "22050", "-b:a", "2097k", "-vcodec", "mpeg4", savingPath};
Now from above the result is fine, without any filter.
3. I've tried this also which was my last attempt to do that :
String complexCommand[] = {"-y", "-i", stringBuilder.toString(), "-strict", "experimental", "-vf", "curves=vintage", "-vf", "transpose=2",
"-s", "640x480", "-r", "30", "-aspect", "4:3", "-ab",
"48000","-ac", "2", "-ar", "22050", "-b:a", "2097k", "-vcodec", "mpeg4", savingPath};
Here is what I have changed : "-vf", "curves=vintage", "-vf","transpose=2"
But the result was same as in the second, only the rotated video, no fiters applied to the video.
I'm in need of the result as I've reached close to my destination but the problem is there and I need the result as the filtered video with the rotated form and that has to be implemented in the string only.
I think there is some issue with the string before -vf as the video is getting rotated before -vf and when I apply transpose then the correct result comes. Any suggestion would be appreciated.
EDITS
I've tried using this too, the && in between the command in order to get the result but I'm getting this error in my logcat :
E/MediaMetadataRetrieverJNI: getFrameAtTime: videoFrame is a NULL pointer
What I've done is :
String complexCommand[] = {"-y", "-i", stringBuilder.toString(), "-strict", "experimental", "-vf", "curves=vintage",
"&&", "-vf", "transpose=2", "-s", "720x720", "-r", "30", "-aspect", "4:3", "-ab",
"48000","-ac", "2", "-ar", "22050", "-b:v", "2097k", "-vcodec", "mpeg4", savingPath};