Page 1 of 1

2> redirect won`t work in file or in rxvt run in file.

Posted: Wed 15 Dec 2010, 07:38
by sunburnt
I get no output from either line, but line #1 works in a live rxvt on the desktop.

Code: Select all

#!/bin/sh
######### Get ffmpeg installed codecs.
ffmpeg 2> /tmp/ffmpeg.tmp1
rxvt -e ffmpeg 2> /tmp/ffmpeg.tmp2
The rxvt line flashes rxvt, but I see no code executed and no output.

I`ve needed this for improving Puppy`s ripper app. also... ( Zigbert`s )
Plus for many CLI apps. it could give an accurate "percent done" output for a progress bar.

Posted: Wed 15 Dec 2010, 08:30
by jpeps
I've had instances where '&>' worked where '2>' didn't.

Posted: Wed 15 Dec 2010, 15:56
by sunburnt
Thanks jpeps but no go... :?
I`ve run up against this little hassle a few times now with no solution.

Posted: Wed 15 Dec 2010, 16:07
by amigo
I think this will do what you want:
rxvt -e "ffmpeg 2> /tmp/ffmpeg.tmp2"
Your original would be re-directing the stderr of *rxvt* to the file, not that of ffmpeg.

Posted: Wed 15 Dec 2010, 16:24
by sunburnt
Sorry amigo, I thought you had it, and I know you`re right about the redirect.
But no go also... It doesn`t even work in a live rxvt running on the desktop.
This is the only thing so far that works running in a live rxvt:

Code: Select all

ffmpeg 2> /tmp/ffmpeg.tmp1
I need to generate the file in code of course.

I guess I may have to make a dialog to enter ffmpeg`s codecs manually... :x

Posted: Wed 15 Dec 2010, 19:43
by Pizzasgood
On my non-Puppy system, I can catch the output via script without issues, so Puppy's ffmpeg must work differently than mine.

Anyway, I'm guessing that your ffmpeg is detecting that it isn't being run interactively, and therefor it changes its output behavior. I'm pretty sure you can trick a program into thinking it is being used interactively, but I don't remember how.

Posted: Thu 16 Dec 2010, 00:12
by sunburnt
pizzasgood; I thought about this ffmpeg not being compiled properly.
It`s a upgrade .pet for dpup, works well except for this little hiccup.
Come to think of it... It didn`t want to do Xvid 2-pass, but x264 2-pass works.

Puppy`s ffmpeg doesn`t have the newer codecs I think.
I seem to remember it didn`t work properly somehow, and so dpup`s upgrade...

### Is it possible to get a working compiled ffmpeg to try?

Posted: Thu 16 Dec 2010, 15:16
by zigbert
I do this in Pmusic. - Had the same problem and solved it by

Code: Select all

echo 'exec ffmpeg 2> /tmp/ffmpeg.tmp1' > /file
chmod 722 /file
/file

Posted: Thu 16 Dec 2010, 23:31
by technosaurus
ffmpeg is painful to work with using stdin/stderr: things that you think should go to stderr go to stdout and vice versa.

you tell ffmpeg to do something, it does it ... but tells you about it in stderr? how does that make any sense

I think I ended up dumping them together using:
ffmpeg ...parameters... 2>&1 >file

Posted: Sat 18 Dec 2010, 03:42
by sunburnt
Thanks for all the help guys...
None of the code worked, I think it must be the ffmpeg I have.

Puppy`s ffmpeg doesn`t work right for some reason.
The dpup .pet package works ok for x264, but it has this odd behavior.

Is there another compile of ffmpeg that I could try?
I hate to download Ubuntu just to get ffmpeg out of it.
Or maybe one from the Debian repository will work properly.

Posted: Sat 18 Dec 2010, 11:54
by trapster
I've been using this one for my cli video converting.

Code: Select all

# ffmpeg   
FFmpeg version 0.6, Copyright (c) 2000-2010 the FFmpeg developers
  built on Jul 15 2010 17:29:31 with gcc 4.2.2
  configuration: --prefix=/usr --cpu=i686 --enable-libmp3lame --enable-libx264 --enable-libfaac --enable-libfaad --enable-pthreads --enable-small --enable-postproc --enable-libvorbis --enable-gpl --enable-shared --enable-nonfree --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-debug --enable-bzlib --enable-zlib --enable-libspeex --enable-version3 --enable-runtime-cpudetect --enable-x11grab --enable-libtheora --enable-libxvid --enable-swscale --enable-mmx --enable-libvpx
  libavutil     50.15. 1 / 50.15. 1
  libavcodec    52.73. 2 / 52.73. 2
  libavformat   52.64. 2 / 52.64. 2
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0.11. 0 /  0.11. 0
  libpostproc   51. 2. 0 / 51. 2. 0
Hyper fast Audio and Video encoder
I'd have to dig to figure out where I got it from.

Posted: Sat 18 Dec 2010, 16:36
by sunburnt
trapster; I`d appreciate it if you could gzip your ffmpeg and post it here for me?
Your`s is almost a year newer compile, and hopefully it was done properly.

I`m hoping that it`s ffmpeg that`s my problem and not something else.
Mine just won`t pipe it`s output to a file from a script, and won`t do Xvid 2 pass.

Posted: Sat 18 Dec 2010, 21:55
by trapster
Here is the ffmpeg.tar.gz

I believe it was from THIS pet

Posted: Sat 18 Dec 2010, 22:52
by sunburnt
Thanks loads trapster, I`ll let you know how my luck does with it...
8)

Posted: Sat 18 Dec 2010, 23:17
by sunburnt
Wow !!! One thing I noticed right away is your`s is only 75k in size!
The one I have made for dpup is almost 2m in size!
I`m guessing I can`t just use ffmpeg exec., I will have to install the whole .pet.

Posted: Sun 19 Dec 2010, 00:09
by technosaurus
you _shouldn't_ see anything on the command line if you are redirecting stderr to a file because ffmpeg sporadically uses write(2,...) to output a lot to stderr, vice the traditional stdin which is write(1,...)

I don't know their reasoning for this - just that it makes it a PITA to parse the output.

piping through cat seems to work though

ffmpeg [parameters] 2>/dev/stdin |cat > [file]
or the equivalent
ffmpeg [parameters] 2>&1 |cat > [file]

if you want also to _see_ the output use tee instead of cat

Posted: Sun 19 Dec 2010, 02:41
by sunburnt
Success!! Thanks technosaurus!

The problem... I had the code for this in a function, I put it in the main code...
Now I`m thinking some of the other suggestions will work also...

Posted: Sun 19 Dec 2010, 03:00
by jpeps
technosaurus wrote: ffmpeg [parameters] 2>&1 |cat > [file]

if you want also to _see_ the output use tee instead of cat
without the redirection symbol 'tee file'

Posted: Sun 19 Dec 2010, 06:27
by sunburnt
Speech codecs: amr, vpx, speex, and z and bz filtered out of the GUI list.
And the video and audio codecs are separated into two lists.

I don`t see a codec for Mpeg 2, is it still illegal to have it without paying?
And I don`t see the Flash codec, it`s popular (web) but it`s loosing favor I hear.
How about codecs for Ipod, PSP, and other portable video devices?
Are there any other codecs I should be looking for? wma, wmv, mp4, mov, etc.?

Thanks guys... Now I need to write code to make the GUI`s varying radio boxes.

Posted: Thu 23 Dec 2010, 23:41
by big_bass
Quite a few people posted here with good info
but I took this as a puzzle only (I like puzzles) and was bored :D
since this thread was solved but that -e command still bugged me

its easy without the -e
that changes how the command line is read
giving you a named window


I got this one to work

Code: Select all

 xterm -hold -e  "ffmpeg  | cat >/tmp/4"


I saw that amigo said to use the " " around the command and
piping to cat from technosaurus

but with rxvt it wouldnt work ?
Joe