Closed Dizzman closed 7 years ago
Try the vlcj examples, your own code suffers from common problems for people new with vlcj. Also check the tutorials here and make sure you understand the part on garbage collection and heap variables going out of scope: http://capricasoftware.co.uk/#/projects/vlcj/tutorial
Also, if you want me to read your logs, you should make sure they're properly formatted with github markdown. Right now they're too messy to read.
Edit: sorry, I missed the part where you called Thread.join(), so that GC issue I mentioned is not relevant here
Ok. Thank you for answer. I'll try it.
Windows 7 x64
I'm trying watching online TV. VLC player warking and i see stream
but in console output some
1 [main] INFO uk.co.caprica.vlcj.Info - vlcj: 3.10.1 1 [main] INFO uk.co.caprica.vlcj.Info - java: 1.8.0_111 Oracle Corporation 1 [main] INFO uk.co.caprica.vlcj.Info - java home: C:\Program Files\Java\jdk1.8.0_111\jre 1 [main] INFO uk.co.caprica.vlcj.Info - os: Windows 7 6.1 amd64 4 [main] DEBUG uk.co.caprica.vlcj.discovery.NativeDiscovery - discover() 4 [main] DEBUG uk.co.caprica.vlcj.discovery.NativeDiscovery - jnaLibraryPath=null 4 [main] DEBUG uk.co.caprica.vlcj.discovery.NativeDiscovery - discoveryStrategy=uk.co.caprica.vlcj.discovery.linux.DefaultLinuxNativeDiscoveryStrategy@2b05039f 4 [main] DEBUG uk.co.caprica.vlcj.discovery.NativeDiscovery - supported=false 4 [main] DEBUG uk.co.caprica.vlcj.discovery.NativeDiscovery - discoveryStrategy=uk.co.caprica.vlcj.discovery.windows.DefaultWindowsNativeDiscoveryStrategy@61e717c2 4 [main] DEBUG uk.co.caprica.vlcj.discovery.NativeDiscovery - supported=true 4 [main] DEBUG uk.co.caprica.vlcj.discovery.AbstractNativeDiscoveryStrategy - discover() 8 [main] DEBUG uk.co.caprica.vlcj.runtime.windows.WindowsRuntimeUtil - getVlcInstallDir() 62 [main] DEBUG uk.co.caprica.vlcj.discovery.AbstractNativeDiscoveryStrategy - directoryNames=[d:\Program Files\VideoLAN\VLC, D:#PRJ2\streamer_1, C:\ProgramData\Oracle\Java\javapath, D:\Program Files (x86)\Embarcadero\Studio\17.0\bin, C:\Users\Public\Documents\Embarcadero\Studio\17.0\Bpl, C:\Program Files (x86)\Embarcadero\Studio\16.0\bin, C:\Users\Public\Documents\Embarcadero\Studio\16.0\Bpl, C:\Program Files (x86)\Intel\Compiler\11.1\054\tbb\intel64\vc9\bin, C:\Program Files (x86)\Intel\Compiler\11.1\054\ipp\em64t\bin, C:\Program Files (x86)\Intel\Compiler\11.1\054\lib\Intel64, C:\Program Files (x86)\Intel\Compiler\11.1\054\lib\ia32, C:\Program Files (x86)\Intel\Compiler\11.1\054\mkl\em64t\bin, C:\Windows\system32, C:\Windows, C:\Windows\System32\Wbem, C:\Windows\System32\WindowsPowerShell\v1.0\, C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\, C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common, C:\Program Files\TortoiseSVN\bin, C:\Program Files\TortoiseGit\bin, C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\, C:\Program Files\Microsoft SQL Server\130\Tools\Binn\, C:\Program Files\Git\cmd, C:\Program Files (x86)\Skype\Phone\, d:\Program Files\MATLAB\R2016b\runtime\win64, d:\Program Files\MATLAB\R2016b\bin, d:\Program Files\MATLAB\R2016b\polyspace\bin, D:\Users\SCHWARZ\AppData\Local\Programs\Python\Python35-32\Scripts\, D:\Users\SCHWARZ\AppData\Local\Programs\Python\Python35-32\, C:\Program Files\Java\jdk1.8.0_111\bin] 62 [main] DEBUG uk.co.caprica.vlcj.discovery.AbstractNativeDiscoveryStrategy - directoryName=d:\Program Files\VideoLAN\VLC 62 [main] DEBUG uk.co.caprica.vlcj.discovery.AbstractNativeDiscoveryStrategy - Matched 'libvlc.dll' in 'd:\Program Files\VideoLAN\VLC' 62 [main] DEBUG uk.co.caprica.vlcj.discovery.AbstractNativeDiscoveryStrategy - Matched 'libvlccore.dll' in 'd:\Program Files\VideoLAN\VLC' 62 [main] DEBUG uk.co.caprica.vlcj.discovery.AbstractNativeDiscoveryStrategy - Matched all required files 62 [main] DEBUG uk.co.caprica.vlcj.discovery.AbstractNativeDiscoveryStrategy - result=d:\Program Files\VideoLAN\VLC 62 [main] DEBUG uk.co.caprica.vlcj.discovery.NativeDiscovery - path=d:\Program Files\VideoLAN\VLC 62 [main] INFO uk.co.caprica.vlcj.discovery.NativeDiscovery - Discovery found libvlc at 'd:\Program Files\VideoLAN\VLC' true http://178.162.218.85:8081/liveg/tnt.stream/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9Mi8xMC8yMDE3IDM6MDg6MTIgUE0maGFzaF92YWx1ZT1rcnFtNWtiNE81RTNlNEMvU3loR1h3PT0mdmFsaWRtaW51dGVzPTIwMA== 127 [main] DEBUG uk.co.caprica.vlcj.player.MediaPlayerFactory - initX=null 128 [main] INFO uk.co.caprica.vlcj.binding.LibVlcFactory - vlc: 2.2.4 Weatherwax, changeset 2.2.4-0-g888b7e89 128 [main] INFO uk.co.caprica.vlcj.binding.LibVlcFactory - libvlc: d:\Program Files\VideoLAN\VLC\libvlc.dll 128 [main] DEBUG uk.co.caprica.vlcj.player.MediaPlayerFactory - MediaPlayerFactory(libvlc=Proxy interface to Native Library <d:\Program Files\VideoLAN\VLC\libvlc.dll@1890975744>,libvlcArgs=[http://178.162.218.85:8081/liveg/tnt.stream/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9Mi8xMC8yMDE3IDM6MDg6MTIgUE0maGFzaF92YWx1ZT1rcnFtNWtiNE81RTNlNEMvU3loR1h3PT0mdmFsaWRtaW51dGVzPTIwMA==]) 128 [main] DEBUG uk.co.caprica.vlcj.player.MediaPlayerFactory - jna.library.path=null 128 [main] DEBUG uk.co.caprica.vlcj.player.MediaPlayerFactory - VLC_PLUGIN_PATH=null 423 [main] DEBUG uk.co.caprica.vlcj.player.MediaPlayerFactory - instance=native@0x3dc460 (uk.co.caprica.vlcj.binding.internal.libvlc_instance_t@3dc460) 423 [main] DEBUG uk.co.caprica.vlcj.player.MediaPlayerFactory - equalizerAvailable=true 423 [main] DEBUG uk.co.caprica.vlcj.player.MediaPlayerFactory - createEqualizerBandFrequencies() 423 [main] DEBUG uk.co.caprica.vlcj.player.MediaPlayerFactory - numBands=10 424 [main] DEBUG uk.co.caprica.vlcj.player.MediaPlayerFactory - result=[31.25, 62.5, 125.0, 250.0, 500.0, 1000.0, 2000.0, 4000.0, 8000.0, 16000.0] 424 [main] DEBUG uk.co.caprica.vlcj.player.MediaPlayerFactory - createEqualizerPresetNames() 424 [main] DEBUG uk.co.caprica.vlcj.player.MediaPlayerFactory - numPresets=18 424 [main] DEBUG uk.co.caprica.vlcj.player.MediaPlayerFactory - result=[Flat, Classical, Club, Dance, Full bass, Full bass and treble, Full treble, Headphones, Large Hall, Live, Party, Pop, Reggae, Rock, Ska, Soft, Soft rock, Techno] 424 [main] DEBUG uk.co.caprica.vlcj.player.MediaPlayerFactory - newHeadlessMediaPlayer() 434 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - DefaultMediaPlayer(libvlc=Proxy interface to Native Library <d:\Program Files\VideoLAN\VLC\libvlc.dll@1890975744>, instance=native@0x3dc460 (uk.co.caprica.vlcj.binding.internal.libvlc_instance_t@3dc460)) 435 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - createInstance() 436 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - mediaPlayerInstance=native@0x1a738850 (uk.co.caprica.vlcj.binding.internal.libvlc_media_player_t@1a738850) 436 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - mediaPlayerEventManager=native@0x1a74fe80 (uk.co.caprica.vlcj.binding.internal.libvlc_event_manager_t@1a74fe80) 436 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - registerEventListener() 438 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerMediaChanged 462 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 462 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerNothingSpecial 462 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 462 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerOpening 462 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 462 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerBuffering 463 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 463 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerPlaying 463 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 463 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerPaused 463 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 463 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerStopped 463 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 463 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerForward 463 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 463 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerBackward 463 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 463 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerEndReached 463 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 463 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerEncounteredError 463 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 463 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerTimeChanged 463 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 463 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerPositionChanged 463 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 463 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerSeekableChanged 464 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 464 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerPausableChanged 464 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 464 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerTitleChanged 464 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 464 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerSnapshotTaken 464 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 464 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerLengthChanged 464 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 464 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerVout 464 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 464 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaPlayerScrambledChanged 464 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 466 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - playMedia(mrl=http://178.162.218.85:8081/liveg/tnt.stream/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9Mi8xMC8yMDE3IDM6MDg6MTIgUE0maGFzaF92YWx1ZT1rcnFtNWtiNE81RTNlNEMvU3loR1h3PT0mdmFsaWRtaW51dGVzPTIwMA==,mediaOptions=[]) 467 [main] DEBUG uk.co.caprica.vlcj.player.MediaResourceLocator - encodeMrl(mrl=http://178.162.218.85:8081/liveg/tnt.stream/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9Mi8xMC8yMDE3IDM6MDg6MTIgUE0maGFzaF92YWx1ZT1rcnFtNWtiNE81RTNlNEMvU3loR1h3PT0mdmFsaWRtaW51dGVzPTIwMA==) 467 [main] DEBUG uk.co.caprica.vlcj.player.MediaResourceLocator - MRL does not contain any Unicode characters 467 [main] DEBUG uk.co.caprica.vlcj.player.MediaResourceLocator - result=http://178.162.218.85:8081/liveg/tnt.stream/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9Mi8xMC8yMDE3IDM6MDg6MTIgUE0maGFzaF92YWx1ZT1rcnFtNWtiNE81RTNlNEMvU3loR1h3PT0mdmFsaWRtaW51dGVzPTIwMA== 467 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - playMedia(media=SimpleMedia[mrl=http://178.162.218.85:8081/liveg/tnt.stream/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9Mi8xMC8yMDE3IDM6MDg6MTIgUE0maGFzaF92YWx1ZT1rcnFtNWtiNE81RTNlNEMvU3loR1h3PT0mdmFsaWRtaW51dGVzPTIwMA==,mediaOptions=[Ljava.lang.String;@39ba5a14]) 467 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - prepareMedia(media=SimpleMedia[mrl=http://178.162.218.85:8081/liveg/tnt.stream/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9Mi8xMC8yMDE3IDM6MDg6MTIgUE0maGFzaF92YWx1ZT1rcnFtNWtiNE81RTNlNEMvU3loR1h3PT0mdmFsaWRtaW51dGVzPTIwMA==,mediaOptions=[Ljava.lang.String;@39ba5a14]) 467 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - setMedia(media=SimpleMedia[mrl=http://178.162.218.85:8081/liveg/tnt.stream/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9Mi8xMC8yMDE3IDM6MDg6MTIgUE0maGFzaF92YWx1ZT1rcnFtNWtiNE81RTNlNEMvU3loR1h3PT0mdmFsaWRtaW51dGVzPTIwMA==,mediaOptions=[Ljava.lang.String;@39ba5a14]) 467 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - createMediaInstance(media=SimpleMedia[mrl=http://178.162.218.85:8081/liveg/tnt.stream/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9Mi8xMC8yMDE3IDM6MDg6MTIgUE0maGFzaF92YWx1ZT1rcnFtNWtiNE81RTNlNEMvU3loR1h3PT0mdmFsaWRtaW51dGVzPTIwMA==,mediaOptions=[Ljava.lang.String;@39ba5a14]) 467 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - Treating mrl as a location 468 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - mediaInstance=native@0x1a74ffa0 (uk.co.caprica.vlcj.binding.internal.libvlc_media_t@1a74ffa0) 468 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - registerMediaEventListener() 468 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaMetaChanged 468 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 468 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaSubItemAdded 468 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 468 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaDurationChanged 468 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 468 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaParsedChanged 468 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 468 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaFreed 468 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 468 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaStateChanged 469 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 469 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - event=libvlc_MediaSubItemTreeAdded 469 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=0 472 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - mrl(mediaInstance=native@0x1a74ffa0 (uk.co.caprica.vlcj.binding.internal.libvlc_media_t@1a74ffa0)) 474 [pool-1-thread-1] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - mediaChanged(mediaPlayer=uk.co.caprica.vlcj.player.headless.DefaultHeadlessMediaPlayer@5f01dc88,media=native@0x1a74ffa0 (uk.co.caprica.vlcj.binding.internal.libvlc_media_t@1a74ffa0),mrl=http://178.162.218.85:8081/liveg/tnt.stream/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9Mi8xMC8yMDE3IDM6MDg6MTIgUE0maGFzaF92YWx1ZT1rcnFtNWtiNE81RTNlNEMvU3loR1h3PT0mdmFsaWRtaW51dGVzPTIwMA==) 474 [pool-1-thread-1] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - Raising event for new media 475 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=true 475 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - play() 482 [main] DEBUG uk.co.caprica.vlcj.player.DefaultMediaPlayer - after play [000000001a7677d0] httplive stream: HTTP Live Streaming (178.162.218.85:8081/liveg/tnt.stream/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9Mi8xMC8yMDE3IDM6MDg6MTIgUE0maGFzaF92YWx1ZT1rcnFtNWtiNE81RTNlNEMvU3loR1h3PT0mdmFsaWRtaW51dGVzPTIwMA==)
**[000000001a759450] ts demux: MPEG-4 descriptor not found for pid 0x101 type 0xf
[000000001a89d080] packetizer_mpeg4audio packetizer: AAC channels: 2 samplerate: 48000 [000000001a759450] ts demux error: libdvbpsi error (PSI decoder): TS duplicate (received 0, expected 1) for PID 0 [000000001a759450] ts demux error: libdvbpsi error (PSI decoder): TS duplicate (received 0, expected 1) for PID 4095 [000000001a759450] ts demux error: libdvbpsi error (PSI decoder): TS duplicate (received 0, expected 1) for PID 0 [000000001a759450] ts demux error: libdvbpsi error (PSI decoder): TS duplicate (received 0, expected 1) for PID 4095**
CODE:
public static void main(String[] args) throws Exception { boolean found = new NativeDiscovery().discover(); System.out.println(found); System.out.println(args[0]); String media=args[0]; HeadlessMediaPlayer mediaPlayer = mediaPlayerFactory.newHeadlessMediaPlayer(); mediaPlayer.playMedia(media); Thread.currentThread().join(); }