Recent

Author Topic: Can I use FFPlay4Laz to replace PasLibVlc?  (Read 1681 times)

BosseB

  • Sr. Member
  • ****
  • Posts: 468
Can I use FFPlay4Laz to replace PasLibVlc?
« on: December 14, 2023, 10:13:22 am »
I just stumbled across the FFPlay4Laz thread and I would like to know a few details about the project:

Background
I have built a video editor based on PasLibVlc on Windows 10.
It is used to remove ads from downloaded video streams and uses PasLibVlc to navigate through the video to find the necessary cut points. These are then used to create an ffmpeg command to actually extract the wanted parts and pasting them to a final video for viewing.
I use a number of VLC functions in this app but mainly I can play and jump through the video to pinpoint the cut positions. The video plays in a PasLibVlc container on my application. I can speed up and down playback as well as jump fixed times and by clicking on a progressbar. Etc...

Migration
Now I want to migrate this application to Linux (Ubuntu on PC hardware and RaspberryPi) and I have not been able to get PasLibVlc to work properly so I am giving up that and looking for other possibilities.

I have looked at the built-in VLC package LazVLC but it seems to be missing a couple of hooks into the VLC API, which I use from PasLibVlc, and it also (of course) needs VLC to do the magic...

I really would like something that can be adapted to my application as a drop-in player but maybe using ffmpeg directly.

Questions
1) Can FFPlay4Laz be inserted into an existing PasLibVlc application without a complete rewrite?
2) Does it support playback speed changes like VLC?
3) Can I adjust the video/audio delay so as to compensate for bad lip sync?
4) Is there an event or similar during playback that can update a progressbar?
5) Will it run on 64 bit linux (Debian Bookworm)?

--
Bo Berglund
Sweden

metis

  • Sr. Member
  • ****
  • Posts: 300
Re: Can I use FFPlay4Laz to replace PasLibVlc?
« Reply #1 on: December 16, 2023, 03:50:14 pm »
Hi BosseB !

Quote
... mainly I can play and jump through the video to pinpoint the cut positions.
You can do the same with FFPlay4Laz, only faster, without Audio-/Video-Lags, nor Gaps, and with much better AudioQuality via Portaudio.
For Details see here; for all currently implemented PlayerFeatures and -Options, see the ReadMe-Files in the Attachment.

Quote
Questions
  • ad 1. + 4. Yes, the FFPlay4Laz-API is similar to VLC. All event-driven.
    See the FFPlay4Laz-LIB and -GUI, which is currently only for SDL1 - Same for SDL2/SDL3 is projected.
  • ad 2. + 3. No, but projected - So far the main focus has been on Speed & Sound.
  • ad 5. Currently everything is compiled for Windows, 32-bit, which works from WinXP to Win10 w/o Modifications.
    I use it on Linux Mint, 32-bit via WINE - Works fine.

Maybe MPV is more likely to meet Your Needs.
Espectr0 wrote FPC-Wrapper for MPV for his Project.

Hope, this was helpful 4 U  :)
« Last Edit: December 16, 2023, 03:59:23 pm by metis »
Life could be so easy, if there weren't those f*** Details.
My FFmpeg4Lazarus = FFPlay4Laz + FFGrab4Laz + FFInfo4Laz

BosseB

  • Sr. Member
  • ****
  • Posts: 468
Re: Can I use FFPlay4Laz to replace PasLibVlc?
« Reply #2 on: December 16, 2023, 05:25:12 pm »
ad 5. Currently everything is compiled for Windows, 32-bit, which works from WinXP to Win10 w/o Modifications.
I use it on Linux Mint, 32-bit via WINE - Works fine.
So that means as a 32 bit windows application running below Wine on Linux.
But that also means that the Linux must be running on PC hardware (x86 CPU), right?
See here on the RPi forum:  https://forums.raspberrypi.com/viewtopic.php?p=1804971#p1804971


I was looking for something I could build and use on the RPi4/RPi5 platform, which uses the Arm CPU...

Thanks anyway, I guess it was a long shot..
--
Bo Berglund
Sweden

metis

  • Sr. Member
  • ****
  • Posts: 300
Re: Can I use FFPlay4Laz to replace PasLibVlc?
« Reply #3 on: December 16, 2023, 05:48:38 pm »
See 'How to Set Up Wine on Raspberry Pi':
https://www.instructables.com/How-to-Set-Up-Wine-on-Raspberry-Pi-1/
I never tried that. Maybe there is something similar for RPi4/RPi5.
Try it out for Yourself.
« Last Edit: December 17, 2023, 02:51:17 pm by metis »
Life could be so easy, if there weren't those f*** Details.
My FFmpeg4Lazarus = FFPlay4Laz + FFGrab4Laz + FFInfo4Laz

BosseB

  • Sr. Member
  • ****
  • Posts: 468
Re: Can I use FFPlay4Laz to replace PasLibVlc?
« Reply #4 on: December 17, 2023, 05:07:22 pm »
If I must install a Windows emulator on Linux in order to run a Windows application I can just as well stay on Windows...

I was rally looking for a cross-platform (in the real sense) solution for porting my application over.

The strange thing is that I have now tested the following and it does not pan out:
- Videoplayer application based on PasLibVlc working fine on Windows10 x64
- Commit the latest source changes to SVN on Windows 10 (notice: a working Lazarus/Fpc application)
- Check out on my newly configured RPi5B with Pi-OS 64 bit, which includes the VLC Player as part of the install.
- Open the project in an environment using Fpc 3.2.2 and Lazarus 2.2.6 (same as on Windows)
- IFDEF away some Win-only test code I had included for inspecting other windows, which does not work on Linux.
- Build it (no errors shown).

When I start the application it looks essentially OK except where the player normally shows a black screen it now shows just an empty gray panel. It is really as if the PasLibVlc player component, which should fill the parent panel is not operating properly...
Note that VLC Player is installed on the RPi5B as part of the standard configuration.

I can still click the "open video" button and navigate to a video file to load it etc but nothing changes on screen.
No video shown and no errors either.

This is why I was looking for another video solution that would be cross-platform.

I probably should try to understand how to work with LclVlc, which comes included with FreePascal.
But it is a bit hard understanding how to use it as I need to.
« Last Edit: December 17, 2023, 05:11:07 pm by BosseB »
--
Bo Berglund
Sweden

metis

  • Sr. Member
  • ****
  • Posts: 300
Re: Can I use FFPlay4Laz to replace PasLibVlc?
« Reply #5 on: December 18, 2023, 09:04:30 pm »
Quote
If I must install a Windows emulator on Linux ... I can just as well stay on Windows...
Apart from Wine not being an Emulator, it always depends on, what You need it for, e.g. ...
I use 3 OSs with different SetUps for different Tasks (WinXP+Linux Mint at Home and Win10 at my Workplaces), but
I want the same PlayerBinaries for all my Systems without Compatibility- or Installation-Issues (as obviously with VLC).
I can put FFPlay4Laz on an USB-Stick, and it runs, wherever Windows or Wine is installed (see Wine Features), w/o any Modifications. ;)

Quote
... the player normally shows a black screen it now shows just an empty gray panel.
I used VLC many Years ago, but if I remember well, ...
This is the DefaultColor of the VLC-Component's Playerscreen, which is a Panel, and it means, that the Playerscreen-Window is not recognized by the System.
This has nothing to do with Your VLC-Installation. Set another PanelColor, e.g. red, to get that verified.

Quote
This is why I was looking for another video solution that would be cross-platform.
Why don't You try MPV, which is cross-platform ?
For my Part, I like MPV better than VLC - IMHO, VLC is a (very good) general Solution for general Needs.
« Last Edit: December 18, 2023, 09:39:39 pm by metis »
Life could be so easy, if there weren't those f*** Details.
My FFmpeg4Lazarus = FFPlay4Laz + FFGrab4Laz + FFInfo4Laz

BosseB

  • Sr. Member
  • ****
  • Posts: 468
Re: Can I use FFPlay4Laz to replace PasLibVlc?
« Reply #6 on: December 19, 2023, 12:03:24 am »
Quote
This is why I was looking for another video solution that would be cross-platform.
Why don't You try MPV, which is cross-platform ?
For my Part, I like MPV better than VLC - IMHO, VLC is a (very good) general Solution for general Needs.

So I have installed mvp (sudo apt install mvp) and I have verified that when starting from a command prompt with an existing mp4 video as the only argument it pops up a player window on the GUI screen in which the video plays.

Now that works at least, but I need a lot more to control its operations, how can I find that?
- Video screen integration into an application panel, which can be resized while the video plays.
- Continuous update of a progressbar position as the video plays.
- Update also of a "current video time" label
- Command to jump to a position in the current playing video (seconds from start).
- Pause-continue-end commands from within the application.

Is there some fpc/Lazarus package that wraps the way to call functions in mvp from Lazarus/fpc?
When the player is started from a command window it seems like it responds to keyboard entries, how can that be utilized if it is integrated on the main application?

I have no real experience with working across applications so I am looking for an integrated solution.

--
Bo Berglund
Sweden

metis

  • Sr. Member
  • ****
  • Posts: 300
Re: Can I use FFPlay4Laz to replace PasLibVlc?
« Reply #7 on: December 19, 2023, 11:22:57 am »
Quote
I need a lot more to control its operations, how can I find that?
Ask Espectr0, who uses MPV for his Subtitle-Editor 'Subtitle Workshop'.
I assume, he needs the same PlayerFunctions as You do for Your VideoEditor.

Quote
I need a lot more to control its operations
As already mentioned above, Espectr0 wrote FPC-Wrapper for MPV.
Here are some useful Infos about MPV on Ubuntu. (in German, sorry Guys)

Quote
Is there some fpc/Lazarus package ...
AFAIK, no.

Quote
it responds to keyboard entries, how can that be utilized
For Sending KeyStrokes to a CLI, see here.
BTW, he uses the OMXPlayer for Raspbian.
(The Code has been integrated into VLC in the Meantime, but here You can see the Usage of the OMXPlayer itself.)
Life could be so easy, if there weren't those f*** Details.
My FFmpeg4Lazarus = FFPlay4Laz + FFGrab4Laz + FFInfo4Laz

 

TinyPortal © 2005-2018