Lazarus

Programming => Graphics and Multimedia => Audio and Video => Topic started by: emailadd on February 11, 2019, 11:49:20 pm

Title: ffplay in ffmpeg-1.2.12
Post by: emailadd on February 11, 2019, 11:49:20 pm
Hi all,
I found an interesting project from GitHub. It is based on ffplay of ffmpeg-1.2.12 and provides the same functions in ffplay.
It contains application examples in Codetyphon (Lazarus) /Delphi and C++.

https://github.com/YepSfx/FFPlay-1.2.12

Title: Re: ffplay in ffmpeg-1.2.12
Post by: metis on February 18, 2019, 12:53:19 pm
@emailadd

Quote
an interesting project...based on ffplay of ffmpeg-1.2.12
Yes.

Quote
provides the same functions in ffplay
No.
The present Code does, what it says in its Description: "it can play any files that ffplay.c plays".
So, it opens an URL/MRL with CommandLine-Options. While Playing, the current Position is shown, and
You may pause/resume and stop/close the Stream - nothing else, that's all.  %)
None of FFPlay's additional PlayerFunctions (https://ffmpeg.org/ffplay.html (https://ffmpeg.org/ffplay.html) -> GoTo: "While playing")
is available via this DLL, e.g. You can not seek with it - quite important for a Player, isn't it ?
=> It's a very interesting project, that needs some Extensions and Updating (v1.2.12 is from Febr. 2015).

mercury had the same basic Idea to realize a FFmpeg-Player for Lazarus by Linking to 'ffplay.c':
http://forum.lazarus.freepascal.org/index.php/topic,33105.0.html (http://forum.lazarus.freepascal.org/index.php/topic,33105.0.html).
His Code is much easier than the one above and it includes PlayerFunctions like
Seek, NextFrame, SetVolume, Change the Audio/Video/Subtitle-Stream.
At that Time, I posted a modified 'ffplay.c' (v2.8.6), that is based on his Idea. It can be compiled
either to a FFPlay-EXE or to a FFPlay-DLL simply by Setting only one CompilerDirective, see:
http://forum.lazarus.freepascal.org/index.php/topic,33105.msg218166.html#msg218166 (http://forum.lazarus.freepascal.org/index.php/topic,33105.msg218166.html#msg218166)
-> GoTo: "MainChanges:", download the attached 'LibFFPlay_ModifiedByMetis_01.7z' and
   search "MAKE_FFPLAY_DLL" in that 'ffplay.c'.
=> mercury's 'LibFFPlay' works, too; it only needs some minor Changes (read my Comments in the Thread).

IMHO, the Best would be a Mix of these two Projects - Do You know C++ ? Are You interested ?  ;)
[Tip: The right Place to pick VideoData is here: 'FFPlayLib.c' -> "FFP_events->event_video( FFP_events->sender, &yuvData );" ]

BTW: Do You know my FFPlay4Laz-Project, a FFmpeg-Player totally written with FPC ?
The latest Release is a Console, which can be downloaded here:
http://forum.lazarus-ide.org/index.php/topic,26666.msg286945.html#msg286945 (http://forum.lazarus-ide.org/index.php/topic,26666.msg286945.html#msg286945)).
Since then I've added some MousewheelFunctions (Seek, Volume, X/Y-Shift, continuous(!) AspectRatio, Zoom).
Furthermore I have put the Code into a DLL and wrote a Test/Demo-GUI for that DLL.
The only Thing, that holds me back from Releasing it are some Issues, when Resizing the VideoImage
with the MainForm - all the Rest works really fast and responsive, by having:
- no Timers, all event-driven
- no 'CheckSynchronize()', no 'Application.ProcessMessages', no 'Sleep()', etc. 
- the SDL-Window embedded in the GUI (with all Mouse- and KeyFunctions working just as in the Console)
- PortAudio-AudioOutput implemented for minimal Latency and maximum AudioQuality.

I use the FFPlay4Laz-DLL on my PC since last Summer. Attached, You find its Wrapper, just to
give You an Idea of what 'FFPlay4Laz' does and to show You, how easy it is to use with Lazarus.
TinyPortal © 2005-2018