1 Feb 04:37
Re: [LAD] Mplayer (ffmpeg) decode to stdout
Tnx Robin
ffmpeg also works excellent as decoer.
With ffmpeg -i /some/file -f u16le -ar 44100 | myprog ...
i gotta horrable sound. Probably U mean -f s16le !
So, i have rewrited my olde 2-fork mpg123 mixer as 1-fork ffmpeg "frontend"
http://martini.pudele.com/radio/programming/audio/ffmpegdec02.c
fundamentally without any changes, except
#define PLAYER_BIN "/usr/bin/ffmpeg"
execlp(PLAYER_BIN,PLAYER_BIN, "-i", mxk.trknamep, "-f", "s16le", "-ar","44100", "-v","0" ,"-", NULL);
Any loud output messages i drain out simple with close(2); after fork();
So far everything is OK, if i decode whole files.
It seems that ffmpeg during da decoding set terminal in canonical mode.
If i decode only part of file, and kill() em <at> middle of decoding,
ffmpeg does not restore normal terminal mode , and i do not see commands which i type.
Then helps (blind typed) command "reset".
I tried send several signals with kill() SIGKILL 2 SIGTSTP SIGQUIT SIGINT 15 ...,
but none of em has handler for terminal restore.
I fixed this behavior with
#include <termios.h>
struct termios tsave; /* ! ! ! F-king ffmpeg ! ! ! */
/* sets canonical input mode */
/*----*/void save_terminal(void)
/*----*/{ struct termios tbuf;
/*----*/ tcgetattr(0,&tbuf);
/*----*/ tsave=tbuf;
/*----*/}
/* restore the settings */
/*----*/void restore_terminal(void)
/*----*/{ tcsetattr(0,TCSANOW,&tsave); }
I have tried close(0); where 0=stdin , after fork(); but program has frozen.
How do i decouple childs stdin from terminal or redirect em from /dev/null ?
Tnx in advance <at> all
That's probably why mplayer devs recommend using mkfifo (named pipe)
instead of stdout.. 'mencoder' can do it.
If you need to support a variety of unknown formats and codecs: ffmpeg
is an alternative and gstreamer might be one.
ffmpeg -i /some/file -f u16le -acodec pcm_s16le -ar 44100 - \
| jack-stdin system:playback_1 system:playback_2
on that note, `jack-stdout` can capture and pipe raw PCM data from any
JACK-application including `mplayer -ao jack /some/file`. YMMV.
HTH,
robin
----
_______________________________________________ Linux-audio-dev mailing list Linux-audio-dev@... http://lists.linuxaudio.org/listinfo/linux-audio-dev
> When you use the makefile in the example directory, and have installed
> faust into usr/ instead into usr/local, you must edit the makefile and
> add
> LIB := /usr/lib
>
> at the end of the LIB definitions, here I put it into line 8.
>
> greets
> hermann
>
> >
> > where simple.cpp was generated by:
> > $ faust -a jack-qt.cpp simple.dsp -o simple.cpp
> >
> > what am I missing? I also tried without the -L option or with -lFUI,
> > same error. FUI.h is indeed in /usr/lib/faust/gui/
> >
> > best regards,
> > renato
> > _______________________________________________
> > Linux-audio-dev mailing list
> >
RSS Feed