Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Camera Filter using JavaCV #332

Open
DanhDue opened this issue Feb 16, 2016 · 1 comment
Open

Android Camera Filter using JavaCV #332

DanhDue opened this issue Feb 16, 2016 · 1 comment

Comments

@DanhDue
Copy link

DanhDue commented Feb 16, 2016

Hi
I'm Newbie, I found a custom android camera app which using JavaCV(https://github.com/sourab-sharma/TouchToRecord).
I want add filter string command into RecorderThread.java class in this app. I added string command with colorchannelmixer param into FFmpegFrameFilter string command as:

  1. String cropVideo = "crop=w=" + Config.CAMERA_CONSTANTS.OUTPUT_WIDTH + ":h=" + Config.CAMERA_CONSTANTS.OUTPUT_HEIGHT + ":x=" + 0 + ":y=" + 0;
  2. String rotateVideoFrontCam = "transpose=cclock,hflip,colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131," + cropVideo;
  3. String rotateVideoBackCam = "transpose=clock,colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131," + cropVideo;
    String cropVideoFrontCam = "hflip,colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131," + cropVideo;
  4. filterRotateVideoFrontCam = new FFmpegFrameFilter(rotateVideoFrontCam, previewWidth, previewHeight);
  5. filterRotateVideoFrontCam.setPixelFormat(avutil.AV_PIX_FMT_NV21);

But, I do not understand colorchannelmixer params and FFmpeg homepage have 2 example:

  1. Convert source to grayscale: colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
  2. Simulate sepia tones: colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131

I have 2 question:

  • How exactly to add params to colorchannelmixer params and change them?
  • Have other solution for resolv this problem?

Thank so much!

@saudet
Copy link
Member

saudet commented Feb 20, 2016

This is a question about FFmpeg, right? If so, you're probably going to get more feedback posting that on one of their forums...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants