Comments (13)
I have seen the media player listener "buffering" event working in recent versions of vlc. However, I do not know if it is generated for ALL types of media, and in particular I do not know if it is sent for YouTube or similar media.
What I do know is that vlcj already gives you every event that vlc fires.
from vlcj.
I tested the vlcj YouTubePlayer example. It does indeed fire "buffering" events. In fact, it fires multiple buffering events until buffering is finished before you get a playing event.
However, at the moment you can not get a percentage complete indicator via this event.
The good news is that this percentage value is available, it's just not exposed via vlcj.
I added it and it appears to work, I get this debug output:
Buffering 0.0
Buffering 0.0
Buffering 31.0
Buffering 61.0
Buffering 92.0
Buffering 100.0
I will commit my fix soon and it will be included in the next release of vlcj.
from vlcj.
Commited 6aadcb3.
from vlcj.
Very good Mark!
If you want a beta-tester... :)
Thank you very much for maintain this wonderful API
from vlcj.
It's committed now, you can either get the code yourself from github, or you can wait until I upload a new vlcj 2.1.0-SNAPSHOT to the Caprica maven repository (soon).
from vlcj.
Closing this, you can re-open it if you find it does not work.
from vlcj.
Uploaded new 2.1.0-SNAPSHOT to the maven repository.
from vlcj.
The event is about partials buffering..
For example, I put the Iron man 2 trailer to run in fullhd and have this output:
_ _
__ _| | ___ (_)
\ \ / / |/ __|| |
\ V /| | (__ | |
\_/ |_|\___|/ | 2.1.0
|__/ www.capricasoftware.co.uk
VLCJ is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
VLCJ is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with VLCJ. If not, see <http://www.gnu.org/licenses/>.
Copyright 2009, 2010, 2011, 2012 Caprica Software Limited.
buffering:0.0
seekable:0
lenght:0
ERROR
lenght:0
buffering:0.0
seekable:0
lenght:0
ERROR
lenght:0
SUB:0
buffering:0.0
seekable:1
lenght:149182
buffering:0.0
...
buffering:96.0
Fontconfig error: Cannot load default config file
buffering:96.0
buffering:96.0
buffering:96.0
buffering:96.0
buffering:96.0
buffering:96.0
buffering:100.0
Fontconfig error: Cannot load default config file
Fontconfig error: Cannot load default config file
[0x7fc741caab50] main vout display error: option macosx-video-autoresize does not exist
2012-05-01 18:58:42.333 java[418:407] -[CocoaAppWindow isFullscreen]: unrecognized selector sent to instance 0x7fc743144c50
2012-05-01 18:58:42.334 java[418:407] -[CocoaAppWindow isFullscreen]: unrecognized selector sent to instance 0x7fc743144c50
2012-05-01 18:58:42.430 java[418:407] (
0 CoreFoundation 0x00007fff8bce4fc6 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff92897d5e objc_exception_throw + 43
2 CoreFoundation 0x00007fff8bd712ae -[NSObject doesNotRecognizeSelector:] + 190
3 CoreFoundation 0x00007fff8bcd1e73 ___forwarding___ + 371
4 CoreFoundation 0x00007fff8bcd1c88 _CF_forwarding_prep_0 + 232
5 libvout_macosx_plugin.dylib 0x000000012325ccbd -[VLCOpenGLVideoView setWindowFrameWithValue:] + 45
6 Foundation 0x00007fff881b5d94 __NSThreadPerformPerform + 214
7 CoreFoundation 0x00007fff8bc536e1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
8 CoreFoundation 0x00007fff8bc52f4d __CFRunLoopDoSources0 + 253
9 CoreFoundation 0x00007fff8bc79d39 __CFRunLoopRun + 905
10 CoreFoundation 0x00007fff8bc79676 CFRunLoopRunSpecific + 230
11 HIToolbox 0x00007fff9377731f RunCurrentEventLoopInMode + 277
12 HIToolbox 0x00007fff9377e5c9 ReceiveNextEventCommon + 355
13 HIToolbox 0x00007fff9377e456 BlockUntilNextEventMatchingListInMode + 62
14 AppKit 0x00007fff9296ef5d _DPSNextEvent + 659
15 AppKit 0x00007fff9296e861 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 135
16 libawt.jnilib 0x00000001187140a5 -[NSApplicationAWT nextEventMatchingMask:untilDate:inMode:dequeue:] + 124
17 AppKit 0x00007fff9296b19d -[NSApplication run] + 470
18 libawt.jnilib 0x00000001186c0674 +[AWTStarter startAWT:] + 1495
19 libawt.jnilib 0x00000001186bffee -[CPerformer perform] + 93
20 CoreFoundation 0x00007fff8bcd475d -[NSObject performSelector:withObject:] + 61
21 Foundation 0x00007fff881b5d94 __NSThreadPerformPerform + 214
22 CoreFoundation 0x00007fff8bc536e1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
23 CoreFoundation 0x00007fff8bc52f4d __CFRunLoopDoSources0 + 253
24 CoreFoundation 0x00007fff8bc79d39 __CFRunLoopRun + 905
25 CoreFoundation 0x00007fff8bc79676 CFRunLoopRunSpecific + 230
26 java 0x000000010f4a0843 java + 18499
27 java 0x000000010f4a029a java + 17050
28 java 0x000000010f49da98 java + 6808
)
[0x7fc7435a60f0] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 1000 ms)
[0x7fc7435a60f0] main input error: ES_OUT_RESET_PCR called
buffering:0.0
...
buffering:93.0
buffering:96.0
buffering:100.0
[0x7fc7435a60f0] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 1028 ms)
[0x7fc7435a60f0] main input error: ES_OUT_RESET_PCR called
buffering:0.0
...
buffering:96.0
buffering:98.0
buffering:100.0
Every time that the movie stops "buffering:0.0" appears on console.
Maybe I could use this information in union with "downloaded bytes" + "buffer size in bytes",
but this put me on starts again :(, vlcj have this informations exposed?
from vlcj.
I don't understand your expectation with this.
The buffering event is fired any time vlc is buffering so it would seem correct to me.
Maybe you want to know how much of the total video is buffered, and that is not exposed through the libvlc API as far as I can tell.
from vlcj.
You are right,
I´m wrong to try use this event.
To do what I want to do I need two things :
- The lenght of youtube video in bytes.
- The current downloaded bytes.
It´s possible?
from vlcj.
Well, it was still useful to add this event data anyway.
As to your questions:
- If mediaPlayer.getLength() doesn't work, then you can't do anything else.
- Can't get it.
from vlcj.
Hi Mark,
I resolved my problem with this implementation:
- Starts two outofProcess players.
- First, one with this parameters: ":sout=#standard{mux=ts,access=file,dst=./youtube.tmp}" opening youtube url.
- Second, opening youtube.tmp
I made a POC and it worked :), now I'm implementing it inside my player.
from vlcj.
To be honest, I don't fully understand the point or use/case that relates to this issue, but if you have something that works for what you need then that's great.
from vlcj.
Related Issues (20)
- New native audio output mode HOT 1
- Add new native parse flag "no skip" with value 0x10 HOT 1
- macos: Native Discovery fails vlcj 5.0.0 and VLC 4 HOT 5
- VLC 4.0 internal api changes HOT 3
- Getting Null exception in overlayApi class, sometime when panel resize, or video finish HOT 3
- Remove native method libvlc_media_thumbnail_request_cancel HOT 1
- Can not show Embedded subtitle? HOT 1
- What causes main libvlc error: stale plugins cache: modified HOT 6
- Seeing a hard-crash when running under JDK-20 HOT 1
- Various native _retain() methods now return the retained instance HOT 3
- Issue: VlcJ 4 - EmbeddedMediaPlayerComponent black when moving between components HOT 4
- Native parsed flag changes HOT 1
- Native library changes
- what is a media-player-events thread?? HOT 8
- Is it possible to use vlcj in a sandboxed macOS app? HOT 4
- Pom is missing from 5.0.0-SNAPSHOT HOT 5
- When libvlc.so is a link to a shared library, file.exists() returns false and crashes the program HOT 1
- Apple M1 (darwin-aarch64/libvlc.dylib) not found HOT 9
- SeekableCallbackMedia stops reading buffer HOT 14
- How to release a list player instance. HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vlcj.