If you've redirected things you should be getting the STDERR output as well.
$ perl -E '$foo = qx{zsh -c "print I GO TO OUT; print I GO TO ERR 1>&2
+" 2>&1}; say qq{foo: |$foo|}'
foo: |I GO TO OUT
I GO TO ERR
|
My suspicion is that the output may be explicitly going to the tty instead of STDERR so redirection this way isn't going to affect it.
Update: Well nope, that's not it. Seems to capture things fine for me (OS X, perl 5.18.2, homebrew'd ffmpeg 4.2.1).
$ perl -E '$foo = qx{ffmpeg -f s16le -i /dev/null 2>&1}; say qq{foo: |
+$foo|}'
foo: |ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg develope
+rs
built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
configuration: --prefix=/Users/fletch/lib/homebrew/Cellar/ffmpeg/4.2
+.1_2 --enable-shared --enable-pthreads --enable-version3 --enable-avr
+esample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines
+/jdk1.8.0_221.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMa
+chines/jdk1.8.0_221.jdk/Contents/Home/include/darwin' --host-ldflags=
+ --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enabl
+e-libbluray --enable-libmp3lame --enable-libopus --enable-librubberba
+nd --enable-libsnappy --enable-libtesseract --enable-libtheora --enab
+le-libvidstab --enable-libvorbis --enable-libvpx --enable-libx264 --e
+nable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig -
+-enable-libfreetype --enable-frei0r --enable-libass --enable-libopenc
+ore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-li
+brtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disa
+ble-libjack --disable-indev=jack
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, s16le, from '/dev/null':
Duration: N/A, bitrate: 705 kb/s
Stream #0:0: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
At least one output file must be specified
|
The cake is a lie.
The cake is a lie.
The cake is a lie.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|