Recent

Author Topic: VideoPlayer component  (Read 6936 times)

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
VideoPlayer component
« on: September 24, 2018, 11:06:56 am »
Hi guys, I have to do a paid close-source program but I need a component to view the videos in the program. Which component do you recommend for my needs? Cross-platform pitfalls would be ideal. Otherwise, one that works only on windows is fine.
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

wp

  • Hero Member
  • *****
  • Posts: 11858
Re: VideoPlayer component
« Reply #1 on: September 24, 2018, 11:27:45 am »
Why not the VLC player which comes with Lazarus? See the demo in (lazarus)/components/vlc/test. But note that several bugs were fixed recently, I don't know whether your 1.8.0 has the fixes already.

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: VideoPlayer component
« Reply #2 on: September 24, 2018, 11:38:51 am »
But can I use vlc in my program for a paid project? Do not I conflict with some license?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: VideoPlayer component
« Reply #3 on: September 24, 2018, 12:19:06 pm »
see this discussion for example:
https://forum.videolan.org/viewtopic.php?t=36328 which mentions a work-around that is acceptable to its core developers. (install vlc separately and use sockets)
The VLC license is not the only issue. In countries that still accept patents on software and algorithms you will have an additional issue in licensing codecs.

So yes: if you want to use it in commercial applications, that's ok, but needs to be GPL'd and you need some spatial awareness where you actually distribute your software regarding the licensing of codecs.

Actually the point is that you want to use the code but are possibly not able to write such code. It is highly technically complex on many levels.
I find it not strange that people are protecting it with either the GPL or with commercial licensing for that reason.

I am not aware of any libraries that are without issues: non of the free software ones allow e.g. lgpl or dual licensing and codec owners demand payments for commercial applications.

There is a solution: write it all yourself! that's what Videolan basically did with VLC. And even then... the codecs...

On Windows it may be a bit easier, providing the Windows provided binaries have type libraries or other bindings. That would be OK.
« Last Edit: September 24, 2018, 12:34:51 pm by Thaddy »
Specialize a type, not a var.

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: VideoPlayer component
« Reply #4 on: September 24, 2018, 01:34:51 pm »
Let's see if I understand, I advise you to create two software, one where the player is. And the second the rest of the program and then I communicate with the sockets, releasing the first GPL and the second pay?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: VideoPlayer component
« Reply #5 on: September 24, 2018, 01:48:53 pm »
Why not the VLC player which comes with Lazarus? See the demo in (lazarus)/components/vlc/test. But note that several bugs were fixed recently, I don't know whether your 1.8.0 has the fixes already.

I wp, now i downloaded trunk version of lazarus, but vlc components return error when install on Cocoa Lazarus version.
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: VideoPlayer component
« Reply #6 on: September 24, 2018, 07:05:17 pm »
Let's see if I understand, I advise you to create two software, one where the player is. And the second the rest of the program and then I communicate with the sockets, releasing the first GPL and the second pay?
No. What I say is that if it is possible, install  VLC and use streaming interface. That still makes it impossible to use in countries with software patents. That's not what I said, but the program leader of Videolan. See the link.
Under Windows it is easier, because a Microsoft Windows license covers most licenses for its media software included with the OS, so if it has a published API you are good to go, unless otherwise specified.
The linux situation is rather more complex. Android is similar to Windows. Mac or IOS? Not quite sure.
« Last Edit: September 24, 2018, 07:08:08 pm by Thaddy »
Specialize a type, not a var.

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: VideoPlayer component
« Reply #7 on: September 25, 2018, 01:42:13 pm »
Is there an example to download what you say?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

metis

  • Sr. Member
  • ****
  • Posts: 300
Re: VideoPlayer component
« Reply #8 on: September 28, 2018, 02:24:56 pm »
@xinyiman

Quote
to do a paid close-source program...to view the videos in the program.
As already mentioned by Thaddy, You won't find any Player without Copyright-Restrictions.
Afaik (but I'm not a Lawyer), You can deal with some Copyright-Issues, if Your App only contains the Links to the Libraries,
that are required by Your App, like e.g. 'Audacity' (= non-commercial) does.
Then, You only have to explain to Your Customer, that he has to download something by himself to run an App he should pay for.
Now, Your App only has to comply with different Laws in each Country or Region, where You want to sell Your App.
-> gonna be difficult (and expensive).

If You want to try out the Lazarus-VLC-Component, mentioned by 'wp', see the attached VLC-Tutorial:
'Displaying video files using Free Pascal and Lazarus.pdf'.

If You're Looking for more, see here:
http://wiki.lazarus.freepascal.org/Video_Playback_Libraries

If You rather tend to follow Thaddy's Advice...
Quote
There is a solution: write it all yourself!

...maybe these Threads are interesting for You...

"NON(!)-EXE FFPlay4Laz" by me:
http://forum.lazarus.freepascal.org/index.php/topic,26666.0.html
'FFPlay4Laz' is based on FFmpeg's 'ffplay.c', but it's not only a simply ported Copy of it.
It uses the FFmpeg-Libraries as Audio-/Video-Decoder and -Converter, SDL as Audio-/Video-Output, and
Portaudio for enhanced AudioQuality (currently all Win32, only).
The ConsoleVersion works - the last Release can be downloaded here:
http://forum.lazarus-ide.org/index.php/topic,26666.msg286945.html#msg286945
In the Meantime, I've added some more PlayerFeatures and wrote a Windows-DLL, that encapsulates all Features of that Console.
Currently, I'm writing a LCL-GUI, that demonstrates those PlayerFeatures and shows how to use the DLL's API.
(Will be released in this Forum in the next Weeks - depends on how much Time I got for Progging.)

If You don't like 'FFPlay4Laz', see here:
"Lazarus Mediaplayer with SDL2 and FFMPEG", a simplified FFmpeg-Player by 'somby':
http://forum.lazarus.freepascal.org/index.php/topic,40446.0.html

If You're additionally familiar with C++, see here:
"[Open source] LibFFPlay" by 'mercury' links to a modified 'ffplay.c':
http://forum.lazarus.freepascal.org/index.php/topic,33105.0.html

If a Command-Line-Solution is sufficient for You, see here:
http://forum.lazarus-ide.org/index.php/topic,24712.0.html
-> 'WinFF' has SourceCode, 'dmMediaConverter' not; both have FFmpeg-Command-Line-Examples.
-> for Copyright-Issues, see Page #2 !

Note: All of the Projects listed above - including 'VLC' - use FFmpeg:
https://en.wikipedia.org/wiki/FFmpeg
-> Read "Legal aspects"
Life could be so easy, if there weren't those f*** Details.
My FFmpeg4Lazarus = FFPlay4Laz + FFGrab4Laz + FFInfo4Laz

metis

  • Sr. Member
  • ****
  • Posts: 300
Re: VideoPlayer component
« Reply #9 on: October 01, 2018, 03:56:17 pm »
@xinyiman

Last Time, I forgot to mention "FFVCL – Delphi FFmpeg VCL Components":
http://www.delphiffmpeg.com/
These are Components, but not for free.

If You download the Headers:
http://www.delphiffmpeg.com/headers/
You get lots of Codesamples ported from C to Pascal, so You can (almost) write it by Yourself.

BTW, maybe it's better, You move Your Thread to:
Lazarus » Programming » Graphics and Multimedia » Audio and Video.  ;)
Life could be so easy, if there weren't those f*** Details.
My FFmpeg4Lazarus = FFPlay4Laz + FFGrab4Laz + FFInfo4Laz

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: VideoPlayer component
« Reply #10 on: October 01, 2018, 04:53:12 pm »
These are Components, but not for free.
No, but there also is no code which is a (L) GPL violation against at least ffmpeg.

Such code should be avoided.

Components seem in violation of lgpl 2.1, there are issues with some NVIDEA code too.
Components are not subject to lgpl, but to gpl: there is a linker exception against a full program, not against a repackaged library.

Which renders it useless for commercial applications...
« Last Edit: October 01, 2018, 04:56:57 pm by Thaddy »
Specialize a type, not a var.

metis

  • Sr. Member
  • ****
  • Posts: 300
Re: VideoPlayer component
« Reply #11 on: October 01, 2018, 05:15:01 pm »
@Thaddy
Maybe my Posts were misleading - Of course, everything above is finally based on FFmpeg.

Quote
Which renders it useless for commercial applications...
I agrree with You a 100% - Sorry, xinyiman.
Life could be so easy, if there weren't those f*** Details.
My FFmpeg4Lazarus = FFPlay4Laz + FFGrab4Laz + FFInfo4Laz

af0815

  • Hero Member
  • *****
  • Posts: 1289
Re: VideoPlayer component
« Reply #12 on: October 01, 2018, 06:36:32 pm »
... I need a component to view the videos in the program.... Cross-platform pitfalls would be ideal. Otherwise, one that works only on windows is fine.
Windows DirectShow

Cross-Platform maybe RVMedia4.0 from TRichview (using gstreamer) a possible component (also payed software :-) ).
regards
Andreas

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: VideoPlayer component
« Reply #13 on: October 01, 2018, 08:27:28 pm »
... I need a component to view the videos in the program.... Cross-platform pitfalls would be ideal. Otherwise, one that works only on windows is fine.
Windows DirectShow

Cross-Platform maybe RVMedia4.0 from TRichview (using gstreamer) a possible component (also payed software :-) ).
That's also not exact enough:
A gstreamer solution is more or less what I proposed for VLC.
gstreamer itself is as a library subject to the same limitations as ffmpeg, because it is lgpl'ed ( https://en.wikipedia.org/wiki/GStreamer ). (Which is used in gstreamer anyway...through the plugin, without it it is useless)

An option would be using truly free codecs like V8/9 ( https://en.wikipedia.org/wiki/Creative_Commons_license ) and Ogg Vorbis ) https://www.fsf.org/campaigns/playogg/en/ ) .
Both of these can be linked into commercial programs. You won't run into trouble easily with those two...But it means you need to encode your audio and video in these formats.
But I would suggest either a browser option or VLC, while keeping in mind licensing issues in some countries.
« Last Edit: October 01, 2018, 08:32:41 pm by Thaddy »
Specialize a type, not a var.

af0815

  • Hero Member
  • *****
  • Posts: 1289
Re: VideoPlayer component
« Reply #14 on: October 02, 2018, 08:40:07 pm »
That's also not exact enough:
A gstreamer solution is more or less what I proposed for VLC.
gstreamer itself is as a library subject to the same limitations as ffmpeg, because it is lgpl'ed ( https://en.wikipedia.org/wiki/GStreamer ). (Which is used in gstreamer anyway...through the plugin, without it it is useless)
Indeed not exactly enough, the best way is to use gstreamer itself direct as a library. So you only link against gstreamer and no other product is affected. And linking against lgpl'ed libs is possible for closed source (The good pluginlist using :-) ).
« Last Edit: October 02, 2018, 08:42:53 pm by af0815 »
regards
Andreas

 

TinyPortal © 2005-2018