Sponsored Content
Top Forums Shell Programming and Scripting Launching mplayer from within Links2 using a shell script Post 303025175 by ignatius on Thursday 25th of October 2018 10:21:36 PM
Old 10-25-2018
Launching mplayer from within Links2 using a shell script

I'm using the Links2 console web browser in graphical mode (the "-g" argument), and launching a shell script
that invokes MPlayer from within it. MPlayer works fine. No problem there. The problem, is that I have no
control over the MPlayer process. I would like to be able to exit MPlayer whenever i'd like, without having to
press Ctrl-C. Which terminates both MPlayer and Links2. It seems whenever I input anything on the keyboard,
it affects Links2, rather than MPlayer. Below is my shell script.

Thank you for your time.

Code:
#!/bin/sh

#save videos here
viddir=/root/video

killall mpg123; killall mplayer; killall movgrab

vidlink=$(sed -e s/https/http/g ${1} | head -1)
vidname=$(echo ${vidlink} | cut -d "=" -f 2)
viddata=`movgrab -st 30 -T ${vidlink} -o - 2>&1`
vidtitle=$(echo ${viddata} | grep "TEST MODE" | cut -d "'" -f 2)

mkfifo /tmp/vidfifo
vidname=/tmp/vidfifo

format=3gp:400x240

available=$(echo ${viddata} | grep -e ${format})

if [ -z "$available" ]; then
    format=3gp:176x144
fi


(movgrab -q -st 30 -b -f $format ${vidlink} -o ${vidname} 2>/dev/null &) &

  mplayer -vo fbdev "${vidname}"

killall movgrab; rm "${vidname}"


Last edited by ignatius; 10-26-2018 at 12:15 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Launching a new bash shell

I'm new to programming on unix and have a really simple question (google hasn't been my friend today). I have a bash shell running on a remote machine. I'm looking at it from a windows PC using Exceed. Is there a command I can use from the shell which will launch another bash shell? Thanks! (3 Replies)
Discussion started by: gsd
3 Replies

2. Shell Programming and Scripting

Launching Several Shells....

Hi, I need to create a shell that launches several shells named for example svspush (that does nothing but wait) and record their pid in a file. Any inputs please. Thanks, Marconi (1 Reply)
Discussion started by: marconi
1 Replies

3. UNIX for Dummies Questions & Answers

launching script via REXEC

Hi folks! my client uses an winapplication which is launching shell-scripts remotely on a HP-Unix Machine via Rexec. The application-configuration is launching the script (which is in the home directory of connecting user) like: rexec host user pass shell.sh So far so good, everything... (3 Replies)
Discussion started by: JohnMurdoch
3 Replies

4. Shell Programming and Scripting

Launching a C program that needs input from a shell script

hi there, i need some help, i am trying to run a script to launch a C program and a Java program but before running both I want to get a user input and then invoke both programs with input received. In the programs the inputs are not command line arguments. This is the code, after the java... (4 Replies)
Discussion started by: momal
4 Replies

5. Shell Programming and Scripting

Launching shell scripts from different dirs

Hi, General question, if I have a shell script whcih I launch from anywhere on the system vis the PATH env var, how can I get the script to echo where I launch this from? i.e. /my/home/script/myscript BUT I launch this from /my/otherarea/somewherelse via the env variable. I would... (1 Reply)
Discussion started by: cyberfrog
1 Replies

6. Shell Programming and Scripting

Launching shell from another

hi, I have shell script ( say A.sh) that launches another shell script ( say B.sh) on the server. In shell script A.sh, if i call B.sh as . B.sh <-- it doesnt work, err file not found . ./B.sh <-- it doesnt work, err file not found ./B.sh <-- works why so? BTW the file exists at the... (4 Replies)
Discussion started by: sjc
4 Replies

7. OS X (Apple)

[Solved] links2 --enable-graphics from source, configure error: no graphics driver found.

Howdy I am trying to install links2 with graphics support on snow leopard 10.6.8 (xcode installed). I have had the program running last year, also installed from source - but then I had installed some image libraries with mac ports and fink - cannot reproduce that setup. Plus I would like to not... (6 Replies)
Discussion started by: butterbaerchen
6 Replies

8. Red Hat

Help in launching firefox.

Hi, -- I am new to linux, please bear with my tech terms. I am using Red Hat 4.1.2-48 (Linux version 2.6.18-194.11.1.el5) for the project. This is a remote server and I do not use any GUI. Now I need to install a product that requires me to launch firefox from linux. when i am trying... (3 Replies)
Discussion started by: vj8436
3 Replies

9. UNIX for Advanced & Expert Users

[Solved] Crontab not launching script

Hi all, i have the following script #!/bin/sh for i in `ps -leaf --cols 1024 | grep LogUser | grep -v grep | awk '{print $4}'`; do echo $i kill -15 $i; done; but it seems that the crontab its sciping this script,i configured corntab as following */30 * * * root... (2 Replies)
Discussion started by: charli1
2 Replies

10. Shell Programming and Scripting

Statement returning error only launching the sh script via crontab

hi all, I created a sh script to import some tables from mysql to hive. No problem launching it manually, but if I schedule via crontab it returns me an error in the following part: #create an array containing all the tables for $dbname query="SELECT table_name FROM information_schema.tables'... (10 Replies)
Discussion started by: mfran2002
10 Replies
MOVIXMAKER-2(1) 					User Contributed Perl Documentation					   MOVIXMAKER-2(1)

NAME
MoviXMaker-2 - Easily create customized eMoviX/MoviX/MoviX2 disc images SYNOPSIS
movixmaker-2[.pl] [--version|--help] [--verbose] [--debug] [--nogui] [--nodelete] [--boot-help-lang=Language] [--menu-lang=Language] [--subtitleFonts=FontSet] [--tv-region=Region] [--remote=RemoteControl] [--keyboard=KbLayout] [--movix=MovixSrcDir] [-o=OutputFile] [-t=TempDir] [-b=BootLabel] [--loop=NbrOfLoops] [--random] [--nodma] [--eject] [--reboot] [--shut] [--extra-genisoimage-options="opt1 opt2 ..."] [--extra-mplayer-options="opt1 opt2 ..."] [--unwanted-mplayer-options="opt1 opt2 ..."] DESCRIPTION
MoviXMaker is a simple Perl command line utility or a GTK+-2/Gnome2/GladeXML interface to create customized eMoviX/MoviX/MoviX2 ISO files. It includes disk image customization possibilities such as : - boot help language, subtitle fontset, boot label selection. - you can specify [e]MoviX[2] parameters such as : movix/mplayer menu language (language), keyboard layout (kb), tv region (region), remote control (remote), loop, random, shutdown (shut), reboot, eject, dma, extra_mplayer_options and unwanted_mplayer_options. OPTIONS
All options that may be abbreviated to uniqueness can use a single dash. --version Displays MoviXMaker-2's version and exits. --help Display help messages [similar to this help] then exits. --verbose Verbose genisoimage output. --debug Debug mode (kind of movixmaker-2 verbose). --nogui Do not display the graphical interface. --nodelete Don't delete temporary directory. --boot-help-lang=Language Specify the language of the CD boot help messages. --menu-lang=Language Specify the MoviX/MPlayer menu language. --tv-region=Region Specify the tv region among: ntsc, ntsc-j, pal, pal-60, pal-nc, pal-m, pal-m60, pal-x, secam. --remote=Remote Specify the remote control among: hauppauge, haupserial, hauppauge2, logitech, pctv, abit, realmagic, grundig_tp720, kingman_code_026. --subtitleFonts=FontSet Specify which font set will be included in iso image. -k KbLayout, --keyboard=KbLayout Specify the keyboard layout to use. -m MovixSrcDir, --movixDir=MovixSrcDir Location of the *MoviX* directory. -o OutputFile, --output-file=OutputFile Name [with full path!] of the output iso image. -t TempDir, --tmpDir=TempDir Directory that will contain the temporary files. -b BootLabel, --boot-label=BootLabel Make *MoviX* boot with your favorite label (new default boot label). --loop=NbrOfLoops Don't delete temporary directory. --random Don't delete temporary directory. --nodma Make *MoviX* run with DMA turned off (fixes old-HDs issues). --eject Make *MoviX* eject the CD once it finished playing. --reboot Make *MoviX* reboot the PC once it finished playing. --shut Make *MoviX* poweroff the PC once it finished playing. --extra-genisoimage-options="opt1 opt2 ..." Extra options for genisoimage. --extra-mplayer-options="opt1 opt2 ..." Extra options for MPlayer. --unwanted-mplayer-options="opt1 opt2 ..." Options you want to be sure MPlayer will not use. AUTHOR
Pascal Giard, <evilynux@yahoo.com> COPYRIGHT
Copyright (C) 2003, 2004 Pascal Giard <evilynux@yahoo.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. SEE ALSO
Gnome2(3), Gtk2(3), Getopt::Long(3), Config::IniFiles(3) perl v5.8.8 2007-09-02 MOVIXMAKER-2(1)
All times are GMT -4. The time now is 06:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy