Recent

Author Topic: I need to playback mp4 video files  (Read 10334 times)

RedOctober

  • Sr. Member
  • ****
  • Posts: 454
I need to playback mp4 video files
« on: November 02, 2021, 08:29:51 pm »
Platform:   Lazarus 2.0.10, FPC 3.2.0,  Windows Server 2016
Goal:  I have a folder with a bunch of .mp4 files in it.  I need to allow the user to click on one of the files displayed in my app's FileListBox and have that video play in a window in my app.

I don't need any video/audio editing.  I need the simplest most light weight component, to just "play video" in a window.

What component should I use to do this?  Thanks for your help.

(My research into this turns up components that are 4 years old, or they do a lot more than what I need, etc.  I want to know what all the "cool kids" are using today)

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 855
Re: I need to playback mp4 video files
« Reply #1 on: November 02, 2021, 09:00:00 pm »
I use PasLibVLC for this purpose. Install LazVLC from online package manager. Using it is as easy, as putting VLC component from Multimedia tab to your form. Please note, that on Windows you would need to provide libvlc.dll, libvlccore.dll and Plugins directory from VLC distribution. It's around 130Mb.
Is it healthy for project not to have regular stable releases?
Just for fun: Code::Blocks, GCC 13 and DOS - is it possible?

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: I need to playback mp4 video files
« Reply #2 on: November 02, 2021, 09:04:49 pm »
Hi!

The mplayer is the robust swissknife for Linux and Windows.

https://wiki.lazarus.freepascal.org/TMPlayerControl

Works for mp3/mp4 but also for a lot of other sound and video formats.


Winni

MarkMLl

  • Hero Member
  • *****
  • Posts: 7496
Re: I need to playback mp4 video files
« Reply #3 on: November 02, 2021, 09:30:46 pm »
I use PasLibVLC for this purpose. Install LazVLC from online package manager. Using it is as easy, as putting VLC component from Multimedia tab to your form. Please note, that on Windows you would need to provide libvlc.dll, libvlccore.dll and Plugins directory from VLC distribution. It's around 130Mb.

Noting that there are reports of debugging problems when using this.

Of course, the "smart kids" use Theora :-)

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1235
Re: I need to playback mp4 video files
« Reply #4 on: November 03, 2021, 07:59:06 am »
hello,
Platform:   Lazarus 2.0.10, FPC 3.2.0,  Windows Server 2016
Goal:  I have a folder with a bunch of .mp4 files in it.  I need to allow the user to click on one of the files displayed in my app's FileListBox and have that video play in a window in my app.

I don't need any video/audio editing.  I need the simplest most light weight component, to just "play video" in a window.

What component should I use to do this?  Thanks for your help.

On windows , you can use Windows Media Player (Microsoft - i don't know if it is installed in the Server version of windows). Windows Media Player can be used as ActiveX control.

In attachment small lazarus project to play media file with WMP.

Friendly, J.P
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 855
Re: I need to playback mp4 video files
« Reply #5 on: November 03, 2021, 12:23:15 pm »
Noting that there are reports of debugging problems when using this.

Of course, the "smart kids" use Theora :-)

MarkMLl
I guess, problems happen only when running multiple players.
Is it healthy for project not to have regular stable releases?
Just for fun: Code::Blocks, GCC 13 and DOS - is it possible?

MarkMLl

  • Hero Member
  • *****
  • Posts: 7496
Re: I need to playback mp4 video files
« Reply #6 on: November 03, 2021, 12:53:13 pm »
I guess, problems happen only when running multiple players.

No, there's some fundamental problem possibly related to low-level communications when gdb is being used, and this doesn't appear to be Lazarus/FPC-specific. There was a fairly long thread about this a couple of months ago, the conclusion was that a program using libvlc could be run from inside the IDE /without/ debugging but not /with/ debugging... I don't think the people actively involved tried using fpdebug instead.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

af0815

  • Hero Member
  • *****
  • Posts: 1356
Re: I need to playback mp4 video files
« Reply #7 on: November 03, 2021, 01:01:13 pm »
BTW:
Quote
Windows Server 2016
is not the best Plattform for Multimedia.

For showing i use DirectShow. Before you use it you can test it with graphedt (Graphedit). If you can work with Graphedt (or graphstudionext) then it will work with Lazarus. I have my own working copy here https://github.com/afriess/LazarusVideoUtilities/tree/WIP_andi. In my Archive is no activity, because it works for me, so i never change a running system.

This a Fork from Mike.Cornflake https://sourceforge.net/projects/lazarusvideoutilities/

DirectShow is in OPM too. But i dont know how good that version is working.

regards
Andreas

metis

  • Sr. Member
  • ****
  • Posts: 300
Re: I need to playback mp4 video files
« Reply #8 on: November 04, 2021, 10:11:52 pm »
@RedOctober

Quote
I need the simplest most light weight component, to just "play video" in a window.
If You can make-friends with a non-component-solution, my FFPlay4Laz-Player/-PlayerEngine should be exactly, what You're Looking for:
A minimum Player with maximum Performance:
https://forum.lazarus.freepascal.org/index.php/topic,26666.msg337046.html#msg337046

see:
The FFPlay4Laz-AV-Engine is something like a "Mini-VLC", reduced to and optimized for pure PlayerFunctions & Sound.

Unlike 'VLC', there's no Installation needed. It's all portable.
You simply copy the PlayerFiles and the required DLLs for FFmpeg, SDL and Portaudio into the same Folder.
That's all. And, You can run as much Player simultaneously as You're System can bear.

This Release still uses SDL1. I tried it from WinXP to Win10, and it works w/o Issues.

If You don't like my AV-PlayerEngine, but my Player-GUI, You may modify that GUI to
use it with 'VLC' (or any other AV-PlayerEngine).

In the Meantime, I updated the entire PlayerCode to SDL2, and added some more PlayerFeatures.
The updated ConsoleVersion runs on my PC since months, and a I plan to publish it within the next Weeks.
If You don't want to wait 'till then, I can put an alpha-Version into the Attachment for You.

If You actually only need an AV-Player, w/o any Features, try my Minimalst-FFmpeg-Player with SDL2:
https://forum.lazarus.freepascal.org/index.php/topic,26666.msg373185.html#msg373185

Hope You like it  :)
Life could be so easy, if there weren't those f*** Details.
My FFmpeg4Lazarus = FFPlay4Laz + FFGrab4Laz + FFInfo4Laz

BosseB

  • Sr. Member
  • ****
  • Posts: 470
Re: I need to playback mp4 video files
« Reply #9 on: November 18, 2023, 10:21:29 am »
I use PasLibVLC for this purpose. Install LazVLC from online package manager.
Just a question:
I cannot find LazVLC in OnLinePackageManager in Lazarus (both on Windows and Linux)...

How can you get LazVLC into OLPM?
--
Bo Berglund
Sweden

Handoko

  • Hero Member
  • *****
  • Posts: 5290
  • My goal: build my own game engine using Lazarus
Re: I need to playback mp4 video files
« Reply #10 on: November 18, 2023, 10:50:23 am »
For some unknown reasons, LazVLC is not available in OPM, I can't find it in OPM too. Maybe you can try other libraries.

Handoko

  • Hero Member
  • *****
  • Posts: 5290
  • My goal: build my own game engine using Lazarus
Re: I need to playback mp4 video files
« Reply #11 on: November 18, 2023, 10:53:24 am »
I found it. LazVLC is available to install from standard Lazarus Package Manager:
Lazarus main menu > Package > Install/Uninstall Packages > right panel, type: lazvlc

BosseB

  • Sr. Member
  • ****
  • Posts: 470
Re: I need to playback mp4 video files
« Reply #12 on: November 18, 2023, 12:40:59 pm »
Thanks, I found it there as you suggested.
After install/rebuild Lazarus it is located in a new tab "Multimedia"

Now I will see if I can find any description on how to use it and maybe replace PasLibVLC, which I cannot get working on this device at all...
But that would be a separate thread...
--
Bo Berglund
Sweden

Pe3s

  • Hero Member
  • *****
  • Posts: 547
Re: I need to playback mp4 video files
« Reply #13 on: November 18, 2023, 05:09:58 pm »
Hello, I have tested various video playback components, currently I am using UW_MPVPlayer.
https://github.com/URUWorks/UW_MPVPlayer

Eloir

  • New member
  • *
  • Posts: 8
Re: I need to playback mp4 video files
« Reply #14 on: November 24, 2023, 02:48:20 pm »
Hallo
I am looking for a video player too. In my case, to incorporate to my own Kodi (for those who know it) project.
I was very satisfied with TPasLibVlcPlayer component: ease to use, have all commands I need, etc.
But...
When playing some videos, I got that well known green screen. It has nothing to do with the component itself, but with the VLC library, I think. VLC is updated in my computer and even playing that problematic video directly on VLC, the problem occours.
By disabling Hardware Acceleration, as said in many sites I googled into, the problem disappears.
I played the same video on ffmpeg command line, and video plays fine.
That means, in my opinion, that ffmpeg is more reliable. That's why I am looking for a player based on ffmpeg library.

 

TinyPortal © 2005-2018