Giter VIP home page Giter VIP logo

tkvlc's Introduction

tkvlc

libVLC is the core engine and the interface to the multimedia framework on which VLC media player is based.

It is a demo to embed libVLC to a Tk toolkit frame widget.

It involves making a frame widget in Tcl, and then passing its Windows HWND or X Window ID to C (use winfo id window) to initialize the libVLC media player.

User also can use --with-tk-photo flag to disable/enable to allow for photo images. This feature "allow for photo images" is from AndroWish project and written by Christian Werner. Default is yes.

User also can use this extension in console program, just not pass HWND or photo when using tkvlc::init to initialize (after version 0.4). However, tkvlc in console program now only work when interactive with tclsh.

License

MIT

Implement commands

tkvlc::init HANDLE ?HWND|photo?
HANDLE open filename
HANDLE openurl url
HANDLE play
HANDLE pause
HANDLE stop
HANDLE isplaying
HANDLE volume ?value?
HANDLE duration
HANDLE time ?value?
HANDLE position ?value? HANDLE isseekable
HANDLE state
HANDLE rate ?value?
HANDLE version
HANDLE destroy
HANDLE event ?cmd?
HANDLE repeat ?flag?
HANDLE info

duration get duration (in second) of movie time.

time get or set the current movie time (in second).

position get or set movie position as percentage between 0.0 and 1.0.

isseekable return true if the media player can seek.

state get current movie state.

rate get or set relative playback speed

repeat get or set replay flag

event get or set event callback

info return array set list with information media player

Movie state has states (string): idle, opening, buffering, playing, paused, stopped, ended, and error.

The event callback is invoked with an additional argument, which is made up of the event type (string): media, state, time, position, audio, and frame.

The event type frame occurs when new pixels have been rendered into a photo image.

UNIX BUILD

Only test on openSUSE LEAP 42.2 and Ubuntu 14.04.

First is to install libVLC development files. Below is an example for openSUSE:

sudo zypper in vlc-devel

Below is an example for Ubuntu:

sudo apt-get install libvlc-dev

And please notice, I think user still needs VLC codec package when playing a multimedia file.

Building under most UNIX systems is easy, just run the configure script and then run make. For more information about the build process, see the tcl/unix/README file in the Tcl src dist. The following minimal example will install the extension in the /opt/tcl directory.

$ cd tkvlc
$ ./configure --prefix=/opt/tcl
$ make
$ make install

If you need setup directory containing tcl configuration (tclConfig.sh), below is an example:

$ cd tkvlc
$ ./configure --with-tcl=/opt/activetcl/lib
$ make
$ make install

I enable TEA_PROG_WISH check, because this extension needs Tk toolkit. So if you need specify Tk include path, below is an example:

$ cd tkvlc
$ ./configure --with-tkinclude=/usr/include/tk
$ make
$ make install

WINDOWS BUILD

MSYS2/MinGW-W64

VLC binary installers for Windows do not include the LibVLC SDK.

To build this extension, user needs libVLC import libraries and development headers. Please check LibVLC_Tutorial. Copy libraries to C:\msys64\mingw64\lib and headers (vlc folder) to C:\msys64\mingw64\include.

When execute tkvlc, user needs libvlc.dll, libvlccore.dll and plugins files.

Next step is to build tkvlc.

$ ./configure --with-tcl=/c/tcl/lib
$ make
$ make install

Example

Please check example folder.

tkvlc's People

Contributors

ray2501 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

tkvlc's Issues

Render vlc to Tk photo images

Danilo,

few days ago, I've found your tkvlc project and couldn't resist to improve it somewhat in order to be able to use it in undroidwish. This doesn't have directly usable platform handles (HWND or Window IDs) as in plain Win32 or X1. Thus I introduced rendering to photo images among other minor improvements, e.g. dynamic linking of libvlc.so. If you find it in parts usable, I'll be glad if you take over some of my changes.

See this AndroWish check-in for more information:
https://www.androwish.org/index.html/info/f971f95c80fc9ad7

All the best,
Christian

get binary jpeg data when using tkvlc with tclsh

Hello Danilo,

Is it possible to somehow add the ability to receive binary jpeg data from the video stream when used tkvlc with tclsh?

For Example:

tkvlc::init HANDLE tcl_variable

where tcl_variable is a variable tcl that contains binary data in the jpeg format.

Thanks!

set fps for rtsp video stream

Is it possible add a command for to reduce the fps for the rtsp video stream, for example to one frame per second? Because at 15 fps, the load on the processor is up to 60 percent. Up to 20 rtsp video streams need to be processed. I hope this can be achieved by reducing the fps.

Thank you!

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.