title: No sound is captured in video created using FFmpegFrameGrabber, FrameRecorder JavaCv in android
body: <p>I am trying to apply Grayscale effect to a video file using <strong>JavaCV</strong> in android.Everything is working fine but there is no audio present in the output file. Below is the code. Please Help </p>
  
  <pre><code>   File file = new File(Environment.getExternalStorageDirectory() + File.separator + "test3.mp4"); 
  
       FFmpegFrameGrabber frameGrabber = new FFmpegFrameGrabber(file.getAbsolutePath()); 
  
       FrameRecorder recorder = null; 
  
       Log.d("bharat", " Audio channels = " + frameGrabber.getAudioChannels()); // THIS IS RETurnING 0 and not 2
  
       recorder = new FFmpegFrameRecorder("/mnt/sdcard/streaml_t.mp4", 270, 480, frameGrabber.getAudioChannels()); 
  
       recorder.setVideoCodec(AV_CODEC_ID_H264); 
  
       recorder.setFormat("mp4"); 
  
       recorder.setFrameRate(frameGrabber.getFrameRate()); 
  
       recorder.setSampleFormat(frameGrabber.getSampleFormat()); 
  
       recorder.setSampleRate(frameGrabber.getSampleRate()); 
  
       try { 
       recorder.start();
       frameGrabber.start(); 
       int count = 0;      
       while (true) { 
  
       try { 
  
       Frame grabFrame = frameGrabber.grabFrame(); 
       Log.d("bharat:", "frame " + count++); 
  
       if (grabFrame == null) { 
       System.out.println("!!! Failed cvQueryFrame"); 
       break; 
  
       } 
  
       IplImage frame_copy = cvCreateImage(cvSize(grabFrame.image.width(), grabFrame.image.height()), IPL_DEPTH_8U, 1); 
  
       cvCvtColor(grabFrame.image, frame_copy, CV_RGB2GRAY); 
       grabFrame.image = frame_copy; 
       recorder.setTimestamp(frameGrabber.getTimestamp());
       recorder.record(grabFrame); 
       } catch (Exception e) { 
          e.printStackTrace();
       } 
  
       } 
  
       Log.d("bharat:", "frame done"); 
  
       recorder.stop(); 
       recorder.release(); 
  
       } catch (Exception e) { 
  
       e.printStackTrace(); 
  
       } 
  
       }
  </code></pre>
  
  <p>P. S :  I found that frameGrabber.getAudioChannels() is returning 0 and not 2 (in case it helps)</p>