I am using xuggler and convert video of flv,mov,mpeg,avi,wmv into mp4 but it give me error.

1,209 views
Skip to first unread message

tapan kushwaha

unread,
Jul 17, 2013, 6:15:39 AM7/17/13
to xuggle...@googlegroups.com
My Code is :
public class ConvertVideo extends MediaToolAdapter implements Runnable {

private int VIDEO_WIDTH = 712;
private int VIDEO_HEIGHT = 429;
private IMediaWriter writer;
private IMediaReader reader;
private File outputFile;

public ConvertVideo(File inputFile, File outputFile) {
System.out.println("inside ConvertVideo");
this.outputFile = outputFile;
reader = ToolFactory.makeReader(inputFile.getAbsolutePath());
reader.addListener(this);
}
private IVideoResampler videoResampler = null;
private IAudioResampler audioResampler = null;

@Override
public void onAddStream(IAddStreamEvent event) {
int streamIndex = event.getStreamIndex();
IStreamCoder streamCoder = event.getSource().getContainer().getStream(streamIndex).getStreamCoder();
if (streamCoder.getCodecType() == ICodec.Type.CODEC_TYPE_AUDIO) {
writer.addAudioStream(streamIndex, streamIndex, 2, 44100);
} else if (streamCoder.getCodecType() == ICodec.Type.CODEC_TYPE_VIDEO) {
streamCoder.setWidth(VIDEO_WIDTH);
streamCoder.setHeight(VIDEO_HEIGHT);
writer.addVideoStream(streamIndex, streamIndex, VIDEO_WIDTH, VIDEO_HEIGHT);
}
super.onAddStream(event);
}

@Override
public void onVideoPicture(IVideoPictureEvent event) {
IVideoPicture pic = event.getPicture();
if (videoResampler == null) {
videoResampler = IVideoResampler.make(VIDEO_WIDTH, VIDEO_HEIGHT,
pic.getPixelType(), pic.getWidth(), pic.getHeight(),
pic.getPixelType());
}
IVideoPicture out = IVideoPicture.make(pic.getPixelType(), VIDEO_WIDTH,
VIDEO_HEIGHT);
videoResampler.resample(out, pic);

IVideoPictureEvent asc = new VideoPictureEvent(event.getSource(), out,
event.getStreamIndex());
super.onVideoPicture(asc);
out.delete();
}

@Override
public void onAudioSamples(IAudioSamplesEvent event) {
IAudioSamples samples = event.getAudioSamples();
if (audioResampler == null) {
audioResampler = IAudioResampler.make(2, samples.getChannels(),
44100, samples.getSampleRate());
}
if (event.getAudioSamples().getNumSamples() > 0) {
IAudioSamples out = IAudioSamples.make(samples.getNumSamples(),
samples.getChannels());
audioResampler.resample(out, samples, samples.getNumSamples());

AudioSamplesEvent asc = new AudioSamplesEvent(event.getSource(),
out, event.getStreamIndex());
super.onAudioSamples(asc);
out.delete();
}
}

@Override
public void run() {
writer = ToolFactory.makeWriter(outputFile.getAbsolutePath(), reader);
this.addListener(writer);
while (reader.readPacket() == null) {

}
}

public static void main(String[] args) {

try {

File file = new File("D:\\sample.mp4");
file.createNewFile();

ConvertVideo obj = new ConvertVideo(new File("D:\\Kids25.avi"),file);

obj.run();

} catch (Exception e) {

e.printStackTrace();
}

}

}


Error is Given to me is :

nside ConvertVideo
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/D:/Net-BeanProjects/Zoopem/web/WEB-INF/lib/logback-classic.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/Net-BeanProjects/Zoopem/web/WEB-INF/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: The requested version 1.5.6 by your slf4j binding is not compatible with [1.6]
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.
2013-07-17 15:44:35,426 [main] ERROR org.ffmpeg - [msmpeg4 @ 0x23f1a0] ext header missing, 16 left
2013-07-17 15:44:36,364 [main] ERROR org.ffmpeg - [msmpeg4 @ 0x23f1a0] ext header missing, 16 left
2013-07-17 15:44:39,386 [main] ERROR org.ffmpeg - [msmpeg4 @ 0x23f1a0] ext header missing, 16 left
2013-07-17 15:44:40,382 [main] ERROR org.ffmpeg - [msmpeg4 @ 0x23f1a0] ext header missing, 16 left
2013-07-17 15:44:44,368 [main] ERROR org.ffmpeg - [msmpeg4 @ 0x23f1a0] ext header missing, 16 left
2013-07-17 15:44:45,804 [main] ERROR org.ffmpeg - [mp3 @ 0x23fb80] incomplete frame
java.lang.RuntimeException: error -1 decoding audio
at com.xuggle.mediatool.MediaReader.decodeAudio(MediaReader.java:549)
at com.xuggle.mediatool.MediaReader.readPacket(MediaReader.java:469)
at com.imperialems.eventplanning.servlet.network.ConvertVideo.run(ConvertVideo.java:94)
at com.imperialems.eventplanning.servlet.network.ConvertVideo.main(ConvertVideo.java:108)
BUILD SUCCESSFUL (total time: 17 seconds)

tapan kushwaha

unread,
Jul 17, 2013, 11:57:44 PM7/17/13
to xuggle...@googlegroups.com
Can anybody help me out xuggler Mp4 problem

bapusaheb chitale

unread,
Dec 25, 2015, 11:56:26 AM12/25/15
to xuggler-users
Remove SLF4J jar, add

only slf4j.jar

and


log4j-1.2.16.jar

you will easly found this jars on web....

Ketan Kulkarni

unread,
Dec 26, 2015, 5:10:17 AM12/26/15
to xuggler-users
@Mr.Bapusaheb

Can you specify the exact jar files to be used for executing xuggler code on windows 8??

Bapusaheb Chitale

unread,
Dec 26, 2015, 5:20:59 AM12/26/15
to xuggle...@googlegroups.com

Remove all jar add only 3 jar mention bellow.

slf4j.jar

log4j- 1. 2. 16. jar

Xuggler-xuggler 5. 4. jar  34mb size.

On Dec 26, 2015 3:40 PM, "Ketan Kulkarni" <ketanku...@gmail.com> wrote:
@Mr.Bapusaheb

Can you specify the exact jar files to be used for executing xuggler code on windows 8??

--
You received this message because you are subscribed to a topic in the Google Groups "xuggler-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xuggler-users/9pqji4hDwdU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xuggler-user...@googlegroups.com.
To post to this group, send email to xuggle...@googlegroups.com.
Visit this group at https://groups.google.com/group/xuggler-users.
For more options, visit https://groups.google.com/d/optout.

Ketan Kulkarni

unread,
Dec 26, 2015, 8:54:26 AM12/26/15
to xuggler-users
Sir,
Thanks a lot for your reply but it isn't working in netbeans.Can you please suggest me something more that needs to be done to make it happen??
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Bapusaheb Chitale

unread,
Dec 26, 2015, 8:59:54 AM12/26/15
to xuggle...@googlegroups.com

What is the exact error shown.

On Dec 26, 2015 7:24 PM, "Ketan Kulkarni" <ketanku...@gmail.com> wrote:
Sir,
Thanks a lot for your reply but it isn't working in netbeans.Can you please suggest me something more that needs to be done to make it happen??

Ketan Kulkarni

unread,
Dec 26, 2015, 9:08:06 AM12/26/15
to xuggler-users

Ketan Kulkarni

unread,
Dec 26, 2015, 9:11:45 AM12/26/15
to xuggler-users
Error:

Exception in thread "main" java.lang.NoClassDefFoundError: ch/qos/logback/core/joran/spi/JoranException
at org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:189)
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:112)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:105)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:235)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:208)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:221)
at com.xuggle.ferry.JNILibrary.<clinit>(JNILibrary.java:42)
at com.xuggle.ferry.FerryJNI.<clinit>(FerryJNI.java:14)
at com.xuggle.ferry.Ferry.<clinit>(Ferry.java:25)
at com.xuggle.xuggler.XugglerJNI.<clinit>(XugglerJNI.java:19)
at com.xuggle.xuggler.IContainer.<clinit>(IContainer.java:1622)
at com.xuggle.mediatool.MediaReader.<init>(MediaReader.java:137)
at com.xuggle.mediatool.ToolFactory.makeReader(ToolFactory.java:77)
at cutter.Cutter.<init>(Cutter.java:56)
at cutter.Cutter.main(Cutter.java:47)
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.core.joran.spi.JoranException
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 15 more
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)

Ketan Kulkarni

unread,
Dec 26, 2015, 9:15:38 AM12/26/15
to xuggler-users
I have also attached the code
cutter.java.txt
MyConcatenate.txt

Bapusaheb Chitale

unread,
Dec 28, 2015, 12:12:59 AM12/28/15
to xuggle...@googlegroups.com
Dear ketan Add Following jars. and try once.


xuggle-xuggler-5.4.jar

slf4j-log4j12.jar

slf4j-log4j12-1.6.0-rc0.jar

slf4j.jar

log4j-1.2.16.jar


its Work for me, Try once.

--
You received this message because you are subscribed to a topic in the Google Groups "xuggler-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xuggler-users/9pqji4hDwdU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xuggler-user...@googlegroups.com.
To post to this group, send email to xuggle...@googlegroups.com.
Visit this group at https://groups.google.com/group/xuggler-users.
For more options, visit https://groups.google.com/d/optout.



--


With Warm Regards,
Bapusaheb Chitale.
9657024424 / 7756954800


PS: Please Don't Print This E-Mail Unless You Really Need To. Save Trees, Save Our Mother Earth!
Reply all
Reply to author
Forward
0 new messages