[FFmpeg-user] Reidrecting showinfo output

Andy Sheen sheen.andy at googlemail.com
Fri Dec 2 13:11:29 CET 2011


Tim Nicholson wrote on Fri 02 Dec at 11:58 UK time
> On 02/12/11 09:17, Andy Sheen wrote:
>>
>> Tim Nicholson wrote on Fri 02 Dec at 8:40 UK time
>>> I find the showinfo output useful for various diagnostic tasks, but
>>> would find it more so if I could redirect its output to file.
>>>
>>> I have tried the following:-
>>>
>>> ffmpeg -i infile -vf showinfo -f mp4 -an -c:v copy -y /dev/null 2> 
>>> info.txt
>>>
>>> with variations on 1>, 2>  &>  | tee etc
>>>
>>> However I either get nothing or just the usual ffmpeg header info, and
>>> when nothing goes to file I get no console output either.
>>>
>>> Is there a way of achieving this?
>>
>> The generic way of redirecting everything is:
>>
>> ffmpeg command>  info.txt 2>&1
>>
>> i.e. redirect stdout and then map stderr to stdout with the 2>&1
> 
> As I said I tried the standard variations, which included merging stderr
> and stdout. However by default ffmpeg console messages are on stderr
> (stdout can be used for piping its output to something else). The
> showinfo lines however are not.
> 

You sure? I'm on cygwin here running bash and (note the position of the
remap - it's at the end of the command line):

 ffmpeg -i file.mpg -vf showinfo -an -y test.mp4 > test.txt 2>&1

produces no output on the console but produces a file with the following
in for me (apologies for the formatting):

ffmpeg version N-32611-gd55b06b, Copyright (c) 2000-2011 the FFmpeg
developers
  built on Sep 15 2011 00:26:45 with gcc 4.6.1
  configuration: --enable-gpl --enable-version3
--enable-runtime-cpudetect --enable-avisynth --enable-bzlib
--enable-frei0r --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libfreetype --enable-libgsm --enable-libmp3lame
--enable-libopenjpeg --enable-librtmp --enable-libschroedinger
--enable-libspeex --enable-libtheora --enable-libvo-aacenc
--enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
--enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil    51. 16. 0 / 51. 16. 0
  libavcodec   53. 14. 0 / 53. 14. 0
  libavformat  53. 12. 0 / 53. 12. 0
  libavdevice  53.  3. 0 / 53.  3. 0
  libavfilter   2. 40. 0 /  2. 40. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  51.  2. 0 / 51.  2. 0
[mpegts @ 0000000001EADA40] parser not found for codec dvb_teletext,
packets or times may be invalid.
[mpegts @ 0000000001EADA40] Continuity check failed for pid 259 expected
0 got 5
[mpegts @ 0000000001EADA40] Continuity check failed for pid 0 expected 6
got 12
[NULL @ 0000000001D9CD50] start time is not set in estimate_timings_from_pts
[NULL @ 0000000001D9EC50] start time is not set in estimate_timings_from_pts
[NULL @ 0000000001DA0B50] start time is not set in estimate_timings_from_pts
[NULL @ 0000000001DA2AE0] start time is not set in estimate_timings_from_pts
[NULL @ 0000000001DA4A40] start time is not set in estimate_timings_from_pts
[mpegts @ 0000000001EADA40] PES packet size mismatch

Seems stream 0 codec frame rate differs from container frame rate: 50.00
(50/1) -> 50.00 (50/1)
    Last message repeated 1 times
Input #0, mpegts, from 'file.mpg':
  Duration: 01:22:55.90, start: 990.458700, bitrate: 10085 kb/s
  Program 1
    Stream #0.0[0x901]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0.1[0x903](NAR): Audio: mp2 ([4][0][0][0] / 0x0004), 48000
Hz, stereo, s16, 192 kb/s
    Stream #0.2[0x905](eng): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Stream #0.3[0x904](eng): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Stream #0.4[0x902](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz,
stereo, s16, 384 kb/s
    Stream #0.5[0xf00]: Data: none ([5][0][0][0] / 0x0005)
    Stream #0.6[0xf01]: Data: none ([5][0][0][0] / 0x0005)
    Stream #0.7[0xf02]: Data: none ([5][0][0][0] / 0x0005)
    Stream #0.8[0xf03]: Data: none ([5][0][0][0] / 0x0005)
    Stream #0.9[0xf04]: Data: none ([5][0][0][0] / 0x0005)
[buffer @ 000000000457E010] w:1920 h:1080 pixfmt:yuv420p tb:1/1000000
sar:1/1 sws_param:
[libx264 @ 000000000457F2D0] using SAR=1/1
[libx264 @ 000000000457F2D0] using cpu capabilities: MMX2 SSE2Fast SSSE3
FastShuffle SSE4.2 AVX
[libx264 @ 000000000457F2D0] profile High, level 4.2
[libx264 @ 000000000457F2D0] 264 - core 116 r2074 2641b9e - H.264/MPEG-4
AVC codec - Copyleft 2003-2011 - http://www.videolan.org/x264.html -
options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7
psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1
8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2
threads=12 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0
constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1
weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40
intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60
qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'test.mp4':
  Metadata:
    encoder         : Lavf53.12.0
    Stream #0.0: Video: h264 (![0][0][0] / 0x0021), yuv420p, 1920x1080
[SAR 1:1 DAR 16:9], q=-1--1, 50 tbn, 50 tbc
Stream mapping:
  Stream #0.0 -> #0.0 (h264 -> libx264)
Press [q] to stop, [?] for help
[mpegts @ 0000000001EADA40] Continuity check failed for pid 259 expected
0 got 5
[mpegts @ 0000000001EADA40] Continuity check failed for pid 0 expected 6
got 12
[showinfo @ 0000000001D9A950] n:0 pts:920000 pts_time:0.920000
pos:181044 fmt:yuv420p sar:1/1 s:1920x1080 i:T iskey:0 type:B
checksum:1401398452 plane_checksum:[1784547188 148051680 1416857184 0]
[showinfo @ 0000000001D9A950] n:1 pts:1020000 pts_time:1.020000
pos:259064 fmt:yuv420p sar:1/1 s:1920x1080 i:T iskey:0 type:B
checksum:638612400 plane_checksum:[3555442697 616193934 867390474 0]
[showinfo @ 0000000001D9A950] n:2 pts:1080000 pts_time:1.080000 pos:564
fmt:yuv420p sar:1/1 s:1920x1080 i:T iskey:1 type:P checksum:3938678204
plane_checksum:[3600318693 4073616619 2923069405 0]
[showinfo @ 0000000001D9A950] n:3 pts:1120000 pts_time:1.120000
pos:395740 fmt:yuv420p sar:1/1 s:1920x1080 i:T iskey:0 type:B
checksum:2508485145 plane_checksum:[2434826267 2276154181 1926993578 0]
[showinfo @ 0000000001D9A950] n:4 pts:1160000 pts_time:1.160000
pos:356824 fmt:yuv420p sar:1/1 s:1920x1080 i:T iskey:0 type:B
checksum:7177144 plane_checksum:[652436029 1970617229 1406461407 0]
[showinfo @ 0000000001D9A950] n:5 pts:1200000 pts_time:1.200000
pos:423564 fmt:yuv420p sar:1/1 s:1920x1080 i:T iskey:0 type:B
checksum:1305532304 plane_checksum:[1723358296 1488940982 1340214146 0]
[showinfo @ 0000000001D9A950] n:6 pts:1240000 pts_time:1.240000
pos:287264 fmt:yuv420p sar:1/1 s:1920x1080 i:T iskey:1 type:P
checksum:1370301943 plane_checksum:[626270187 2582875203 858225082 0]
[showinfo @ 0000000001D9A950] n:7 pts:12


More information about the ffmpeg-user mailing list