FE 'tkGooie' Utilities

'VIDEOtools' & 'AUDIOtools' group

A Tk GUI utility to
Play Media Files
named in a Playlist file
(video or audio)

(FE = Freedom Environment)

FE Home Page > FE Downloads Page >

FE 'tkGooies' Description Page >

FE 'tkGooies' 'VIDEOtools' Page   OR

FE 'tkGooies' 'AUDIOtools' Page >

VIDEOtools/AUDIOtools tkGooie Page

'tkPlayMediaFilesInPlaylist' tkGooie

On 2014mar02, I contributed code at the Tcler's Wiki at wiki.tcl.tk in a page titled

'tkShowImageFilesInPlaylist - a front-end for multiple image viewers'.

That Tk script code uses several image viewers ('eog', 'display', 'ffplay') in making a 'show-image-files-in-a-playlist' Tk-script utility.

That page mentioned that another utility would follow --- a utility to show 'media' (video/movie or audio) files, named in a 'playlist' file --- using media-players such as

  • mplayer
  • gmplayer
  • smplayer
  • gnome-mplayer
  • ffplay
  • totem
  • VLC

That 'play-media-files-in-a-playlist' utility is the subject of this page.

One Way to Build the Media Playlist

These two (images and media) 'show/play-files-in-a-PLAYLIST' utilities are follow-up's to two corresponding 'batch' 'find-and-show/play-files-in-a-DIRECTORY-HIERARCHY' utilities.

Those two utilities were posted at wiki.tcl.tk in 2013 December on pages titled


The first provides a Tk GUI 'front end' to a combination of the 'find' command and a user-selectable image viewer command/program.

The second provides a Tk GUI 'front end' to a combination of the 'find' command and a user-selectable media-player command/program.

These two 'batch-find' utilities have GUI's that were designed to offer the user the ability to 'automatically' select image/media files within a DIRECTORY HIERARCHY --- according to criteria such as filename-mask, file-size, file-age, and file-type --- and show the image/media files in a sequence --- with a choice from several image-viewer/media-player programs.

    (In these Tk scripts, it is quite easy to switch out any of these viewer/player programs/commands to replace them with another viewer/player that is available in a user's operating environment.)

Each of these two 'Batch-Find' utilities was implemented as a Tk script and 2 shell scripts.

As such, they should be implementable with very few changes in various Linux, BSD, Mac, and Unix operating system environments.

An intended use of the 'batch-image-viewer' and 'batch-media-player' utilities was to allow for quickly surveying image/media files that may be scattered throughout a directory hierarchy --- such as sub-directories of a web site --- OR sub-directories of a home directory --- OR sub-directories on multiple disk drives mounted on a computer --- OR sub-directories of a removable storage device mounted on a computer.

However, two drawbacks of these batch find-and-show/play utilities are that

  • the files are viewed in a fixed order (according to a filename sort)


  • the user may encounter many files that they are not so interested in seeing.

A nice feature:

These batch-find utilities can be used to find image or media files from a vast hierarchy of directories --- and relatively quickly review them.

The 'batch-image-viewer' and 'batch-media-player' utilities have a 'show-selected-files' button-option that lists the files selected via the search criteria (filename-mask, file-size, file-age, and/or file-type).

The filenames list is shown in a popup window, in a Tk 'text' widget.

So the list of filenames could be pasted in a text-editor window --- and the user could change the ORDER of the files and ELIMINATE files that the user does not want to view/play, for this particular group of files.

In other words, the user could rather easily make a 'playlist' of files to be viewed with an image-viewer program --- or a playlist of movie/audio files to be played with a 'media-player' program --- in particular, for use in the utility presented on this page.

If I were to prepare a playlist file of movie/audio files, I just needed a utility to 'play' the files --- preferably a low-cost (like free) utility that is easily enhanced/modified/fixed.

That is the purpose of the 'play-media-files-in-a-playlist' utility whose Tcl-Tk code is presented below.



It is conceivable that a person could make an image viewer with Tcl-Tk --- one that reads image files named in a 'playlist' --- by using the 'photo image' reading capability of Tk along with the Tk 'canvas' widget capabilites.

However, it is not so feasible to make a video player with Tcl-Tk --- one that reads video files named in a 'playlist' and displays the frames of each video in a Tk GUI --- because (it seems to me) that there is no capability for showing video frames in the Tk GUI (say, on the 'canvas' widget) --- at least no efficent way.

Furthermore, there does not seem to be a nice/easy way to play the audio track(s) in a movie file AND show the video frames of the movie in a Tk GUI.

    (Another problem is that there are so many different video and audio formats.

    An overview of these formats is provided at the bottom of this page.)

BUT, one could make a movie/audio player --- for filenames in a 'playlist' file --- by using existing media-players, such as the ones listed above.

And that is the type of utility presented on this page --- a utility that reads a 'media playlist' file and uses some 'external' media-players to play the media.

In other words, the Tk GUI utility on this page is a 'front end' for

    reading a media playlist file (containing names of movie and/or audio files)


    playing the sequence of files in the playlist, using 'external' media-players.



My goals for the Tcl-Tk script were:

  • provide a GUI for selecting a 'playlist' of movie/audio files.

  • allow the user to select a media-player program from among multiple choices.

  • allow the user to select a 'fullscreen'-size or 'default'-size mode of display.

  • provide a 'Launch' button to start showing the media files, in the order of the filenames within the playlist file.

  • provide a 'Stop' button for 'interrupting' the display of a (long) sequence of media files.

  • like on the 'batch-find-images-and-view' and 'batch-find-media-and-play' utilities, provide 'Count' and 'List' buttons on the GUI to allow for quickly counting and displaying the (full) filenames of the media files in the playlist file.



Like for the 'show-image-files-in-a-playlist' 'slideshow' utility, I made a 'text-sketch' for the GUI for this 'play-media-files-in-a-playlist' utility:

  Play *Media* Files of a *Playlist* ...  with a choice of media-players
  [window title]
  {Exit} {Help} {LaunchPlayerJob} {Stop (no more files)}    {CountMediaFiles} {ShowMediaFilenames}
  Playlist Filename: ____________________________________________________________  {Browse...}
  Player Program:  O 1 mplayer   O 2 ffplay   O 3 totem   O 4 gmplayer   O 5 VLC   O 6 smplayer
  Display Size: O Default   O Fullscreen



   Square brackets indicate a comment (not to be placed on the GUI).
   Braces indicate a Tk 'button' widget.
   Underscores indicate a Tk 'entry' widget.
   A colon indicates that the text before the colon is on a 'label' widget.
   Capital-O indicates a Tk 'radiobutton' widget.
   Capital-X indicates a Tk 'checkbutton' widget (if any).

GUI Components

From the GUI 'sketch' above, it is seen that the GUI consists of about

  • 7 button widgets
  • 3 label widgets
  • 1 entry widget
  • 8 radiobutton widgets in 2 groups
  • 0 checkbutton widgets
  • 0 scale widgets
  • 0 listbox widgets

about 19 widgets in all (not counting 'frame' widgets).


The intent of this utility is to allow the user to easily specify media files to be played ... by building a simple 'playlist'.

The playlist file for this utility contains three types of lines:

  1 - Comment lines may be indicated in the file by a # sign
      in column 1.

  2 - Lines that contain a fully-qualified directory name
      or a 'dot' directory name.
      Examples: /data/movies/tennis2013 or
                $env(HOME)/tennis2013  or
                /home/fred/tennis2013  or
                .                      or
      These lines must start with either slash(/) or $ or dot(.).

      The dot can be used to represent the directory in which
      the playlist file lies. This useful when putting the playlist
      file in a directory of media files and using the dot to
      represent the directory of the media files. The directory of
      media files may have sub-directories of media files, as indicated
      by the last example. The dot allows for moving/copying the
      media files (with the playlist file) to different directories
      without having to change the internals of the playlist file.

  3 - Lines that contain a relative filename (relative to the
      previous directory name)
      Example: Federer_vs_Nadal_2013.mp4
      These lines DO NOT start with either slash (/) or $ or dot(.)
      or #.

The first non-comment line of the playlist file should be a directory name.

There can be more than one directory name in the file.

Each directory-name-line is followed by names of image files that are in the specified directory.

A SAMPLE media playlist file:

 # A description of this file could go here.
 # First directory:
 # Second directory:


This 'Front End' Tk script is essentially a 'front end' for the media-player programs that are offered via radiobuttons on the GUI. --- the first set of radiobuttons.

A second set of radiobuttons allow for running the several media-players in 'fullscreen' mode, instead of a 'default' mode.

The 'default' mode may vary, depending on the player chosen, but it is typically play-a-movie-at-its-original-size- unless-it-is-too-large-for-the-screen.

In the future, if there are some other options --- other than 'fullscreen' --- (of at least one of the media-players) that would seem nice to implement, then additional widgets could be added to the GUI to support those choices.

Beautification of the GUI

I should point out here that I was not especially interested in coming up with a 'beautiful utility'.

I just wanted a utility for playing media files

  • that are specified in a playlist file
    (with a very simple format)

  • while allowing several different choices of media-player

  • via an easy-to-use GUI (a small set of mouse clicks).

I am certainly interested in making pretty GUI's --- as I have indicated by Tk script examples that I posted at wiki.tcl.tk on pages titled


But at this time, I am satisfied to implement the 'functionality', and let the 'beauty' go for a later date (when I have more beauty tools/code at hand).


On the basis of the GUI-layout sketch above, I ended up with the GUI seen in the following image.

Note that there are several radiobuttons that allow you to choose the media-player to use --- and a couple of radiobuttons to choose fullscreen-mode, or not.



You can use the 'Browse...' button to retrieve a full filename to the filename entry field.

Before clicking on the 'LaunchPlayerJob' button, you can also change radiobutton settings as needed --- for

  • a player program


  • display size ('fullscreen' or the 'default-size' used by the player).

Closing the player window causes the next media file to be played.

Use the 'Stop' button to skip playing the remaining files in the playlist file.


Optionally, if you want to check the number or names of the media files specified in the 'playlist' file, then, after selecting a playlist file, click on the 'CountMediaFiles' or 'ShowMediaFilenames' button.



Note that this utility has the flexibility of a 'playlist' approach.

The user is given an opportunity to SELECT the files to be shown and is given the opportunity to choose the ORDER in which the selected image files are shown.

This utility is oriented toward playing movie or audio files which may be scattered throughout various PARENT DIRECTORIES and THEIR SUB-DIRECTORIES --- in a play-back ORDER DETERMINED BY THE USER (that is, determined by the order of directories and files in the playlist file).


Below, I provide the Tk script code for this 'play-media-files-in-a-playlist' utility.

I follow my usual 'canonical' structure for Tk code for this Tk script:

  0) Set general window & widget parms (win-name, win-position,
     win-color-scheme, fonts-for-widgets, widget-geometry-parms,
     text-array-for-labels-etc, win-size-control).

  1a) Define ALL frames (and sub-frames, if any).
  1b) Pack   ALL frames and sub-frames.

  2) Define & pack all widgets in the frames, frame by frame.
              Within each frame, define ALL the widgets.
              Then pack the widgets.

  3) Define keyboard and mouse/touchpad/touch-sensitive-screen action
     BINDINGS, if needed.

  4) Define PROCS, if needed.

  5) Additional GUI initialization (typically with one or more of
     the procs), if needed.

This Tk coding structure is discussed in more detail on the page A Canonical Structure for Tk Code --- and variations.

This structure makes it easy for me to find code sections --- while generating and testing a Tk script, and when looking for code snippets to include in other scripts (code re-use).

I call your attention to step-zero.

One thing that I started doing in 2013 is use of a text-array for text in labels, buttons, and other widgets in the GUI.

This can make it easier for people to internationalize my scripts.

I will be using a text-array like this in most of my scripts in the future.

Experimenting with the GUI

As in all my scripts that use the 'pack' geometry manager (which is all of my 100-plus scripts, so far), I provide the four main 'pack' parameters --- '-side', '-anchor', '-fill', '-expand' --- on all of the 'pack' commands for the frames and widgets.

That helps me when I am initially testing the behavior of a GUI (the various widgets within it) as I resize the main window.

I think that I have used a pretty nice choice of the 'pack' parameters.

The label and button and radiobutton widgets stay fixed in size and relative-location if the window is re-sized --- while the entry widget expands/contracts horizontally whenever the window is re-sized horizontally.

You can experiment with the '-side', '-anchor', '-fill', and '-expand' parameters on the 'pack' commands for the various frames and widgets --- to get the widget behavior that you want.


Additional experimentation with the GUI:

You might want to change the fonts used for the various GUI widgets.

For example, you could change '-weight' from 'bold' to 'normal' --- or '-slant' from 'roman' to 'italic'.

Or change font families.

In fact, you may NEED to change the font families, because the families I used may not be available on your computer --- and the default font that the 'wish' interpreter chooses may not be very pleasing.

I use variables to set geometry parameters of widgets --- parameters such as border-widths and padding.

And I have included the '-relief' parameter on the definitions of frames and widgets.

Feel free to experiment with those 'appearance' parameters as well.

If you find the gray 'palette' of the GUI is not to your liking, you can change the value of the RGB parameter supplied to the 'tk_setPalette' command near the top of the code.


In fact, here are images from a couple of experiments with the variable-width fonts used for text on Tk 'label' and 'button' and 'radiobutton' widgets --- and experimentation with the color 'palette' of the Tk window.

The image above uses the rather staid 'Times New Roman' font --- and a brownish palette (to blend with the brownish desktop background image that came with my Ubuntu 9.10 Gnome 2.28 desktop system).

The image above uses the not-so-staid 'Zachary' font (modeled on the hand-writing of the son of a font-maker) --- and a bluish palette.

Some features in the code

There are plenty of comments in the code to describe what most of the code-sections are doing.

You can look at the top of the PROCS section of the code to see a list of the procs used in this script, along with brief descriptions of how they are called and what they do.

The main procs are :

  'get_playlist_filename'   - called by the 'Browse...' button
                              next to the filename entry field

  'count_media_files'       - called by the 'CountMediaFiles' button.

  'show_media_filenames'    - called by the 'ShowMediaFilenames' button.

  'play_media_files'        - called by the 'LaunchPlayerJob' button.

  'popup_msgVarWithScroll' - called by 'Help' button to show HELPtext var.
                                    Also called via the 'CountMediaFiles' and
                                    and 'ShowMediaFilenames' buttons

Like with the 'batch-find-images-and-view' and 'batch-find-media-and-play' and 'show-images-of-a-playlist' Tk GUI utilities, I used the following statement to allow the GUI to be expanded in the x-direction, but NOT the y-direction.

wm resizable . 1 0


To get the 'Stop' button to work, I used the technique that I used for the 'show-images-of-a-playlist' utility.

I could not use the Tcl 'exec' command to start the 'external' player(s) in a 'foreground' mode, because that would 'lock up' the Tk GUI while a media file was being played by the 'external' player.

Instead, I use the 'exec' command to start the media-player in a 'background' mode.


   catch {eval exec $PLAYERcommand "$MEDIAfilename" &} PlayerPID  

Thus I had a PID (process ID) for the media-player process.

I used a Tcl 'while' loop, including an 'after 500' statement to occasionally check, with the 'ps' list-processes command of the operating system, whether the process was still running --- thanks to a code snippet seen at

    http://stackoverflow.com/questions/ 16012040/ how-do-i-check-for-spawn-id-thats-alive-tcl.

Based on that example, I used the following simple loop

   while {1} {
      after 500
      if {[catch {exec ps $PlayerPID} CatchMsg] != 0} {break} 

This code was used to check if the player-program, which is running 'in the background', is still running.

When the player-program is no longer running (because it reached end-of-file or the user closed the program), the Tcl-Tk file-reading program loop checks whether the 'Stop' button was pressed.

    (The Stop button sets a stop-variable to 1 rather than 0. That variable is what is checked.)

If 'Stop' was pressed, the Tk script breaks out of the file reading loop.

Comments in the script

It is my hope that the copious comments in the code will help Tcl-Tk coding 'newbies' get started in making GUI's like this.

Without the comments, potential young Tcler's might be tempted to return to their iPhones and iPads and iPods --- to watch videos of Russian helicopters flying over a highway into the Crimea (apparently as captured on the smartPhone of a Ukrainian motorist).

The Tcl-Tk CODE

Here is a link to CODE for the script



For this 'media-playlist' utility, a SINGLE Tk script can be put in a sub-directory of the user's home directory, such as


    (I used two auxiliary shell scripts, in addition to a Tk script, to implement the 'batch-find-images-and-view' and 'batch-find-media-and-play' utilities.

    So those two utilities involved the installation of THREE scripts.

    No auxiliary shell script is used in this media-playlist utility, however.)

The user can use their desktop system (such as Gnome or KDE) to set up the Tk script as an icon on the desktop.

Then the user can click on the icon to startup the 'front end'.


Below is an image of the 4 icons that I set up on an Ubuntu 9.10 Gnome 2.28 desktop for the 4 show/play utilities that I have provided at the following pages of this FE web site:


    (the subject of this page).


This Tk script adds another utility to my list of 'done' utilities --- in the 'Front Ends' category.

I plan to work on other 'front ends' --- for commands with many command-line optons --- such as 'mplayer', 'xrandr', 'ffmpeg', 'rsync', and several other commands (or combinations of commands).

But I may return to this 'play-media-files-in-a-playlist' Tk script to provide some enhancements.

Additional options may be added to the GUI, via adding a few widgets, to allow for

  • user specification of the location of the upper-left-corner of the player-window on the 'desktop' --- via a '-geometry' parameter (or some such parameter) available for some media players.

  • allow for 'stepping back' or 'jumping forward' to media files in the playlist

    (There are many ways that this could be implemented --- some using much more computer memory than others.

    We could provide a GUI widget by which the user could specify an integer N to request playing the file N files back --- or forward --- from the current file position in the playlist file.

    Or we could allow the user to select from the list of names in the playlist file, presented in a list.)

See 'UPDATE 2014apr22', near the bottom of this page, for some unforeseen enhancements.


As I promised above, here is an overview of movie and audio file formats.

Note that this 'play-media-files-of-a-playlist' utility will play whatever media file types are supported by the media player that is chosen.

Most of these media players, listed above, support most of the common types of movie files.

However, in some cases, they may fail to play a media file --- especially if a needed 'decoder' library is not available on the user's computer.

In case of failures, it will probably be good to know a little about the 'nature' of movie and audio files.

Basically, a movie file involves THREE different formats:

  • the container format

  • the format for the video stream(s)

  • the format for the audio stream(s).


Movie Container Formats

The Linux/Unix 'file' command, when applied to a movie file, typically reports on the 'container' format of the movie file.

Example output from the 'file' command:

  Typical movie suffix    output from the 'file' command
  --------------------    -----------------------------------------
  mp4                     ISO Media, MPEG v4 system, version 1

  mpg or mpeg             MPEG sequence, v1, system multiplex

  flv                     Macromedia Flash Video

  mov                     ISO Media, Apple QuickTime movie

  wmv                     Microsoft ASF

  avi (with DivX video)   RIFF (little-endian) data, AVI, 640 x 480, 30.00 fps,
                             video: DivX 3 Fast-Motion

  avi (with Xvid video)   RIFF (little-endian) data, AVI, 640 x 480, 30.00 fps,
                             video: XviD

  avi (w. Cinepak video)  RIFF (little-endian) data, AVI, 160 x 120, 10.00 fps,
                             video: Cinepak, audio: uncompressed PCM (mono, 8000 Hz)

        ISO = International Standards Organization
        MPEG = Motion Picture Experts Group
        ASF = Advanced Systems Format
        RIFF = Resource Interchange File Format
        AVI = Audio Video Interleave
        PCM = Pulse Code Modulation

The 'mp4' and 'flv' container formats are commonly used in recent times (2010-2014).

The 'mpg/mpeg', 'wmv', and 'avi' container formats are formats that are getting rather 'long in the tooth'.


Audio-only Formats

'file' returns text strings like the following on AUDIO files:

  suffix   output from the 'file' command
  -------  -----------------------------------------
  mp3      MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, Stereo

  wav      RIFF (little-endian) data, WAVE audio, Microsoft PCM, 8 bit, mono 22050 Hz

         MPEG = Motion Picture Experts Group
         ADTS = Audio Data Transport Stream
         RIFF = Resource Interchange File Format
         PCM = Pulse Code Modulation

These are audio 'encoding' formats --- not 'container' formats.

Note that 'layer III' indicates the popular 'mp3' audio file format.


Tyical Video-and-Audio Formats
in Container Formats

Some of the popular video-and-audio 'encodings' seen in various movie 'container' files --- via applying the 'ffmpeg -i' command to the movie file or using the File Properties option of the Gnome2-Nautilus file manager:

  file suffix        Video-Audio encodings typically found in the container
  ----------------   -------------------------------------------------------------
  mp4                 h264-aac

  flv (a.k.a. Flash)  vp6f-mp3 , flv(Sorensen)-mp3, h264-aac , flv(Sorensen)-adpcm_swf

  mpg or mpeg         mpeg1video-mp2 , mpeg4-mp3

  mov                 mpeg4-aac , cinepak-adpcm_ima_qt , svq3(Sorensen)-mp3, svq3-qdm2 , h263-qcelp

  wmv (a.k.a. asf)    wmv3-wmav2 , wmv2-wmav2 ,  wmv1-wmav2 , msmpeg4-wmav2

  avi                 mpeg4-pcm_s16le , msmpeg4-none , cinepak-pcm_u8

Note that there are a 'mess' of video-audio combinations out there.



THE 'mplayer' PLAYER:

The 'man' page for the 'mplayer' command is more than 8,000 lines long (100-plus pages).

There is an overwhelming number of command-line options for 'mplayer'.

The '-fs' (fullscreen) option is the main one that is implemented in this Tk script utility.

Here are some of the keyboard controls that you can use when the 'mplayer' display window comes up :

  q or ESC         Stop playing and quit.
  f                Toggle fullscreen.
  p or SPACE       Pause (pressing again unpauses).
  <- and ->        Seek backward/forward 10 seconds.
  up and down      Seek forward/backward 1 minute.
  pgup and pgdown  Seek forward/backward 10 minutes.
  .                Step  forward.  Pressing once will pause movie,
                   every consecutive press will play one frame and
                   then go into pause mode again (any other key unpauses).
  [ and ]          Decrease/increase current playback speed by 10%.
  { and }          Halve/double current playback speed.
  backspace        Reset playback speed to normal.
  + and -          Adjust audio delay by +/- 0.1 seconds.
  / and *          Decrease/increase volume.
  9 and 0          Decrease/increase volume.
  ( and )          Adjust audio balance in favor of left/right channel.
  m                Mute sound.
  I                Show filename on the OSD (OnScreen Display).

You can consult the 'man mplayer' info for more information on controlling 'mplayer' as a media file is played.


THE 'ffplay' PLAYER:

Although the 'ffplay' command (which is usually packaged with the 'ffmpeg' command) does not have nearly as many parameter options as the 'mplayer' command, the 'ffplay' command may be handy to try if 'mplayer' fails to play a media file.

'ffplay' does not have any control options in a GUI.

But there a few 'ffplay' keyboard controls:

   q or ESC       Quit.
   f              Toggle full screen.
   p or SPC       Pause.
   left/right     Seek backward/forward 10 seconds.
   down/up        Seek backward/forward 1 minute.
   mouse click    Seek to percentage in file corresponding to fraction of width.
   w              Show audio waves.
   a              Cycle audio channel
   v              Cycle video channel
   t              Cycle subtitle channel

'ffplay' automatically expands each media file image to fit in the 'ffplay' window when it is 'fullscreen'.

This can be convenient, however, for media files with small image size, the scale-up may result in crude-looking images (frames).


THE 'totem' PLAYER:

'totem' has a pretty elaborate GUI for controlling the display of a media file.

In addition, it has a rather plentiful set of keyboard control options, including:

  q                    Quit.
  Esc                  Exit full screen mode.
  f                    Toggle full screen.
  p                    Toggle between play and pause.
  h                    Toggle display of on-screen controls.
  0                    Resize window to 50% original size.
  1                    Resize window to 100% original size.
  2                    Resize window to 200% original size.
  r                    Zoom in the video.
  t                    Zoom out the video.
  Left-arrow           Skip back 15 seconds
  Right-arrow          Skip forward 60 seconds
  Shift+Left-arrow     Skip back 5 seconds
  Shift+Right-arrow    Skip forward 15 seconds
  Ctrl+Left-arrow      Skip back 3 minutes
  Ctrl+Right arrow     Skip forward 10 minutes
  Up-arrow             Increase volume by 8%
  Down-arrow           Decrease volume by 8%

The 'totem' player has a nice 'audio-visualization' feature.

When you play an audio file, a psychelic animation is displayed in the window where movies would be displayed in the 'totem' interface.


THE 'gnome-mplayer' PLAYER:

The 'gnome-mplayer' program seems to have some bugs (that are confirmed by searches on the internet).

The '--fullscreen' parameter does not seem to work --- nor the '--width' and --'height' parameters.

This made it impossible to offer a fullscreen mode (at least for the version of 'gnome-mplayer' on the test computer --- version 0.8.8, 2008, lead developer: Kevin DeKorte).

So instead of offering 'gnome-mplayer' on this GUI, I have offered the 'gmplayer' program (which was delivered with the version of 'mplayer' on my development-and-test computer --- version 4.4.1, 2009).


THE 'gmplayer' PLAYER:

'gmplayer' offers a small subset of the 'mplayer' command line options as comand line options for 'gmplayer'.

The '-fs' (fullscreen) option is the main one that is implemented in this Tk script utility.

The 'gmplayer' program offers a small, minimal GUI --- with buttons to control things like

  • pause/play
  • return-to-start
  • advance/retreat

and two slider bars to

  • set audio volume
  • display current play position ---
    and indicate time range.

As an alternative to (and augmentation of) those GUI controls, 'gmplayer' has the following keyboard control options :

  q or ESC         stop playing and quit program
  p or SPACE       pause movie (press any key to continue)
  <-  or  ->       seek backward/forward 10 seconds
  down or up       seek backward/forward  1 minute
  pgdown or pgup   seek backward/forward 10 minutes
  + or -           adjust audio delay by +/- 0.1 second
  * or /           increase or decrease PCM (audio) volume
  x or z           adjust subtitle delay by +/- 0.1 second
  r or t           adjust subtitle position up/down, also see -vf expand
  o                cycle OSD mode:  none / seekbar / seekbar + timer
                   (OSD = OnScreenDisplay info)


The 'man' page for the 'vlc' command is more than 4,500 lines long (50-plus pages).

There is an overwhelming number of command-line options for 'vlc'.

The 'fullscreen' option is the main one that is implemented in this Tk script utility.

'vlc' has a rather elaborate GUI.

You can determine most of its keyboard shortcuts from the items on the toolbar drop-down menus.


THE 'smplayer' PLAYER:

'smplayer' has a rather simple GUI --- like 'gmplayer'.

You can determine most of its keyboard shortcuts from the items on the toolbar drop-down menus.

The GUI of 'smplayer' has a little different 'look' versus the GUI of 'gmplayer' --- because 'smplayer' was programmed using the Qt library to build the GUI, while the Gtk library was used to build the 'gmplayer' GUI.


As I have said on several other code-donation pages on this wiki ...

There's a lot to like about a utility that is 'free freedom' --- that is, no-cost and open-source so that you can modify/enhance/fix it without having to wait for someone else to do it for you (which may be never).

A BIG THANK YOU to Ousterhout for starting Tcl-Tk, and a BIG THANK YOU to the Tcl-Tk developers and maintainers who have kept the simply MAH-velous 'wish' interpreter going.

UPDATE 2014apr22

In using this utility, I found a few changes were advisable:

  • Check if file exists

    Added a 'file exists' check to proc 'play_media_files' --- to handle cases when there may be non-existent filenames or filenames with syntax errors in the playlist file.

  • Check return code from player

    Added a 'RETcode' (return code) check to proc 'play_media_files' --- to handle cases where the player program cannot handle a specified media file.

  • Allow for 'relative' directory names

    Added the capability to use a dot (.) at the start of any directory name in the playlist file --- to represent the directory in which the playlist file lies.

    This useful when putting the playlist file in a directory of media files and we want to use the dot to represent the directory of the media files.

    The dot allows for moving/copying the media files (with the playlist file) to different directories without having to change the internals of the playlist file.

  • A key binding change

    Changed <KeyPress> to <KeyRelease> in a binding on the playlist filename entry field.

The code above has been replaced with the updated code.

Bottom of this page for
Play Media Files (movies or audio)
named in a Playlist file

--- a utility in the FE 'tkGooies' system,
in the 'VIDEOtools' (and 'AUDIOtools') groups.

To return to a previously visited web page location, click on the Back button of your web browser a sufficient number of times. OR, use the History-list option of your web browser.
OR ...

< Go to Top of Page, above. >

Page history:

The code was created in 2014 --- and posted 2014 Mar 06 at http://wiki.tcl.tk/39481.

This FE web page was created 2014 May 07.
(as a backup and alternative to the wiki.tcl.tk page)

Page was changed 2015 Oct 05.
(Small changes.)

Page was changed 2019 Feb 28.
(Added css and javascript to try to handle text-size for smartphones, esp. in portrait orientation.)

Page was changed 2019 Jun 25.
(Specified image widths in percents to size the images according to width of the browser window.)

The code here MAY BECOME more 'up-to-date' than the code posted on the Tcler's Wiki ---
wiki.tcl-lang.org --- formerly wiki.tcl.tk.