Page 1 of 1

Embedded Media Player playback quality and latency

Posted: 13 Oct 2011 18:10
by yasdnil1
How do I make the playback quality of an Embedded Media Player as good as it is with the VLC player?? Also, how do I cut the latency/ lag? I feel like I've tried soo many settings and it still isn't good. There's probably stuff I don't need, but I didn't know what to include or exclude so I included everything. It's playing an rtsp stream (rtsp://172.xx.xx.xx), that's in H.264 format. I'm using VLC 1.1.8 and vlcj 1.1.5.1. It seems to have good performance for a few seconds and then the video freezes and jumps ahead to the latest frames, which gives the appearance of bad latency. Also, the video can becomes fragmented. What are the best/optimal settings for the best playback quality and latency for the embedded media player?? Any suggestions would be appreciated. Please help, I'm at a loss.
Here are the settings I'm using:

private MediaPlayerFactory mediaPlayerFactory;
private EmbeddedMediaPlayer mediaPlayer;

List<String> vlcArgs = new ArrayList<String>();
vlcArgs.add( "--no-video-title-show" );
vlcArgs.add( "--no-snapshot-preview" );
vlcArgs.add( "--no-drop-late-frames" );
vlcArgs.add( "--no-skip-frames" );
vlcArgs.add( "--no-ffmpeg-hurry-up" );
vlcArgs.add( "--ffmpeg-hw" );
vlcArgs.add( "--rtsp-caching=0" );
vlcArgs.add( "--realrtsp-caching=0" );
vlcArgs.add( "--sout-rtp-caching=0" );
vlcArgs.add( "--network-caching=0" );
vlcArgs.add( "--screen-caching=0" );
vlcArgs.add( "--rtp-caching=0" );
vlcArgs.add( "--sout-mux-caching=0" );
vlcArgs.add( "--file-caching=0" );
vlcArgs.add( "--postproc-q=0" );
vlcArgs.add( "--no-audio" );
vlcArgs.add( "--no-hq-resampling" );
vlcArgs.add( "--no-quiet" );

mainFrame = new JFrame( "VLC" );
FullScreenStrategy fullScreenStrategy = new DefaultFullScreenStrategy( mainFrame );
mediaPlayerFactory = new MediaPlayerFactory( vlcArgs.toArray( new String[vlcArgs.size()] ) );

mediaPlayer = mediaPlayerFactory.newMediaPlayer( fullScreenStrategy );
mediaPlayer.setVideoSurface( canvas );
mediaPlayer.setPlaySubItems( true );
mediaPlayer.prepareMedia( currentSource );
mediaPlayer.play();

Re: Embedded Media Player playback quality and latency

Posted: 13 Oct 2011 19:15
by RĂ©mi Denis-Courmont
Do you really expect 0 milliseconds caching to work? That's most probably the reason why it's crashing.