2016-04-01 25 views
4

In einem Video-Player-Projekt möchte ich LibVLC http Streaming von einer langsamen Quelle verwenden.Min-Buffer-Schwelle für HTTP-/Netzwerk-Wiedergabe einstellen

Allerdings kann ich es nicht zu Stream FIRST bekommen, und dann kontinuierlich Daten herunterladen. Der Spieler wird immer dazwischen stehen bleiben.

Ich benutze VLC-Android von GIT.

Dies ist der Media Player Setup-Code:

ArrayList<String> options = new ArrayList<>(); 
options.add("--no-sub-autodetect-file"); 
options.add("--swscale-mode=0"); 
options.add("--network-caching=60000"); 

if (BuildConfig.DEBUG) { 
    options.add("-vvv"); // verbosity 
} 

libVLC = new LibVLC(options); 

mediaPlayer = new org.videolan.libvlc.MediaPlayer(libVLC); 
mediaPlayer.setEventListener(this); 

final IVLCVout vout = mediaPlayer.getVLCVout(); 
vout.setVideoView(videoView); 
vout.setSubtitlesView(subtitleView); 
vout.addCallback(this); 
vout.attachViews(); 

final Media media = new Media(libVLC, getIntent().getData()); 
media.setHWDecoderEnabled(true, false); 
media.addOption(":network-caching=60000"); 
media.addOption(":clock-jitter=0"); 
media.addOption(":clock-synchro=0"); 

mediaPlayer.setMedia(media); 
mediaPlayer.play(); 

Ich hatte gehofft, dass auf dem Medienobjekt die :network-caching Einstellung ist genug, aber es scheint immer noch die ganze Zeit aus Daten auszuführen.

Wie wird LibVLC so konfiguriert, dass das Stottern beseitigt wird? Einige Pufferzeiten sind in Ordnung.

Der Streamtyp ist eine MOV-Datei, die über HTTP bedient wird.

Antwort

0

libvlc Option versuchen es:

ArrayList<String> options = new ArrayList<String>(); 
options.add("--audio-time-stretch"); // time stretching 
options.add("-vvv"); // verbosity 
options.add("--no-audio"); // no audio 
options.add("--aout=none"); 
options.add("--no-sub-autodetect-file"); 
options.add("--swscale-mode=0"); 
options.add("--network-caching=400"); 
options.add("--no-drop-late-frames"); 
options.add("--no-skip-frames"); 
options.add("--avcodec-skip-frame"); 
options.add("--avcodec-hw=any"); 

Medien addOption es versuchen:

Media m = new Media(libvlc, Uri.parse(URL)); 
m.setHWDecoderEnabled(true, true); 
m.addOption(":network-caching=5000"); 
m.addOption(":clock-jitter=0"); 
m.addOption(":clock-synchro=0"); 
m.addOption(":codec=all"); 
mMediaPlayer.setMedia(m); 
mMediaPlayer.play();