I have used xuggle library
in my project to trans code the video from mp4 to flv
.
I have used slf4j libraries
also to support logging end.
import com.xuggle.mediatool.IMediaReader;
import com.xuggle.mediatool.IMediaViewer;
import com.xuggle.mediatool.IMediaWriter;
import com.xuggle.mediatool.ToolFactory;
public class TranscodingExample {
private static final String inputFilename = "E:\VIDEO\Facebook.mp4";
private static final String outputFilename = "E:\VIDEO\Facebook.flv";
public static void main(String[] args) {
// create a media reader
IMediaReader mediaReader =
ToolFactory.makeReader(inputFilename);
// create a media writer
IMediaWriter mediaWriter =
ToolFactory.makeWriter(outputFilename, mediaReader);
// add a writer to the reader, to create the output file
mediaReader.addListener(mediaWriter);
// create a media viewer with stats enabled
IMediaViewer mediaViewer = ToolFactory.makeViewer(true);
// add a viewer to the reader, to see the decoded media
mediaReader.addListener(mediaViewer);
// read and decode packets from the source file and
// and dispatch decoded audio and video to the writer
while (mediaReader.readPacket() == null) ;
}
}
Here I am getting an error
"Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError.".
I have used both jar files as libraries in order to solve logging problems.
Does any one faced the same problem.If so kindly write suggestion or solution to come out of this mess.
Thanks in advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…