ffplay-gtk-1.9 for all porteus versions

Post links to your 32-bit module repos here. Repo maintainers are responsible for resolving any issues caused by their xzm's.
User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

ffplay-gtk-1.9 for all porteus versions

Post#1 by ncmprhnsbl » 13 Dec 2020, 03:44

a simple gtkdialog frontend for ffmpeg/ffplay .. . plays video and audio and playlists
ffplay-gtk-1.9-noarch.xzm 36kb
md5sum: 3e177b32425ff00c26aca76a92cc9196
from http://murga-linux.com/puppy/viewtopic.php?t=117468 with thanks to Puppy user plinej
i made some small tweaks to the script so that it works happily with gtkdialog 2 and 3
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

ffplay-gtk-1.9 for all porteus versions

Post#2 by donald » 13 Dec 2020, 05:26

BE CAREFUL
this tool has issues.


I'm a fan of ffplay and use it daily - without this GUI-tool.

So what's wrong with it?
a) the play/pause button does something weird.
Example:
play a video > click that button a couple of times and the CPU usage/temp
goes up more and more.Now if you close the app, CPU usage doesn't come down
and you have a bunch of "ffplay-gtk-timer timer nofraction xxxx play" entries
in Taskmanager.
Also, if you press this play/pause button the video closes.This is not the normal
bahaviour of ffplay.
(press spacebar to see how it should be)

minor - there is no fullscreen option ( press the F key if you want fullscreen )

...check the CPU usage / temp when using this tool!!

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

ffplay-gtk-1.9 for all porteus versions

Post#3 by ncmprhnsbl » 13 Dec 2020, 07:21

thanks for the feedback, donald :good:
hopefully it's nothing i did :(
anyway folks, you've been warned
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

raja
Shogun
Shogun
Posts: 434
Joined: 02 May 2017, 09:51
Distribution: v3.2.2-32 and Porteus-Artix-64
Location: Chennai,India

ffplay-gtk-1.9 for all porteus versions

Post#4 by raja » 18 Dec 2020, 17:19

ffplay even from the terminal uses 30 percent more cpu power, And for some reason, the program does not close on media end. Looks like it is not recognizing end of playing media. One has to use ctl+c to get back to prompt.
Now if you close the app, CPU usage doesn't come down
and you have a bunch of "ffplay-gtk-timer timer nofraction xxxx play" entries
in Taskmanager.-donald
I installed youtube-dl and youtube-dl-gui in 32 bit porteus-4.0 lxde. youtube-dl-gui, updates the downloader to a current working script. I downloaded 2 videos.

In 5.0-rc2, 64 bit, youtube-dl-gui installs in python-2.7/sitepackages. Needs development with Python-3.8.
Linux Kernel-4.4.272 -32 bit; Linux Kernel-5.4.185 - 64 bit

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

ffplay-gtk-1.9 for all porteus versions

Post#5 by donald » 19 Dec 2020, 00:13

raja wrote:
18 Dec 2020, 17:19
ffplay ....the program does not close on media end. Looks like it is not recognizing end of playing media. One has to use ctl+c to get back to prompt.
ffplay - (not ffplay-gtk) -

Code: Select all

guest@porteus:~$ ffplay -autoexit -nostats video.mp4
https://ffmpeg.org/ffplay.html#While-playing

I set ffplay as the default application for video files.
... one click on a video file and it will be played.. B)

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

ffplay-gtk-1.9 for all porteus versions

Post#6 by Rava » 26 Dec 2020, 08:15

donald wrote:
19 Dec 2020, 00:13
ffplay - (not ffplay-gtk) -

Code: Select all

guest@porteus:~$ ffplay -autoexit -nostats video.mp4
https://ffmpeg.org/ffplay.html#While-playing

I set ffplay as the default application for video files.
... one click on a video file and it will be played.. B)
While photorec was is hard working recovering files to a partition on an external harddisk

Code: Select all

Elapsed time 9h30m37s - Estimated time to completion 7h57m51
I wanted some entertainment: playing videos from the same external harddisk but other partition.

mpv was unable doing so, he was having massive buffering issues, and ffplay almost every time played videos just fine.

My only issues:
How can you control ffplay using your mouse, not keyboard? As in: pause, move forwards or backwards…
Also when started from thunar, how do I get ffplay to display the current position of the played video?
Cheers!
Yours Rava

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

ffplay-gtk-1.9 for all porteus versions

Post#7 by donald » 27 Dec 2020, 02:02

FFplay is a very simple media player...convenient to use via the keyboard.

Mouse options are:
right mouse click in video window:
Seek to percentage in file corresponding to fraction of width.
[left side = start of video, right side = end of video ; and any point between these two.]

left mouse double-click in video window:
Toggle full screen.

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

ffplay-gtk-1.9 for all porteus versions

Post#8 by Rava » 27 Dec 2020, 03:35

donald wrote:
27 Dec 2020, 02:02
FFplay is a very simple media player...convenient to use via the keyboard.
and sadly a bit inconvenient to used via a virtual keyboard. Among other issues the virtual keyboard florence disables real full screen modes in all image or video viewers/players. You still see the top panel and artefacts of florence even when florence got minimized, unless you first switch to a different desktop.
Could also be an xfce 5.0rc2 issue since I not get that on 4.0 32 bit Porteus.
donald wrote:
27 Dec 2020, 02:02
Mouse options are:
right mouse click in video window:
Seek to percentage in file corresponding to fraction of width.
[left side = start of video, right side = end of video ; and any point between these two.]

left mouse double-click in video window:
Toggle full screen.
:friends:
So no info on the current position unless started via console.
I think that this at least could be accomplished via a shell script that gets gets started as the default program for sound or video files and that is run by e.g. uxterm and starts the actual ffplay. Donald dear, do you agree that this should work for displaying the current position even when started by thunar?
Cheers!
Yours Rava

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

ffplay-gtk-1.9 for all porteus versions

Post#9 by donald » 27 Dec 2020, 05:05

There is a possibility to show the play time
ffplay -vf "drawtext=text='%{pts\:hms}'..+ box window parameters.

But the filter "drawtext" is not included in the ffmpeg build. (port 3.2.2)
maybe in your version.
check with
ffmpeg -filters | grep -i drawtext

btw
from terminal use
ffplay -autoexit -hide_banner video.mp4 > less useless text
or
ffplay -autoexit -hide_banner -nostats video.mp4 > no text at all

IMO, use ffplay as it is / what it can do and what not.
I love it because it is what it is, small,simple,already included in porteus,
one click and a video is being played.[if set as default app].

If I need more, there are other Players.

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

ffplay-gtk-1.9 for all porteus versions

Post#10 by Rava » 27 Dec 2020, 12:01

Now, while

Code: Select all

ffplay -vf "drawtext=text='%{pts\:hms}'" -i FILE
works, I would need to draw a white box, or have a white outline aka shadow around the black text.
Or the info is only readable when the upper left corner currently is bright coloured.
For the test video of 640x360 that would be 93 width & 10 height - or do I have to use the full screen size of the text?

How do you know about drawtext=text='%{pts\:hms}' %{pts\:hms} parameters when ffmpeg -hide_banner -filters | grep -i drawtext -A 20 only tells us

Code: Select all

  text              <string>     ..FV...... set text
ffplay -hide_banner -vf "drawtext=text='%{pts\:hms}'" -vf "drawtext=shadowcolor='white'"
not works, nor does
ffplay -autoexit -hide_banner -vf "drawtext=text='%{pts\:hms}'" -vf "drawtext=box" -i "$*"
Both cases act the same as
ffplay -autoexit -hide_banner -vf "drawtext=text='%{pts\:hms}'" -i "$*"
What do I miss?
Cheers!
Yours Rava

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

ffplay-gtk-1.9 for all porteus versions

Post#11 by donald » 27 Dec 2020, 19:01

Try this line [found with the help of a search engine] ;)

Code: Select all

ffplay -vf "drawtext=text='%{pts\:hms}':box=1:x=(w-tw)/2:y=h-(2*lh)" video.mp4
But to be honest, I'm not motivated to spend more time on it. -- :book:

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

ffplay-gtk-1.9 for all porteus versions

Post#12 by Rava » 28 Dec 2020, 01:01

donald wrote:
27 Dec 2020, 19:01
Try this line [found with the help of a search engine] ;)

Code: Select all

ffplay -vf "drawtext=text='%{pts\:hms}':box=1:x=(w-tw)/2:y=h-(2*lh)" video.mp4
You are the best…
donald wrote:
27 Dec 2020, 19:01
But to be honest, I'm not motivated to spend more time on it. -- :book:
I understand since -vf "drawtext=text='%{pts\:hms}' etcetera not works on your ffplay …

Unfortunately it also not works on ffplay of Port 4.0 i586.
Is there a way replacing ffplay in Port 4.0 i586 other than compiling it with the drawtext options enabled?
Cheers!
Yours Rava

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

ffplay-gtk-1.9 for all porteus versions

Post#13 by Rava » 12 Jan 2021, 17:19

donald, I created this script thinking of you.
Place it in $PATH - but go to your video folder and use a relative path.
E.g. go to /mnt/sda6/video and execute it like so:

Code: Select all

# make-ffplay-script Filme
or

Code: Select all

# make-ffplay-script Filme/
but not like so

Code: Select all

/somewhere/else # make-ffplay-script /mnt/sda6/video/Filme/
and it will create Filme.sh that plays all supported files in alphanumerical sorted way - makes more sense for a series than for diverse collection of movies.
Filme/ is meant to be an existing folder in $PWD containing supported files.

It is meant to use relative paths not absolute ones so that any drive with the videos can be played regardless if its mounted as sdb or sdz.

Cave! For now it not sets Filme.sh +x for everyone, but just add this as last line

Code: Select all

chmod a+x "$PARAMETER".sh
here the code of make-ffplay-script

Code: Select all

#!/bin/sh
# V3.2 - $1 is the relative folder with the files, will be stripped of any "/" - e.g. Filme or Filme/ works but not /mnt/sda1/video/Filme nor /mnt/sda1/video/Filme/
# for now supported file endings are
# avi 	flv	mp3	mp4	mpg	mkv	ogv	TS	ts	webm	divx 	VOB	vob
PARAMETER=$(echo "$1"|sed 's|/||g')
if [ -d "$PARAMETER" ]; then
	echo working on "$PARAMETER"… writing into "$PARAMETER".sh
	echo '#!/bin/sh' >"$PARAMETER".sh
	find "$PARAMETER" |grep -E "\.avi$|\.flv$|\.mp[34g]$|\.mkv$|\.ogv$|\.[tT][sS]$|\.webm$|\.divx$|\.[vV][oO][bB]$" |sort | while read line ; do
{
 echo ffplay -autoexit -hide_banner -i \"${line}\" >>"$PARAMETER".sh
} ; done
else
	echo Given parameter "$PARAMETER" is not a directory. Abort.
	exit 1
fi
The unusual high version number explains itself by the fact it had been based on a script creating m3u playlists that had the version of 3.1
Cheers!
Yours Rava

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

ffplay-gtk-1.9 for all porteus versions

Post#14 by donald » 14 Jan 2021, 09:32

Hi Rava
Nice script. B)

I have only mp4 or webm videos and every Title has its own folder with the parts in it.
[ named 01-title.mp4, 02- ,03 etc.]

So if I'm really too lazy to click one after the other I could do something like this:

Code: Select all

find /mnt/sda4/Professor-T/ -type f -name "*.mp4" | sort | while read f; do ffplay -autoexit -- "$f"; done
[ q to jump to next file ] :)

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

ffplay-gtk-1.9 for all porteus versions

Post#15 by Rava » 14 Jan 2021, 13:03

donald wrote:
14 Jan 2021, 09:32
So if I'm really too lazy to click one after the other I could do something like this:

Code: Select all

find /mnt/sda4/Professor-T/ -type f -name "*.mp4" | sort | while read f; do ffplay -autoexit -- "$f"; done
[ q to jump to next file ] :)
[ q to jump to next file ] :) - what a surprise, same as with my script.

Still, my script could be considered having a tiny advantage towards your otherwise neat solution.

Both cannot be easily terminated, [ q ] just quits the current ffplay, and the next is started. When there are dozens video files in one folder, having to wait till next ffplay is open, [ q ] quits current ffplay, wait till next ffplay is open, [ q ] quits … … could easily be annoying.

In my case, you need to

Code: Select all

killall Professor-T.sh
(unless you have more scripts doing whatnot all named after your video folders :crazy: - but why have named these as such ) while in your solution you should look if there is not some background (cron) job using find - you probably do not want to terminate. :)

But aside from the rare need to terminate even the not yet started ffplay's - nice solution.

Maybe could even be made into the file manager association "play all supported media files in folder with ffplay"
Cheers!
Yours Rava

Post Reply