Recent

Author Topic: NON(!)-EXE FFPlay4Laz  (Read 95248 times)

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: NON(!)-EXE FFPlay4Laz
« Reply #135 on: February 20, 2021, 11:16:04 pm »
Quote
I thought that ffmpeg is a command line tool
The FFmpeg-Project consists of several CommandLine-Tools and Libraries, see here.1om]FFVCL-Site[/url].

In fact, as with most *nix born projects, command-line tools are basically front-ends for the underlying libs, so when you install the command tools the linraries are also installed as dependencies.

The distinction comes about when a third party program wants to use the provided features, because there are basically two ways of doing it: running the tools in an extra process or binding to and using the libraries.

If want one wants to do can be done with the tools, the first option is usually the more easy to implement but if one wants something more, or different, or to have even more control then one must use the libraries, which is usually (logically enough) more complex.

Which is basically what metis already said :-[
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

cdbc

  • Hero Member
  • *****
  • Posts: 1083
    • http://www.cdbc.dk
Re: NON(!)-EXE FFPlay4Laz
« Reply #136 on: February 21, 2021, 06:34:19 pm »
Hi metis
Cool!
I'd like a copy of your code, sounds great  ;)
e-mail: cdbc40<at>gmail.com
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

metis

  • Sr. Member
  • ****
  • Posts: 300
Re: NON(!)-EXE FFPlay4Laz
« Reply #137 on: February 21, 2021, 07:39:29 pm »
@cdbc

Quote
I'd like a copy of your code
'RunFFmpeg', which uses the FFmpeg-CLIs is here (totally open-source).
-> GoTo "RunFFmpeg".

The last Release of the complete Player, which uses the FFmpeg-LIBs, 'SDL' and 'Portaudio' is here (partially open-source).
This Version is still with 'SDL1'. I'm currently updating the entire PlayerCode to 'SDL2', and adding some more Features.

The FPC-SourceFile for a minimal MediaPlayer with FFmpeg-LIBs and 'SDL2' is here.

Quote
sounds great
:)
« Last Edit: February 22, 2021, 01:20:30 pm by metis »
Life could be so easy, if there weren't those f*** Details.
My FFmpeg4Lazarus = FFPlay4Laz + FFGrab4Laz + FFInfo4Laz

metis

  • Sr. Member
  • ****
  • Posts: 300
Re: NON(!)-EXE FFPlay4Laz
« Reply #138 on: February 22, 2021, 02:16:46 pm »
@lucamar

Quote
command-line tools are basically front-ends for the underlying libs
In Case of 'FFmpeg', the static CommandLine-Tools are stand-alone Programs; no more Files needed to run them.

Quote
so when you install the command tools the linraries are also installed as dependencies.
On Windows, there's no FFmpeg-Installation needed (on MacOS or LINUX, don't know - never tried it out).
You simply copy the FFmpeg-CommandLine-Tools and/or the FFmpeg-LIBs wherever You need them.
If You use the CommandLine-Tools as "shared", their Dependencies (= their LIBs) must be available, of course.

These are the Possibilities, where You can put FFmpeg-Files on Windows w/o Installation, because
Windows searches for Files in the following Sequence, when no Path is specified:
(This Explication is not meant for You, lucamar, but maybe interesting for those, You didn't know)
1. The Directory from which the Program loaded
2. The current Directory
3. The Windows SystemDirectories (= [C:\WINDOWS\system], [C:\WINDOWS\system32])
4. The Windows Directory (= [C:\WINDOWS])
5. The Directories, that are listed in the PATH EnvironmentVariable.
I use the first Option to keep may FFmpeg-Apps portabel.

Once I tried out the FFPlay4Laz-Player on LINUX with 'Wine', just out of Curiosity, and
it worked the same Way as if the Files were on Windows (only slower).
« Last Edit: February 23, 2021, 10:57:49 am by metis »
Life could be so easy, if there weren't those f*** Details.
My FFmpeg4Lazarus = FFPlay4Laz + FFGrab4Laz + FFInfo4Laz

metis

  • Sr. Member
  • ****
  • Posts: 300
Re: NON(!)-EXE FFPlay4Laz
« Reply #139 on: December 22, 2021, 04:18:45 pm »
Here's the next Release of 'FFPlay4Laz2' (first fully-featured ConsoleVersion with SDL v2):

'FFPlay4Laz' is a portable, easy-to-use, ultrafast and highly responsive Lightestweight-Mediaplayer and -RenderingEngine
(no Installation needed, all in all only 88MB on Disk with all Codecs, runs from any Drive).
It renders all Audio- & VideoFormats supported by FFmpeg (http://ffmpeg.org/general.html), optionally with
outstanding, Low-Latency PortAudio-Sound (www.portaudio.com).

The currently used FFmpeg-Version is still v4.0.2 => current FFPlay4Laz-Version is v2.4.0.2.

'FFPlay4Laz v2' does the same as its Predecessor 'FFPlay4Laz v1', but
better & faster with some more PlayerFeatures added - in Detail...

> The entire PlayerCode has been updated to SDL2 - For Differences to SDL1, see "SDL vs. SDL2":
   https://forum.lazarus.freepascal.org/index.php/topic,42698.msg376063.html#msg376063,
   and especially the 'SDL 1.2 to 2.0 Migration Guide':
   https://wiki.libsdl.org/MigrationGuide
   -> GoTo "Overview of new features - These are the most important new features in SDL 2.0".

-> Briefly spoken:
    - better Fullscreen-Support
    - better VideoQuality with less CPU-Load through Hardware-accelerated, Texture-based VideoRendering
    - better SDL-AudioQuality through 32-bit Audio (int and float)
    - many PlayerFeatures are much easier to implement with a little Help of 'SDL2', e.g.
      the whole WindowManagement and Touch-Support.

-> Simply spoken: The entire Player runs better, smoother & faster.

> Tested with FFmpeg v4.0 + v4.1.5 and SDL v2.0.7 - v2.24.1 on WinXP SP3, Win7 and Win10.

> Edited:
   - Open/Close the Player and Resizing the Videoimage within the SDL-Window were optimized
   - Pause/Resume (<Space>, <p>) is even more responsive, now (as good as no Lag, at all)
   - Seeking (<s>) and in particular Seeking PAUSED, as well as
      Opening PAUSED have been speeded up.

> Added:
   - Optionally block a ScreenSaver, while the Player is running
   - Optionally StayOnTop for the ConsoleVersion, too ('FFPlay4Laz1' did it only for the GUI)
   - Internet-Support (only Play and Pause/Resume, no Seeking)
   - Videoframe-Dropping to make highly compressed Videos playable on old PCs with slow CPUs
   - AutoPause additionally pauses/resumes OnMinimize/OnRestore
   - horizontal/vertical Flip (<h>) and continuous Rotation (<r>) of the Videoimage
   - Seeking in MJPEG-Files (= Motion JPEGs), too (was not implemented in 'FFPlay4Laz1' yet)
   - All Videoimage-Manipulations (= X/Y-Shift/AspectRatio/Zoom/Flip/Rotation) are exposed in
     the Snapshots (<F2>), so that even shifted/zoomed/flipped/rotated Videoimages can be
     copied & saved to ImageFiles.
   - Touch-Support:
     Beside the system-immanent Touchscreen-Functions (= Move/Resize, Minimize/Maximize, Close), currently
     Pause/Resume (tap once) and toggle between a bordered/borderless SDL-Window (tap twice) are available
     via Fingertouch - More Touch-Functions, like Seeking, Volume, Move&Zoom the Videoimage are projected.

> Known Issues:
   See "Known Bugs..." in 'README_Known Issues (Dec. 2021).txt'.

> Projected:
   See "ToDos/Projected..." in 'README_Known Issues (Dec. 2021).txt'.

Attached 'FFPlay4Laz2_Images.pdf' shows:
- The Player's Console, Opening a mp4- and a MPEG-File, within typical OpeningTimes of about 200-300Ms
  on my old WinXP-PC (= an INTEL Pentium DualCore 1,60GHz, 2 GB RAM + INTEL-GPU + SoundBlaster Audigy).
  The mp4-File is opened Playing with PortAudio+ASIO for maximal Sound with minimal Latency.
  The MPEG-File is opened Paused with SDL-Audio, which is an AudioOutput, that should work on every PC.
- Next to it on the right, the FFPlay4Laz2-Folder with all required Files for FFmpeg, SDL2 and PortAudio.
- Below, the Player's Videoscreen with diverse BorderColors, bordered(= resizable)/borderless SDL-Windows, and
  some Videoimage-Manipulations (= continuous X/Y-Shift/AspectRatio/Zoom, horizontal/vertical Flip, Rotation).

Attached 'FFPlay4Laz2_Files.7z' contains
all Files for the FFPlay4Laz2-Win32-ConsolePlayer, without Dependencies (= the FFmpeg-, SDL2- and PortAudio-DLLs).
There are two Executables enclosed: One compiled with ConsoleWindow, the other one without.
Get started with the one with ConsoleWindow, because it always shows Infos & Instructions for the User
-> No Helpfile needed.

See the README-Files 'PlayerFunctions' and 'PlayerOptions' for all currently implemented PlayerFeatures.

Have Fun with superior Sound, and
Merry X-Mas 2021 to all Lazarus-Users !
« Last Edit: January 10, 2023, 05:17:46 pm by metis »
Life could be so easy, if there weren't those f*** Details.
My FFmpeg4Lazarus = FFPlay4Laz + FFGrab4Laz + FFInfo4Laz

metis

  • Sr. Member
  • ****
  • Posts: 300
Re: NON(!)-EXE FFPlay4Laz
« Reply #140 on: December 22, 2022, 03:26:19 pm »
Here's the next Release of 'FFPlay4Laz2' (first "wine-friendly" ConsoleVersion with SDL v2):

Updated to 'FFmpeg v5.2' => Current Version is v2.5.2.

Together with the WinXP32-compatible FFmpeg-Builds by Reino,
this FFPlay4Laz-Version works from WinXP to Win10 and on Wine for Unix-like OSs.

Click here to download the required FFmpeg-DLLs. Then copy all extracted Files into the FFPlay4Laz2-DIR.
(You won't need the FFmpeg-EXEs, nor avdevice-59.dll, avfilter-8.dll and postproc-56.dll to run FFPlay4Laz2)

Do the same with...
- the PortAudio-DLL: libportaudio32bit.dll (old Build for WinXP / latest Builds for Win7-Win10 + Wine) and
- the SDL2-DLL: SDL2-x.x.x-win32-x86.zip (tested until v2.26.1).
Now, Your FFPlay4Laz2-Folder got all required DLLs - Start the Player.

Remember, when You're using Wine, You can treat the Dependencies (= the DLLs) as if You were on Windows,
means You may simply place them into the same Folder where the depending Application is.

Note: This FFmpeg-Build additionally supports the open, royalty-free AV1-VideoCodec (AOMedia Video 1):
- https://aomedia.org/av1-features/ (AOMedia)
- https://github.com/videolan/dav1d (VideoLAN)

Tested on: - WinXP, Win7 and Win10
                 + Linux Mint v17.2 with Wine v1.6.2

See the README-Files 'PlayerFunctions' and 'PlayerOptions' for all currently implemented PlayerFeatures.

Have Fun with superior Sound, and
Merry X-Mas 2022 to all Lazarus-Users !  O:-)
« Last Edit: December 28, 2022, 12:53:45 pm by metis »
Life could be so easy, if there weren't those f*** Details.
My FFmpeg4Lazarus = FFPlay4Laz + FFGrab4Laz + FFInfo4Laz

Eleazar

  • New Member
  • *
  • Posts: 26
Re: NON(!)-EXE FFPlay4Laz
« Reply #141 on: March 05, 2023, 05:20:36 pm »
Hello Metis,
I'm trying to understand your FFPlay4Laz project. Previously I have incorporated a video player in my application with PaslibVLC, but I was looking at alternatives.

I have tried to compile you minimalist version by gathering all necessary files from all kinds off different sources, but it is getting messy...

What exactly is FFPlay4Laz? I'm trying to find a working example with required files included in your posts, but I can't seem to find one (a Lazarus lpi project with all stuff). Would it be possible to send such a complete set?

Or is your project still partly closed source?

Could you build a videoplayer with it that is controlled from a GUI? As I understand you are currently working on a version that is embedded in a GUI?

Greetings


metis

  • Sr. Member
  • ****
  • Posts: 300
Re: NON(!)-EXE FFPlay4Laz
« Reply #142 on: March 07, 2023, 01:43:57 pm »
@Eleazar
Tnx for being interested in my FFPlay4Laz-Project. :)
Though You could find all Answers to Your Questions in this Thread, here's a Sort of Summary...

Quote
Previously I have incorporated a video player in my application with PaslibVLC, but I was looking at alternatives.
Same with me:
In the Past, I wrote diverse Player-FrontEnds with Fmod/FmodEx (= Audio-only), VLC and the MPlayer, but none of them matched my Needs :( :
I wanted a really fast and compact MediaPlayer, that would play any Audio and Video from anywhere with exceptional Sound.

Quote
What exactly is FFPlay4Laz? + I'm trying to understand your FFPlay4Laz project.
FFPlay4Laz is a portable Audio/Video-RenderingEngine, that does not depend on any other MediaPlayer-BackEnd, like
VLC, MPlayer / MPV or GStreamer, so that their Installation is not required.
It's "lightestweight": The latest Release (see above) requires only 47MB of Diskspace with all Codecs and Files, and
works from WinXP to Win10 and on Linux&Wine (Win11, macOS not tested yet) w/o any Modifications to
play any Audio- and VideoFormat from the oldest to the latest one, even on old and slow PCs.

Briefly spoken, FFPlay4Laz is...
- FFmpeg: Demuxer, Decoder, Timebases
+ SDL     : cross-platform Threads, Events, Keyboard-/Mouse-/Touch-Input, Audio-/Video-Output
+ PortAudio: Low-Latency Realtime Audio-Output,
entirely written in FreePascal (FPC).

Thus merging...
the Power&Performance of FFmpeg with the Speed&Responsiveness of SDL, proven in many Videogames, plus
the unique, crystal-clear Sound of PortAudio, which is used e.g. in UOS, Audacity, Mixxx, or LMMS, and
last but not least the Advantages of FreePascal-Programs, like HiSpeed&Stability at LoMemUsage.
Note: All these Projects, that are using PortAudio are Audio-only, whereas FFPlay4Laz is Audio and Video.

Having been inspired...
initially by the Dranger-Tutorial and finally by FFmpeg's TestPlayer FFplay (source = ffplay.c).

And having built in plenty of - partly "unusual" and unique! - PlayerFeatures, such as...
• reopen the last MRL with all previous Settings (Videoscreen-Position&Size, PlayerPosition, Audio-/VideoSettings), optionally paused
• switch back and forth between two Videoscreens or Monitors with just one Keystroke (<Tab>), e.g. for VideoPresentations or VJing
• all VideoSettings (X/Y-Shift, AspectRatio, Zoom, Rotation) are stepless to Adapt any MRL to any Screen (i.e. not only in fixed Steps, as usual)
• optionally step multiple Audio-/VideoFrames at once (i.e. not only one Frame, as usual)
• seek/repeat/loop without Audio-/Video-Lags, nor Gaps
• several AutoPause-Options: OnMinimize/Restore, OnDeactivate/Activate (= Focus), OnLeave/Enter (= Hover)
• several EOF-Options: Wait, RepeatALL/FromCUEPosition, Stop, Exit
ASIO- / JACK-Support via PortAudio
• Touch-Support for Touchscreens.
(see the first 2 attached ReadMe-Files for all currently implemented PlayerFeatures)

You probably won't feel and hear the Difference to other MediaPlayers, as long as You are only Watching Movies on Your PC or Laptop.
But, if You take it for Music, MusicVideos or Video-Tutorials and -Presentations over HiQuality-SoundSystems, You will (or at least You should) !
Info: I use FFPlay4Laz on Windows with ASIO4ALL and on Linux&Wine with PulseAudio.

Quote
I have tried to compile you minimalist version by gathering all necessary files ...
To compile it, You need the Delphi/FPC-Headers for FFmpeg and for SDL. To run the compiled Executable, You need their Libraries (see above).
The currently used FPC-Headers are always listed in the respective README_Credits-TextFile (see attached 'README_Credits (Dec. 2022).txt').
FFmpeg is under heavy Development, so You always need the corresponding FFmpeg-Headers and -LIBs. The SDL-API does not change that much.
That's why, I introduced a special Way of VersionCounting in FFPlay4Laz, here (-> GoTo "Changed: VersionCounting").
This Way, You always know, which FFmpeg- and SDL-Version to use.

Quote
I'm trying to find a working example with required files included in your posts, ...
Can't post it here, because of the 500KB-Limitation for Attachments in this Forum, and especially because of LicenceRestrictions with FFmpeg.
To avoid "LicenseIssues", it's better not to distribute FFmpeg directly, but to provide a Link to download it, like this one.
It's also recommended to use the FFmpeg-LIBs (= DLLs in Windows) than to implement FFmpeg-SourceCode in a Project.

Quote
Could you build a videoplayer with it that is controlled from a GUI? As I understand you are currently working on a version that is embedded in a GUI?
Yes, via the FFPlay4Laz-Library.
For FFPlay4Laz1 (= with SDL1), this was done together with a Demo-LCL-GUI and its Lazarus-ProjectFiles, here.
-> Download attached 'FFPlay4Laz-1.4.0.2_CLI+LIB+GUI.7z': The Version is 'v1.4.0.2', so You need 'SDL v1.2.15' + 'FFmpeg v4.0.2' + PortAudio.
The latest Version of FFPlay4Laz2 (= with SDL2) is posted above, along with the Links to all required LIBs and a Description of how to use them.
For the Moment, it's Console only. Lib and Demo-GUI are projected.

Hope, this Summary was helpful for You  :)
« Last Edit: April 13, 2023, 08:19:05 pm by metis »
Life could be so easy, if there weren't those f*** Details.
My FFmpeg4Lazarus = FFPlay4Laz + FFGrab4Laz + FFInfo4Laz

Fred vS

  • Hero Member
  • *****
  • Posts: 3168
    • StrumPract is the musicians best friend
Re: NON(!)-EXE FFPlay4Laz
« Reply #143 on: March 07, 2023, 03:07:17 pm »
@metis: No plan in 2023 to have NON(!)-EXE FFPlay4Laz on GitHub or GitLab or CodeBerg or other git server?
(And so in OPM too)  ;)

Fre;D
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

metis

  • Sr. Member
  • ****
  • Posts: 300
Re: NON(!)-EXE FFPlay4Laz
« Reply #144 on: March 09, 2023, 07:41:29 pm »
Hi Fred !
Do You mean 'OPM' like "Online Project Management" (for me) or 'OPM' like "Operating Profit Margin" (for others) ?  :D

You've already mentioned this Option some Years ago, and I've listed my Reasons, why I prefer the Lazarus-Forum.
Refering to Point "3. One never knows, who's the next Gitxxx-Owner.", I think it's worth mentioning that
GitHub is headquartered in California, and has been a Subsidiary of Microsoft since 2018.

At that Time, I started a Thread to get this Point discussed. I still think, it only makes sense for Teams of Developers, but
FFPlay4Laz, FFGrab4Laz and FFInfo4Laz are private, non-commercial One-Man-Projects.
Sorry, makes me sleep better, this Way. (bloody HobbyProgrammer ::) )

Or is there any other Reason ?
Life could be so easy, if there weren't those f*** Details.
My FFmpeg4Lazarus = FFPlay4Laz + FFGrab4Laz + FFInfo4Laz

Fred vS

  • Hero Member
  • *****
  • Posts: 3168
    • StrumPract is the musicians best friend
Re: NON(!)-EXE FFPlay4Laz
« Reply #145 on: March 10, 2023, 12:33:51 am »
...
Or is there any other Reason ?
No, the same than before, easier for the users, better visibility, easier for patch, ...
By the way if you prefer a European non-profit organization, based in Germany, with same look as GitLab, there is CodeBerg.

But ok, I will try again next year...  ;)
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

metis

  • Sr. Member
  • ****
  • Posts: 300
Re: NON(!)-EXE FFPlay4Laz
« Reply #146 on: March 12, 2023, 03:04:33 pm »
Quote
..., easier for the users, better visibility, easier for patch, ...
Sorry, but I still don't see any Advantage for small Projects, like mine:
- those, who are interested, may activate [Notify] to get always informed about Updates
- the DLLs themselves must be downloaded in any Case, with or without a Gitxxx
- got all the SourceCode well-structured on my Disk. There are no Patches.

Codeberg e.V. sounds most promising:
- situated in Germany, far away from American Patents, and "other ongoing Activities in Eastern Europe"
- owned by the Users
- non-profit, which means here more precisely, that as a German "e.V." (= eingetragener Verein),
   they are not allowed to be "primarily economically active" according to German Law.

BTW: They emphasize on their Website, that "Your data is not for sale", so
apparently there are some Places in this World, where it is. :D

Actually, there's only one Thing, that might be interesting for me:
To be added to the List of Applications that use PortAudio.
To do this, they need a Website, where People can read about the App and download it w/o Registration or Password.
(Could be interesting for Your 'UOS', too. ;) )

Note: 'VLC' is still listed there, though they dropped 'PortAudio' some Years ago,
among others because of AudioSync-Issues.

Quote
I will try again next year...
Always Looking forward to a Chat with You. :)
« Last Edit: March 19, 2023, 11:53:30 am by metis »
Life could be so easy, if there weren't those f*** Details.
My FFmpeg4Lazarus = FFPlay4Laz + FFGrab4Laz + FFInfo4Laz

 

TinyPortal © 2005-2018