What I am doing for now though, is to record video and audio seperately, and then concatenate the two afterwards. However, when I do this with long videos/audio, I get an error:
Audio: 196616202
Audio: 196642325
Audio: 196668447
Audio: 196694570
Audio: 196720692
Audio: 196746815
Exception in thread "main" java.lang.RuntimeException: error -1094995529 decoding audio
at com.xuggle.mediatool.MediaReader.decodeAudio(MediaReader.java:549)
at com.xuggle.mediatool.MediaReader.readPacket(MediaReader.java:469)
at com.javadaemon.schoolxuggle.test.ConcatenateAudioAndVideo.concatenate(ConcatenateAudioAndVideo.java:164)
at com.javadaemon.schoolxuggle.test.ConcatenateAudioAndVideo.main(ConcatenateAudioAndVideo.java:87)
In Audio: x, x represents the timestamp from the IAudioSamples.
I am using the code from the tutorial at http://wiki.xuggle.com/Concatenating_Two_Files
I fear the error comes from the timestamp being too big, and eventually just overloading going into the negative bits, which in turn causes an error. Is there any way to fix this?
while (reader1.readPacket() == null);To:
while (reader2.readPacket() == null);
while(true) {
try {
IError error = reader1.readPacket()
if(error != null) {
System.err.println("Error decoding packet " + error.getDescription());
if(!reader1.isOpen()) break;
}
} catch(Exception e) {
System.err.println("Error decoding packet " + e.getMessage());
if(!reader1.isOpen()) break;
}
}
while(true) {
try {
IError error = reader2.readPacket()
if(error != null) {
System.err.println("Error decoding packet " + error.getDescription());
if(!reader2.isOpen()) break;
}
} catch(Exception e) {
System.err.println("Error decoding packet " + e.getMessage());
if(!reader2.isOpen()) break;
}
}
i've tried a gazillion ways to get around this timestamp bug but nothing seems to work. Let me know if you find anything that is a successful workaround.
--
You received this message because you are subscribed to the Google Groups "xuggler-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/xuggler-users/-/rr-K1doXCpIJ.
To post to this group, send email to xuggle...@googlegroups.com.
To unsubscribe from this group, send email to xuggler-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/xuggler-users?hl=en.