A little help understanding FIFOs?


 
Thread Tools Search this Thread
Operating Systems Linux A little help understanding FIFOs?
# 1  
Old 11-01-2005
A little help understanding FIFOs?

This isn't strictly a Linux question, but... I've been working on a project to archive some streaming media for time shifting using 'mplayer' and have been using FIFOs to archive in Ogg Vorbis format:


Code:
mkfifo program_name.wav

(mplayer -ao pcm -aofile program_name.wav &)
MPLAYER_PID="`/sbin/pidof mplayer`"

(oggenc program_name.wav &)
OGGENC_PID="`/sbin/pidof oggenc`"

sleep 30m && kill -9 "$MPLAYER_PID" "$OGGENC_PID"
rm program_name.wav

That works OK. But some of the streams I archive are long (3-4 hours) and are difficult to "fast forward" through on my car player. So I'd like to break the recordings up into 5 minute segments WHILE I am encoding the stream. The problem is that when oggenc stops reading from the program_name.wav FIFO, mplayer stops streaming and won't start up again. Any ideas how I would do this without just grabbing the whole show in WAV format and then splitting it after the fact?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need your help in understanding this

Hi, I found this in a script and I would like to know how this works Code is here: # var1=PART1_PART2 # var2=${var1##*_} # echo $var2 PART2 I'm wondering how ##* makes the Shell to understand to pick up the last value from the given. (2 Replies)
Discussion started by: sathyaonnuix
2 Replies

2. Programming

kill() function problem in client-server ipc message using 2 FIFOs

I want to have a message send & receive through 2 uni-direction FIFO Flow of data FIFO1 stdin--->parent(client) writefd--->FIFO1-->child(server) readfd FIFO2 child(server) writefd2---->FIFO2--->parent(client) readfd2--->stdout I need to have boundary structed message... (3 Replies)
Discussion started by: ouou
3 Replies

3. UNIX for Dummies Questions & Answers

understanding {%/*}/

Hi Gurus: I am trying to understand the following line of code.I did enough of googling to understand but no luck.Please help me understand the follow chunk of code: X=$0 MOD=${X%/*}/env.ksh X is the current script from which I am trying to execute. Say if X=test.ksh $MOD is echoing :... (3 Replies)
Discussion started by: vemana
3 Replies

4. Shell Programming and Scripting

need help understanding mv

I just started shell coding and I'm a bit confused on how 'mv' works can someone explain to me how it works and if i did this correctly. Thanks. echo "Enter Name of the first file:" read file1 #echo $file1 if ; then echo "Sorry, file does not exist." exit 1 ... (16 Replies)
Discussion started by: taiL
16 Replies

5. UNIX for Dummies Questions & Answers

Understanding shutdown

Hi there, I start using the function shutdown instead of reboot + poweroff. But there are some points that are not explained in the man pages. 1) What is the usage of the t swith. Both commands will display the message immediatly on every terminal and shutdown at 22:30. Where is the... (6 Replies)
Discussion started by: chebarbudo
6 Replies

6. UNIX for Advanced & Expert Users

UNIX domain sockets vs FIFOs

Is there a performance advantage of one of these over the other? Obviously, it makes no sense to use normal TCP sockets or UDP sockets w/ the overhead they carry. But what about UNIX domain sockets vs FIFOs? I'd think they'd be very similar, in terms of performance and in terms of how they're... (2 Replies)
Discussion started by: mgessner
2 Replies

7. UNIX for Advanced & Expert Users

tar and fifos

How can I make tar read data from a fifo, instead of storing it as a fifo? (8 Replies)
Discussion started by: Corona688
8 Replies

8. Programming

forks, ipc, fifos, update issues...

Hi, so I've got this program("main") that fork executes another ("user"). These programs communicate through fifos. One communication is a spawn call, where user passes an executable, main forks and executes it. So, I'm keeping track of all my processes using a task table. After the fork (for... (6 Replies)
Discussion started by: Funktar
6 Replies

9. Programming

Praying for help: FIFOs, IPC

omg i need help so bad. I've been working on a school project for what seems like an eternity and i'm close to deadline. Using FIFO's (i ahve to) to communicate between parent and child proc's. Right now I'm stuck on a read/write. fifomsg is a struct with int length and char message fields. ... (5 Replies)
Discussion started by: Funktar
5 Replies
Login or Register to Ask a Question
oggz(1) 						      General Commands Manual							   oggz(1)

NAME
oggz -- inspect and manipulate Ogg multimedia files SYNOPSIS
oggzhelp command command args Description oggz is a suite of tools for manipulating Ogg multimedia files. It supports multiplexed files conformant with RFC3533. Oggz can parse headers for CELT, CMML, Dirac, FLAC, Kate, PCM, Speex, Theora and Vorbis, and can read and write Ogg Skeleton logical bitstreams. Commands o helpDisplay help for a specific subcommand (eg. "oggz help chop") Reporting o diffHexdump the packets of two Ogg files and output differences. o dumpHexdump packets of an Ogg file, or revert an Ogg file from such a hexdump. o infoDisplay information about one or more Ogg files and their bitstreams. o scanScan an Ogg file and output characteristic landmarks. o validateValidate the Ogg framing of one or more files. Extraction o ripExtract one or more logical bitstreams from an Ogg file. Editing o chopExtract the part of an Ogg file between given start and/or end times. o commentList or edit comments in an Ogg file. mergeMerge Ogg files together, interleaving pages in order of presentation time.sort- Sort the pages of an Ogg file in order of presentation time. Options oggz accepts the following options: Miscellaneous options -h, --help Display usage information and exit. -v, --version Output version information and exit. AUTHOR
Conrad Parker July 9, 2008; COPYRIGHT
Copyright (C) 2008 Annodex Association SEE ALSO
ogginfo(1) hogg(1) oggz(1)