Re: [LAD] [LAA] gst123-0.1.2

2010-07-08 Thread Stefan Westerfeld
   Hi!

On Wed, Jul 07, 2010 at 12:42:38PM -0700, Niels Mayer wrote:
 Thanks for your help and response...
 
 FYI, here's a few bug reports/feature-missing things:
 
 (1) I finally figured out those flashing squares that appear every
 time gst123 changes songs. It's album-art images, displayed in an X
 window! These need to stay up longer, as only by forcing the audio
 device to be busy and playing back a giant directory of files, I was
 able to actually see that these are windows containing images, and not
 some weird new display-glitching bug caused by KDE's Smooth Tasks
 widget. To be useful, the display of the image needs to be held for a
 certain amount of time after you're sure the window-system has
 actually rendered the image. Perhaps a single integer option
 --albumart-time -- when set to 0 image display is suppressed,
 otherwise, an integer like 1000 which would hold the album-art image
 for 1 second.
 
 (And yes, I realize that a fix for this issue is easily had in my
 script play-cd (shorthand for play sound only @ 44.1, vs play-tv
 w/ X/Video @ 48k):
 | #!/bin/sh
 | args=`/bin/ls -d $*`
 | export DISPLAY=''
 | exec gst123 -a alsa=mythcd $args
 )

I didn't explicitely do anything to make the pictures come up. Its just that
gst123 will try to decode everything that is on the play list, audio files,
video files and other files. Normally other files are not a problem, because
gst123 will detect that it can not read the file, and remove it from the
playlist. However, GStreamer will decode images like album art, so they are
flashing up, and once the decoding is done disappear again.

I am not sure yet how to fix this. One could simply blacklist some filename
patterns (like *.jpg, *.png, ...), but then again, a file called this way could
theoretically contain an ogg file. Also the blacklist might not be complete. So
what would be better would be to use the same strategy GStreamer uses to figure
out the right decoding object, and then blacklist some of those.

In any case, I've added this item to the TODO, and of course I'll also accept
patches.

 (2) Sometimes video windows come up at the wrong size (tiny). You can
 resize them with the window manager and resize it back and get the
 correct aspect. Or you can quit and run it again and find it sized
 correctly.

I had hoped that this would no longer be an issue, because of the changes that
I made some time ago. But if it is still happening, it should be fixed. You
also may be able to correct this using the 1 or f keys.

I've added this item to the TODO.

 (3) Is there a way to create a specific, stable, window-name for the
 video window created, perhaps settable as commandline parameter. That
 way for captions, you don't really need to worry about overwriting
 the video with transparent letters like you would on an actual TV
 caption. Instead, wrap your program in an external program such as
 Python, or WINTERP (*) that captures the video window (much like a
 window manager would, or how mplayer windows are displayed insider
 wrappers like smplayer kmplayer etc) and parses the time-data-stream
 information continuously output by gst123. Below the video window you
 stick a text widget and display caption text independently of the
 video. There's really no need to overlay and worry about transparency
 mapping through letters and slowing down the rendering, and all that
 potential, hardware-dependent fail. Stick the text in a GUI toolkit
 where all the region and language issues can be handled
 appropriately... Such tools are happy to update a few times a second
 to display new captions while X is off rendering the video (or
 stepping out of the way) in the most efficient, platform-independent
 manner available.

Right, it might be nice to have a window title parameter which can contain some
special sequences (like %f for the filename being played, or %t and %T for time
and total time), so that the window title can be used to output something
useful.

However, I think that gst123 should be able to display seek position without
any extra programs, because most users will just install gst123 and use it as
it is.

About winterp: looks like a program which could be used to do some interesting
things. However, I would recommend using something else as scripting language,
not scheme. My experience with scheme is that it is so totally unlike most
programming languages, that you need to think a lot more to get anything done
or understand any code, even if you are normally good at programming.

Python might be a better choice, because it doesn't have such a different
structure than C / C++ / Java (which many programmers know already).

   Cu... Stefan
-- 
Stefan Westerfeld, Hamburg/Germany, http://space.twc.de/~stefan
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] [LAA] gst123-0.1.2

2010-07-07 Thread Stefan Westerfeld
   Hi!

On Tue, Jul 06, 2010 at 06:08:23PM -0700, Niels Mayer wrote:
 On Tue, Jul 6, 2010 at 2:43 PM, Niels Mayer nielsma...@gmail.com wrote:
   Question: is there a way to disable checking for pulseaudio for each
  new file when specifying multiple media files. e.g.: gst123 *.ogg ?
  For example: do it once at application startup, or even better, a way
  to prevent it from happening all-together via environment variable,
  configuration, etc. Best would be some kind of environmental check so
  that the timeout on socket needn't occur.The timeout significantly
  slows down operation of the program even when not issuing ^C's.
 
 Answering own question:
 
 The search for audio devices is bypassed by setting  the -a
 commandline parameter to the ALSA device one wants to use. I wrapped
 it in a script to use w/ emacs' dired, etc.:
 
 #!/bin/sh
 args=`/bin/ls -d $*`
 exec gst123 -a alsa=mythcd $args /dev/null 

The next release, gst123-0.1.3 will have a ~/.gst123rc where you can put

audio_output alsa=mythcd

which does the thing you want. The changes are in git already. I've used
scripts to wrap gst123 before (for crawling directories with find), but usually
its better to put the functionality in gst123, because then its available to
all users (not just competent script writers).

   Cu... Stefan
-- 
Stefan Westerfeld, Hamburg/Germany, http://space.twc.de/~stefan
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] [LAA] gst123-0.1.2

2010-07-07 Thread Stefan Westerfeld
   Hi!

On Tue, Jul 06, 2010 at 02:43:11PM -0700, Niels Mayer wrote:
 On Mon, Jul 5, 2010 at 9:11 AM, Stefan Westerfeld ste...@space.twc.de wrote:
  gst123-0.1.2 has been released.
  Website:  http://space.twc.de/~stefan/gst123.php
  Download: http://space.twc.de/~stefan/gst123/gst123-0.1.2.tar.bz2
 
 Stefan -- very nice and useful program. Thanks for making this available!
 
 FYI -- To compile on Fedora, I had to install the following to get
 'configure' to stop complaining:
 
 1) yum install 'gstreamer-devel' (obviously)
 2) yum install gstreamer-plugins-base-devel (less obvious as config complains:
 No package 'gstreamer-interfaces-0.10' found // No package
 'gstreamer-video-0.10' found )
 3) yum install ncurses-devel

gst123 should normally point you to Debian packages if it doesn't find
something, although currently it only does this for ncurses. I am not yet sure
how to make configure.ac print out the right thing to install depending on the
distribution. But I'd accept patches that solve this.

  Question: is there a way to disable checking for pulseaudio for each
 new file when specifying multiple media files. e.g.: gst123 *.ogg ?

If at all, this could be fixed in GStreamer pulseaudio support. Except for the
.gst123rc entry we already discussed.

 (2) For HD Video recorded off digital broadcasts, but not for regular
 def broadcast video, there's a problem when issuing the '-' (forward
 arrow) or '-' (backward  arrow) commands to skip forwards or back: As
 you go forward, there's an increasingly longer delay before the audio
 syncs up and starts playing. Hit '-' a few times and the audio never
 seems to sync up, and sometimes the video stays paused on the same
 frame, even though the time display in the terminal continues
 updating.

This also sounds to me like a GStreamer bug - probably you should repost the
question on a GStreamer mailing list. gst123 is just a very thin wrapper that
uses GStreamer for actual seeking and decoding, so if there is something wrong
with some files, the most likely thing is that the corresponding GStreamer
plugins need to be fixed.

 (3) Note that if the above file is played out of a list 'gst123 *.mpg'
 then at least it gets audio playback. The same file, started
 standalone, shows video, but gives plays no audio:
 .
 gnulem-346-~ gst123 /home/npm/Videos/1551_20100407195900.mpg
 
 Playing file:///home/npm/Videos/1551_20100407195900.mpg
 
 ** (gst123:12323): CRITICAL **: gst_mpeg_descriptor_find: assertion
 `desc != NULL' failed

Looks like a GStreamer issue, too.

 PS: Feature request: decode caption information from videos, and
 display in video. And/or output a timed-text, SMIL or other file
 containing the caption information and time-of-presentation
 information. This can be very useful in searching content of video
 files.

I would accept patches for this one. Currently, I don't know what needs to be
done to display anything on top of the video display.  Could be that it can be
done at Gtk level (we already have a Gtk window where we display things in),
could also be that overlaying text or other information needs to be done with
GStreamer somehow.

Personally, I'd like to have a visual indication of the stream position during
seek (and that is on the TODO), and once gst123 has the capability to draw on
top of the video display, other stuff could be added.

   Cu... Stefan
-- 
Stefan Westerfeld, Hamburg/Germany, http://space.twc.de/~stefan
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] [LAA] gst123-0.1.2

2010-07-07 Thread Niels Mayer
Thanks for your help and response...

FYI, here's a few bug reports/feature-missing things:

(1) I finally figured out those flashing squares that appear every
time gst123 changes songs. It's album-art images, displayed in an X
window! These need to stay up longer, as only by forcing the audio
device to be busy and playing back a giant directory of files, I was
able to actually see that these are windows containing images, and not
some weird new display-glitching bug caused by KDE's Smooth Tasks
widget. To be useful, the display of the image needs to be held for a
certain amount of time after you're sure the window-system has
actually rendered the image. Perhaps a single integer option
--albumart-time -- when set to 0 image display is suppressed,
otherwise, an integer like 1000 which would hold the album-art image
for 1 second.

(And yes, I realize that a fix for this issue is easily had in my
script play-cd (shorthand for play sound only @ 44.1, vs play-tv
w/ X/Video @ 48k):
| #!/bin/sh
| args=`/bin/ls -d $*`
| export DISPLAY=''
| exec gst123 -a alsa=mythcd $args
)

(2) Sometimes video windows come up at the wrong size (tiny). You can
resize them with the window manager and resize it back and get the
correct aspect. Or you can quit and run it again and find it sized
correctly.

(3) Is there a way to create a specific, stable, window-name for the
video window created, perhaps settable as commandline parameter. That
way for captions, you don't really need to worry about overwriting
the video with transparent letters like you would on an actual TV
caption. Instead, wrap your program in an external program such as
Python, or WINTERP (*) that captures the video window (much like a
window manager would, or how mplayer windows are displayed insider
wrappers like smplayer kmplayer etc) and parses the time-data-stream
information continuously output by gst123. Below the video window you
stick a text widget and display caption text independently of the
video. There's really no need to overlay and worry about transparency
mapping through letters and slowing down the rendering, and all that
potential, hardware-dependent fail. Stick the text in a GUI toolkit
where all the region and language issues can be handled
appropriately... Such tools are happy to update a few times a second
to display new captions while X is off rendering the video (or
stepping out of the way) in the most efficient, platform-independent
manner available.

Niels
http://nielsmayer.com

PS: (*) I just got my old dead opensource project
http://nielsmayer.com/winterp/ (
ftp://ftp.x.org/contrib/devel_tools/winterp.lsm  ) 99%fully
running/ported to the latest Linux/Gcc/X courtesy of PlanetCCRMA
having the following packages
openmotif-2.3.2-5.1.svn.fc12.ccrma.x86_64
openmotif-devel-2.3.2-5.1.svn.fc12.ccrma.x86_64 ... one of the nice
things it provides (and I'm happy i'll no longer need to supply my own
version-of) is expect-5.43.0-19.fc12.x86_64  -- a portable way to talk
to existing tty-based programs as if they were running it a terminal.
Except they're not actually running in a terminal, they're being
controlled by a GUI. Probably nothing more than anybody does with
Python, or Java, or Ruby, or Perl, or ... these days ... however, for
line-based, or s-expression-based results (e.g. multiple lisp or
scheme-based systems talking to each other) the asynchronous
subprocess facility WINTERP provides is potentially more elegant for
the application writer comfortable with putting parentheses before the
functor.

Anyways, w/o taking up much of my time, I want to put it up on
sourceforge, salvage the interesting parts, and see what happens -- at
this point as yet another background task/distraction. However
running code speaks, and this is running code. I'm just happy to have
some simple winterp-based utilities back and running again: win-grep (
http://nielsmayer.com/winterp/scrnsnaps/grep-br.gif ) and win-dircmp (
http://nielsmayer.com/winterp/scrnsnaps/dircmp.gif ). And for doing
music/midi stuff, the XmGraph widget can't be beat: it's quite awesome
in interactive mode, as well as its intelligent graph layout:
http://nielsmayer.com/winterp/scrnsnaps/graphcalc.gif
http://nielsmayer.com/winterp/scrnsnaps/grph-whier.gif (
http://nielsmayer.com/winterp/examples/grph-whier.lsp )
http://nielsmayer.com/wwweasel/node24.htm ). ANd lets not forget
WINTERP's path-based-animation facilities to make arbitrary
interactive controllers and displays (beyond what a prebuilt widget'
might provide) that move smoothly with built-in double-buffering:
http://nielsmayer.com/winterp/scrnsnaps/xtango/hanoi.gif
http://nielsmayer.com/winterp/scrnsnaps/xtango/test-dial.gif
http://nielsmayer.com/winterp/scrnsnaps/xtango/test-gauge.gif
http://nielsmayer.com/winterp/scrnsnaps/xtango/test-knob.gif ...

FYI, this is all it takes to talk to an asynchronous subprocess --
such as runningcontrolling gst123 ...
http://nielsmayer.com/winterp/examples/subcalc.lsp (simple UI to run
bc as an 

Re: [LAD] [LAA] gst123-0.1.2

2010-07-06 Thread Niels Mayer
I forwarded my message on compiling gst123 to the fedora and ccrma
lists. Got a question about using it in Emacs dired style... others
may find my response helpful:

orig: http://ccrma-mail.stanford.edu/pipermail/planetccrma/2010-July/017010.html
-
Thanks for reminding me to test this feature. In xemacs (*), it works
nicely allowing playback of any media i've thrown at it Using
dired, find the desired file and use keyboard command '!'
(shell command on files), giving gst123 as the command. The file
will play but will do so in the foreground. To stop it, issue a C-g .
The *Shell-Command-Output-Buffer* will contain the following (while
playing audio track for http://www.youtube.com/watch?v=AI8NuFAETMQ ).

 Playing file:///home/npm/Music/Tonight_You_Belong_To_Me.mp3
 socket(): Address family not supported by protocol

 Title   : Tonight You Belong To Me  Artist  : Steve Martin and Bernadette 
 P
 Album   : The Jerk  Genre   :
 Comment :   Date: 1979
 Codec   : MPEG 1 Audio, Layer 3 (MP3) ( Bitrate : 256.0 kbit/s

 Time: 0:00:00.09 of 0:01:59.45
 ...

You can multiple select files as well and then issue command '!' and
it should play through the list of selected media.

However, since it plays in the foreground and makes emacs
unresponsive, you could also start it in the background through a
script and tell it to be less verbose, set desired audio interface,
etc:
  gst123 [OPTION...] URI... - Play video and audio clips
  -@, --list=filename   read playlist of files and URIs from 
 filename
  --version   print version
  --verbose   print GStreamer pipeline used to 
 play files
  -z, --shuffle   play files in pseudo random order
  -x, --novideo   do not play the video stream
  -a, --audio-output=driver[=dev] set audio output driver and device
  --display=DISPLAY   X display to use

Note that it'll playback web clips from the command-line too. With
ALSA setup per http://nielsmayer.com/dot-asoundrc.txt (nb: device
mythtv sets up my
mobo's SPDIF out at 48k):

 gst123 -a alsa=mythtv http://nielsmayer.com/bm03/freeland-at-solsystem.avi

 Playing http://nielsmayer.com/bm03/freeland-at-solsystem.avi

 Comment : Date: 2003
 Codec   : Uncompressed 8-bit PCM audio (audio) Motion JPE Bitrate : 0.0 kbit/s

Niels
http://nielsmayer.com

(*): xemacs-packages-extra-el-20090217-7.fc12.noarch
xemacs-packages-base-el-20090217-4.fc12.noarch
xemacs-el-21.5.29-11.fc12.x86_64
xemacs-packages-extra-20090217-7.fc12.noarch
flim-xemacs-1.14.8-5.fc12.noarch
xemacs-21.5.29-11.fc12.x86_64
xemacs-packages-extra-info-20090217-7.fc12.noarch
xemacs-info-21.5.29-11.fc12.noarch
xemacs-common-21.5.29-11.fc12.x86_64
xemacs-packages-base-20090217-4.fc12.noarch
w3m-el-xemacs-1.4.371-0.1.20091119cvs.fc12.noarch
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] [LAA] gst123-0.1.2

2010-07-06 Thread Niels Mayer
On Tue, Jul 6, 2010 at 2:43 PM, Niels Mayer nielsma...@gmail.com wrote:
  Question: is there a way to disable checking for pulseaudio for each
 new file when specifying multiple media files. e.g.: gst123 *.ogg ?
 For example: do it once at application startup, or even better, a way
 to prevent it from happening all-together via environment variable,
 configuration, etc. Best would be some kind of environmental check so
 that the timeout on socket needn't occur.The timeout significantly
 slows down operation of the program even when not issuing ^C's.

Answering own question:

The search for audio devices is bypassed by setting  the -a
commandline parameter to the ALSA device one wants to use. I wrapped
it in a script to use w/ emacs' dired, etc.:

#!/bin/sh
args=`/bin/ls -d $*`
exec gst123 -a alsa=mythcd $args /dev/null 

-- Niels
http://nielsmayer.com
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev