ashowinfo¶
- doc
https://ffmpeg.org/ffmpeg-filters.html#ashowinfo, https://ffmpeg.org/ffmpeg-filters.html#amovie, https://ffmpeg.org/ffprobe.html, https://ffmpeg.org/ffprobe-all.html
- see also
Using `ashowinfo’ from `ffprobe’¶
You can not use it with “drawtext” directly because this filter seems not to expose the metadata. Thus although this filter can be used from ffmpeg and ffplay as well as other filters, but if you just want to get information, doing so is not worth much. For this reason, it is usually better to use this filter from ffprobe.
The command line interface of ffprobe in terms of usage for the filter is quite different from that of ffmpeg, so you will be confused if you are not used to it. You have to use it with format option and “amovie” filter like this:
[me@host: Videos]$ ffprobe -f lavfi amovie=input.mp4,ashowinfo
...
There is no explanation for the reason, but it seems to be affected by the -show_frames option when used from ffprobe, if you don’t use this option, it seems that the filter graph will abort the input prematurely. (The information that -show_frames gives you is very similar to that of ashowinfo, but they are different.) So, it is usually better to add -show_frames. However, in this case, ashowinfo information and -show_frames information are mixed, so it will be hard to use. Fortunately, one goes to standard output and the other to standard error, so you can:
#! /bin/sh
ifn="${1}"
#
exec 1> ${ifn}.show_frames.txt # stdout
exec 2> ${ifn}.ashowinfo.txt # stderr
ffprobe -hide_banner -f lavfi "amovie=${ifn},ashowinfo" -show_frames
[FRAME]
media_type=audio
stream_index=0
key_frame=1
pkt_pts=0
pkt_pts_time=0.000000
pkt_dts=0
pkt_dts_time=0.000000
best_effort_timestamp=0
best_effort_timestamp_time=0.000000
pkt_duration=1024
pkt_duration_time=0.023220
pkt_pos=56761
pkt_size=8192
sample_fmt=flt
nb_samples=1024
channels=2
channel_layout=stereo
[/FRAME]
[FRAME]
media_type=audio
stream_index=0
key_frame=1
pkt_pts=1024
pkt_pts_time=0.023220
pkt_dts=1024
pkt_dts_time=0.023220
best_effort_timestamp=1024
best_effort_timestamp_time=0.023220
pkt_duration=1024
pkt_duration_time=0.023220
pkt_pos=57058
pkt_size=8192
sample_fmt=flt
nb_samples=1024
channels=2
channel_layout=stereo
[/FRAME]
... (snip) ...
[FRAME]
media_type=audio
stream_index=0
key_frame=1
pkt_pts=1321984
pkt_pts_time=29.976961
pkt_dts=1321984
pkt_dts_time=29.976961
best_effort_timestamp=1321984
best_effort_timestamp_time=29.976961
pkt_duration=1024
pkt_duration_time=0.023220
pkt_pos=6647543
pkt_size=8192
sample_fmt=flt
nb_samples=1024
channels=2
channel_layout=stereo
[/FRAME]
[Parsed_ashowinfo_1 @ 00000000005b1d40] n:0 pts:0 pts_time:0 pos:56761 fmt:fltp channels:2 chlayout:stereo rate:44100 nb_samples:1024 checksum:251179F9 plane_checksums: [ BD76C1E4 71BBB806 ]
Input #0, lavfi, from 'amovie=myinput.mp4.mp4,ashowinfo':
Duration: N/A, start: 0.000000, bitrate: 2822 kb/s
Stream #0:0: Audio: pcm_f32le, 44100 Hz, stereo, flt, 2822 kb/s
[Parsed_ashowinfo_1 @ 00000000005b1d40] n:1 pts:1024 pts_time:0.02322 pos:57058 fmt:fltp channels:2 chlayout:stereo rate:44100 nb_samples:1024 checksum:3009E276 plane_checksums: [ 6244EBE6 9085F681 ]
[Parsed_ashowinfo_1 @ 00000000005b1d40] n:2 pts:2048 pts_time:0.0464399 pos:57383 fmt:fltp channels:2 chlayout:stereo rate:44100 nb_samples:1024 checksum:3F34A65F plane_checksums: [ 26149F4D B3B60712 ]
[Parsed_ashowinfo_1 @ 00000000005b1d40] n:3 pts:3072 pts_time:0.0696599 pos:62034 fmt:fltp channels:2 chlayout:stereo rate:44100 nb_samples:1024 checksum:962966E3 plane_checksums: [ 29CAB4E5 72BEB1EF ]
[Parsed_ashowinfo_1 @ 00000000005b1d40] n:4 pts:4096 pts_time:0.0928798 pos:62312 fmt:fltp channels:2 chlayout:stereo rate:44100 nb_samples:1024 checksum:FF08D07F plane_checksums: [ CA1F03A8 B174CCD7 ]
[Parsed_ashowinfo_1 @ 00000000005b1d40] n:5 pts:5120 pts_time:0.1161 pos:81500 fmt:fltp channels:2 chlayout:stereo rate:44100 nb_samples:1024 checksum:EF58A867 plane_checksums: [ A442EF8A CA70B8CE ]
... (snip) ...
[Parsed_ashowinfo_1 @ 00000000005b1d40] n:1290 pts:1320960 pts_time:29.9537 pos:6647169 fmt:fltp channels:2 chlayout:stereo rate:44100 nb_samples:1024 checksum:AD7944A5 plane_checksums: [ D39CB334 F1C29162 ]
[Parsed_ashowinfo_1 @ 00000000005b1d40] n:1291 pts:1321984 pts_time:29.977 pos:6647543 fmt:fltp channels:2 chlayout:stereo rate:44100 nb_samples:1024 checksum:A3F66215 plane_checksums: [ 5F08A805 575FBA01 ]