Coder Social home page Coder Social logo

Comments (13)

caprica avatar caprica commented on June 25, 2024

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.

caprica avatar caprica commented on June 25, 2024

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.

caprica avatar caprica commented on June 25, 2024

Commited 6aadcb3.

from vlcj.

dyorgio avatar dyorgio commented on June 25, 2024

Very good Mark!

If you want a beta-tester... :)

Thank you very much for maintain this wonderful API

from vlcj.

caprica avatar caprica commented on June 25, 2024

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.

caprica avatar caprica commented on June 25, 2024

Closing this, you can re-open it if you find it does not work.

from vlcj.

caprica avatar caprica commented on June 25, 2024

Uploaded new 2.1.0-SNAPSHOT to the maven repository.

from vlcj.

dyorgio avatar dyorgio commented on June 25, 2024

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.

caprica avatar caprica commented on June 25, 2024

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.

dyorgio avatar dyorgio commented on June 25, 2024

You are right,

I´m wrong to try use this event.
To do what I want to do I need two things :

  1. The lenght of youtube video in bytes.
  2. The current downloaded bytes.

It´s possible?

from vlcj.

caprica avatar caprica commented on June 25, 2024

Well, it was still useful to add this event data anyway.

As to your questions:

  1. If mediaPlayer.getLength() doesn't work, then you can't do anything else.
  2. Can't get it.

from vlcj.

dyorgio avatar dyorgio commented on June 25, 2024

Hi Mark,

I resolved my problem with this implementation:

  1. Starts two outofProcess players.
  2. First, one with this parameters: ":sout=#standard{mux=ts,access=file,dst=./youtube.tmp}" opening youtube url.
  3. Second, opening youtube.tmp

I made a POC and it worked :), now I'm implementing it inside my player.

from vlcj.

caprica avatar caprica commented on June 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.