Neue Video-/Audio-Library
Also wenn
MediaManager.installNativeLibrary(true);
// enable file protocol
MediaManager.getInstance().registerProtocol(FileProtocol.URL_PREFIX, FileProtocol.FACTORY);
// create Swing frame
JFrame frame = new JFrame();
frame.setSize(new Dimension(480, 300));
frame.setLayout(new BorderLayout());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// add Java2D-based video renderer to Swing frame
final IVideoRenderer renderer = new Java2DRenderer();
frame.add(renderer.getVisualComponent());
// show frame
frame.setVisible(true);
// open movie file & find stream info (resolution, audio channels,...)
AVFormatContext formatContext = AVFormatContext.openFile(FileProtocol.computeUrl(new File("samples/elephantsdream.avi")));
formatContext.findStreamInfo();
// create media player
final MediaPlayer player = new MediaPlayer(renderer);
player.open(formatContext);
alles ist, was man für ein Video abzuspielen bracht, dann prima. pulsar (http://dev.getpulsar.com/) ist eine neue Open-Source Bib mit einer nativen Komponente, zum Abspielen von Audio und Video.
Pulsar includes a media library to encode, decode and playback audio and video files. Pulsar makes use of projects like FFmpeg, X264, liba52, FAAD2 and LAME to support a variety of codecs like MPEG, H.264, AC3 and MP3. The input can be a local file, a HTTP stream or an arbitrary other input implementing IMediaProtocol. The media library is distributed in two files, a Java library "pulsar_media.jar" and a native library "pulsar_media.*". There are precompiled versions of the native library for Windows, Mac OS X and Linux.
Labels: Java, Open Source

0 Comments:
Kommentar veröffentlichen
<< Home