Error while merging videos(No audio output stream (Is audioChannels > 0 and has start() been called?))

860 views
Skip to first unread message

Ram

unread,
Nov 9, 2014, 3:13:49 AM11/9/14
to jav...@googlegroups.com
Hi,

       I am getting error while i am trying to merge two videos. How to solve this.I am using javacv 0.9.


11-09 13:38:33.702: W/System.err(2147): org.bytedeco.javacv.FrameRecorder$Exception: No audio output stream (Is audioChannels > 0 and has start() been called?)
11-09 13:38:33.702: W/System.err(2147):     at org.bytedeco.javacv.FFmpegFrameRecorder.record(FFmpegFrameRecorder.java:738)
11-09 13:38:33.712: W/System.err(2147):     at org.bytedeco.javacv.FrameRecorder.record(FrameRecorder.java:293)
11-09 13:38:33.712: W/System.err(2147):     at com.example.videomerging.MainActivity.onCreate(MainActivity.java:39)
11-09 13:38:33.712: W/System.err(2147):     at android.app.Activity.performCreate(Activity.java:4465)
11-09 13:38:33.712: W/System.err(2147):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
11-09 13:38:33.722: W/System.err(2147):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
11-09 13:38:33.722: W/System.err(2147):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
11-09 13:38:33.722: W/System.err(2147):     at android.app.ActivityThread.access$600(ActivityThread.java:123)
11-09 13:38:33.722: W/System.err(2147):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
11-09 13:38:33.722: W/System.err(2147):     at android.os.Handler.dispatchMessage(Handler.java:99)
11-09 13:38:33.732: W/System.err(2147):     at android.os.Looper.loop(Looper.java:137)
11-09 13:38:33.761: W/System.err(2147):     at android.app.ActivityThread.main(ActivityThread.java:4424)
11-09 13:38:33.761: W/System.err(2147):     at java.lang.reflect.Method.invokeNative(Native Method)
11-09 13:38:33.761: W/System.err(2147):     at java.lang.reflect.Method.invoke(Method.java:511)
11-09 13:38:33.761: W/System.err(2147):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
11-09 13:38:33.772: W/System.err(2147):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
11-09 13:38:33.772: W/System.err(2147):     at dalvik.system.NativeStart.main(Native Method)

Ram

unread,
Nov 9, 2014, 3:45:50 AM11/9/14
to jav...@googlegroups.com
Hi samuel,

        These are the videos i am using to merge.i attached here.among these files,1.mp4 is i am getting from javacv
(i.e images to video conversion).Let me know if any one know the solution.thanks
1.mp4
3.mp4

Samuel Audet

unread,
Nov 15, 2014, 5:17:53 AM11/15/14
to jav...@googlegroups.com
On 11/09/2014 05:45 PM, Ram wrote:
> Hi samuel,
>
> These are the videos i am using to merge.i attached here.among
> these files,1.mp4 is i am getting from javacv
> (i.e images to video conversion).Let me know if any one know the
> solution.thanks

Did you try to call setAudioChannels(1 or 2) before calling start()?

And please do not send large files on the mailing list, thank you!

Samuel

Ram

unread,
Nov 15, 2014, 6:45:28 AM11/15/14
to jav...@googlegroups.com
Hi samuel,
I have a doubt,I have two videos with different framerate means while I m merging that videos how to set frame rate?

Samuel Audet

unread,
Nov 24, 2014, 5:28:05 AM11/24/14
to jav...@googlegroups.com
On 11/15/2014 08:45 PM, Ram wrote:
> Hi samuel,
> I have a doubt,I have two videos with different framerate means while I m merging that videos how to set frame rate?
>

Set the output to the highest frame rate, and `setTimestamp()` to the
right value before calling `record()`. That will get you a variable
frame rate.

Samuel

Mihael Francekovic

unread,
Nov 25, 2014, 2:41:08 AM11/25/14
to jav...@googlegroups.com
Hi Samuel,

Could you please explain more how setTimestamp works and why frame rate doesn't matter then?

Thanks,
Mihael



--

--- You received this message because you are subscribed to the Google Groups "javacv" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javacv+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Samuel Audet

unread,
Dec 6, 2014, 4:05:02 AM12/6/14
to jav...@googlegroups.com
On 11/25/2014 04:41 PM, Mihael Francekovic wrote:
> Hi Samuel,
>
> Could you please explain more how setTimestamp works and why frame rate doesn't matter then?

The frame rate does matter. setTimestamp() basically just lets us skip
any number of frames, that's all!

Samuel

Jibin Sudhakaran

unread,
Feb 10, 2015, 4:58:47 AM2/10/15
to jav...@googlegroups.com
Hi Samuel,

Me also facing same issue 


No audio output stream (Is audioChannels > 0 and has start() been called?)
02-10 15:18:05.611    3829-3829/com.example.jibin.videpmaker W/System.err﹕ at org.bytedeco.javacv.FFmpegFrameRecorder.record(FFmpegFrameRecorder.java:740)
02-10 15:18:05.611    3829-3829/com.example.jibin.videpmaker W/System.err﹕ at org.bytedeco.javacv.FrameRecorder.record(FrameRecorder.java:293)

Can you help me to figure out the problem. 

Here is my code

FFmpegFrameRecorder recorder = new FFmpegFrameRecorder(Environment
.getExternalStorageDirectory().getPath()
+ System.currentTimeMillis()
+ ".mp4", this.getResources().getDisplayMetrics().widthPixels,
this.getResources().getDisplayMetrics().heightPixels);
// audio grabber
FrameGrabber grabber2 = new FFmpegFrameGrabber(Environment
.getExternalStorageDirectory().getPath() + "/abc.mp3");
grabber2.setAudioChannels(2);
try {

recorder.setVideoCodec(13); // CODEC_ID_MPEG4 //CODEC_ID_MPEG1VIDEO

recorder.setFrameRate(1); 
recorder.setPixelFormat(0); 
recorder.setSampleRate(grabber2.getSampleRate());
recorder.start();
            grabber2.start();
for (int i = 0; i < iplimage.length; i++) {

recorder.record(iplimage[i]);
Frame frame1 = grabber2.grabFrame();
//while (frame1 != null) {

recorder.record(frame1);
break;
//}
}
recorder.stop();
grabber2.stop();

Samuel Audet

unread,
Feb 15, 2015, 5:50:16 AM2/15/15
to jav...@googlegroups.com
On 02/10/2015 06:58 PM, Jibin Sudhakaran wrote:
>
> No audio output stream (Is audioChannels > 0 and has start() been called?)

You didn't call FrameRecorder.setAudioChannels(2) or something. Do that
and it should work.

Samuel
Reply all
Reply to author
Forward
0 new messages