What is the best way to do video incrustation...

This forum is about all development around libVLC.
wcoder
Blank Cone
Blank Cone
Posts: 26
Joined: 30 Mar 2014 12:56

What is the best way to do video incrustation...

Postby wcoder » 30 Mar 2014 13:31

Hi from Vincennes,

I'm a windows developper that migrate progressively to linux thanks to Win8.1...

I wrote for fun under window a mkv\dvb-t player base on DShow\Dx9Ex ffdshow ali media splitter - A very old screenshot : http://jjz3zjfxh3.1fichier.com/
I use a custom presenter to render video on texture (anim on screenshoot), add a dark mirror effect (2 triangles) and display thumb (3d mesh) over it (from SQLite db and external jpeg texture)... I use NV12 texture to ensure hardware acceleration of video using a sample pool... It's work under window and on final version cpu usage is near 20% (release) ...

Now i try to rewrite the same thing under linux, i test GStream the natural twin of DShow under linux, it's not very efficient... Last month i see an ADS of 01.net about VLC ^_^, i install libvlc, made a small test performance it perfect, i test the SDL 2 sample with a render greater than 1024x576 cpu is overload and video it explose green block (i suppose writing to texture uncompressed frame is like under windows...a disaster)... an other methode seems to do that using video filter...

My question is : what is the best way to re-write my player with VLC under linux without overkill cpu usage...

Thanks for your help

Note : I write using C\C++, SDL\Boost using netbean under debian jessie 32bits

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: What is the best way to do video incrustation...

Postby Rémi Denis-Courmont » 30 Mar 2014 19:05

Read the documentation. Use libvlc_media_player_set_xwindow().
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

wcoder
Blank Cone
Blank Cone
Posts: 26
Joined: 30 Mar 2014 12:56

Re: What is the best way to do video incrustation...

Postby wcoder » 30 Mar 2014 21:07

This function seems to specify rendering window like in Directshow when rendering video on a specific HWND :
"Set an X Window System drawable where the media player should render its video output"
"The specified identifier must correspond to an existing Input/Output class X11 window"

I don't see the relation between drawing the video on a Window (Xserver) and video incrustation like my screen shoot ?

I need to draw 3D objects over the video with alpha...

So i need to use the video has background on SDL or OpenGl (or draw 3D object over video front or back buffer), but if i draw SDL or OpenGL on this Window and redirect vlc on it too... I suppose that the result will be a blink between 3D and video, but not what i expect...

Could you give me more information please ?

Thanks,

WCoder

RSATom
Big Cone-huna
Big Cone-huna
Posts: 513
Joined: 24 Nov 2011 06:55
Operating System: Windows/Linux/OsX
Location: Russia, Tomsk

Re: What is the best way to do video incrustation...

Postby RSATom » 31 Mar 2014 05:35

use vmem to render video frame to memory and then upload it to texture.
Btw, don't you think about using qt quick 2 ?

wcoder
Blank Cone
Blank Cone
Posts: 26
Joined: 30 Mar 2014 12:56

Re: What is the best way to do video incrustation...

Postby wcoder » 31 Mar 2014 09:25

I will test it this night...

I don't plan to use QT or other GUI toolkit, my goal is to made a direct integration with DirectFB, to work on low cost arm device... For the moment, i made my dev on an old x86 laptop (7 years)... If it work i'll plan to continue on Dual core Arm like G-Box MX2 or clone (hardware acceleration seems to be available on this platform)...

Thanks for your help,

WCoder

RSATom
Big Cone-huna
Big Cone-huna
Posts: 513
Joined: 24 Nov 2011 06:55
Operating System: Windows/Linux/OsX
Location: Russia, Tomsk

Re: What is the best way to do video incrustation...

Postby RSATom » 31 Mar 2014 10:11

"low cost" - do you mean "without hardware acceleration"?

I should explain why I asked. I've developed library for integrating libvlc to Qt Quick 2. One of my goal is to try to use it on mobile devices via Qt Mobile.
It will be great if someone else try the same and share opinion.

wcoder
Blank Cone
Blank Cone
Posts: 26
Joined: 30 Mar 2014 12:56

Re: What is the best way to do video incrustation...

Postby wcoder » 31 Mar 2014 16:03

Low cost media center for me it's "70-110 $" (without remote) with hardware acceleration, because in my case the majority of function do not required a lot of cpu (mail,internet...), the only high cpu function is video\audio decoding and GUI...

Note : I known that XBMC already exist, but to learn and test design a real experience is better...


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 8 guests