通过使用show_entries可以指定对应信息的某个指定字段:
例如frame的pkt->pts pkt->dts pkt->duration等信息:
[AppleScript] 纯文本查看 复制代码 ffprobe -select_streams v -of xml -show_entries frame=pkt_pts,pkt_dts,pkt_size,pkt_duration,pict_type ~/Movies/objectC/facebook.mp4 > a.xml
输出内容如下[AppleScript] 纯文本查看 复制代码 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/liuqi/Movies/objectC/facebook.mp4':
Metadata:
major_brand : mp42
minor_version : bbs.chinaffmpeg.com 孙悟空
compatible_brands: isommp42
creation_time : 2016-08-13T00:36:19.000000Z
Duration: 00:03:18.79, start: 0.000000, bitrate: 1849 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 1719 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
Metadata:
creation_time : 2016-08-13T00:36:19.000000Z
handler_name : ISO Media file produced by Google Inc.
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
creation_time : 2016-08-13T00:36:19.000000Z
handler_name : ISO Media file produced by Google Inc.
<?xml version="1.0" encoding="UTF-8"?>
<ffprobe>
<frames>
<frame pkt_pts="0" pkt_dts="0" pkt_duration="3003" pkt_size="208" pict_type="I"/>
<frame pkt_pts="3003" pkt_dts="3003" pkt_duration="3003" pkt_size="37" pict_type="P"/>
<frame pkt_pts="6006" pkt_dts="6006" pkt_duration="3003" pkt_size="40" pict_type="P"/>
<frame pkt_pts="9009" pkt_dts="9009" pkt_duration="3003" pkt_size="41" pict_type="P"/>
<frame pkt_pts="12012" pkt_dts="12012" pkt_duration="3003" pkt_size="41" pict_type="P"/>
<frame pkt_pts="15015" pkt_dts="15015" pkt_duration="3003" pkt_size="41" pict_type="P"/>
<frame pkt_pts="18018" pkt_dts="18018" pkt_duration="3003" pkt_size="41" pict_type="P"/>
<frame pkt_pts="21021" pkt_dts="21021" pkt_duration="3003" pkt_size="41" pict_type="P"/>
<frame pkt_pts="24024" pkt_dts="24024" pkt_duration="3003" pkt_size="41" pict_type="P"/>
<frame pkt_pts="27027" pkt_dts="27027" pkt_duration="3003" pkt_size="41" pict_type="P"/>
<frame pkt_pts="30030" pkt_dts="30030" pkt_duration="3003" pkt_size="41" pict_type="P"/>
<frame pkt_pts="33033" pkt_dts="33033" pkt_duration="3003" pkt_size="41" pict_type="P"/>
<frame pkt_pts="36036" pkt_dts="36036" pkt_duration="3003" pkt_size="41" pict_type="P"/>
<frame pkt_pts="39039" pkt_dts="39039" pkt_duration="3003" pkt_size="41" pict_type="P"/>
<frame pkt_pts="42042" pkt_dts="42042" pkt_duration="3003" pkt_size="41" pict_type="P"/>
<frame pkt_pts="45045" pkt_dts="45045" pkt_duration="3003" pkt_size="104144" pict_type="I"/>
<frame pkt_pts="48048" pkt_dts="48048" pkt_duration="3003" pkt_size="532" pict_type="B"/>
liuqideMacBook-Pro:ffmpeg liuqi$
比直接[AppleScript] 纯文本查看 复制代码 ffprobe -show_frames -select_streams v ~/Movies/objectC/facebook.mp4 少输出很多信息,看上去可以定制化
[AppleScript] 纯文本查看 复制代码 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/liuqi/Movies/objectC/facebook.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2016-08-13T00:36:19.000000Z
Duration: 00:03:18.79, start: 0.000000, bitrate: 1849 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 1719 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
Metadata:
creation_time : 2016-08-13T00:36:19.000000Z
handler_name : ISO Media file produced by Google Inc.
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
creation_time : 2016-08-13T00:36:19.000000Z
handler_name : ISO Media file produced by Google Inc.
<?xml version="1.0" encoding="UTF-8"?>
<ffprobe>
<frames>
<frame media_type="video" 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="3003" pkt_duration_time="0.033367" pkt_pos="99053" pkt_size="208" width="1280" height="720" pix_fmt="yuv420p" sample_aspect_ratio="1:1" pict_type="I" coded_picture_number="0" display_picture_number="0" interlaced_frame="0" top_field_first="0" repeat_pict="0" color_range="tv" color_space="bt709" color_primaries="bt709" color_transfer="bt709" chroma_location="left"/>
<frame media_type="video" stream_index="0" key_frame="0" pkt_pts="3003" pkt_pts_time="0.033367" pkt_dts="3003" pkt_dts_time="0.033367" best_effort_timestamp="3003" best_effort_timestamp_time="0.033367" pkt_duration="3003" pkt_duration_time="0.033367" pkt_pos="99261" pkt_size="37" width="1280" height="720" pix_fmt="yuv420p" sample_aspect_ratio="1:1" pict_type="P" coded_picture_number="1" display_picture_number="0" interlaced_frame="0" top_field_first="0" repeat_pict="0" color_range="tv" color_space="bt709" color_primaries="bt709" color_transfer="bt709" chroma_location="left"/>
<frame media_type="video" stream_index="0" key_frame="0" pkt_pts="6006" pkt_pts_time="0.066733" pkt_dts="6006" pkt_dts_time="0.066733" best_effort_timestamp="6006" best_effort_timestamp_time="0.066733" pkt_duration="3003" pkt_duration_time="0.033367" pkt_pos="99298" pkt_size="40" width="1280" height="720" pix_fmt="yuv420p" sample_aspect_ratio="1:1" pict_type="P" coded_picture_number="2" display_picture_number="0" interlaced_frame="0" top_field_first="0" repeat_pict="0" color_range="tv" color_space="bt709" color_primaries="bt709" color_transfer="bt709" chroma_location="left"/>
<frame media_type="video" stream_index="0" key_frame="0" pkt_pts="9009" pkt_pts_time="0.100100" pkt_dts="9009" pkt_dts_time="0.100100" best_effort_timestamp="9009" best_effort_timestamp_time="0.100100" pkt_duration="3003" pkt_duration_time="0.033367" pkt_pos="99338" pkt_size="41" width="1280" height="720" pix_fmt="yuv420p" sample_aspect_ratio="1:1" pict_type="P" coded_picture_number="3" display_picture_number="0" interlaced_frame="0" top_field_first="0" repeat_pict="0" color_range="tv" color_space="bt709" color_primaries="bt709" color_transfer="bt709" chroma_location="left"/>
<frame media_type="video" stream_index="0" key_frame="0" pkt_pts="12012" pkt_pts_time="0.133467" pkt_dts="12012" pkt_dts_time="0.133467" best_effort_timestamp="12012" best_effort_timestamp_time="0.133467" pkt_duration="3003" pkt_duration_time="0.033367" pkt_pos="99379" pkt_size="41" width="1280" height="720" pix_fmt="yuv420p" sample_aspect_ratio="1:1" pict_type="P" coded_picture_number="4" display_picture_number="0" interlaced_frame="0" top_field_first="0" repeat_pict="0" color_range="tv" color_space="bt709" color_primaries="bt709" color_transfer="bt709" chroma_location="left"/>
<frame media_type="video" stream_index="0" key_frame="0" pkt_pts="15015" pkt_pts_time="0.166833" pkt_dts="15015" pkt_dts_time="0.166833" best_effort_timestamp="15015" best_effort_timestamp_time="0.166833" pkt_duration="3003" pkt_duration_time="0.033367" pkt_pos="99420" pkt_size="41" width="1280" height="720" pix_fmt="yuv420p" sample_aspect_ratio="1:1" pict_type="P" coded_picture_number="5" display_picture_number="0" interlaced_frame="0" top_field_first="0" repeat_pict="0" color_range="tv" color_space="bt709" color_primaries="bt709" color_transfer="bt709" chroma_location="left"/>
<frame media_type="video" stream_index="0" key_frame="0" pkt_pts="18018" pkt_pts_time="0.200200" pkt_dts="18018" pkt_dts_time="0.200200" best_effort_timestamp="18018" best_effort_timestamp_time="0.200200" pkt_duration="3003" pkt_duration_time="0.033367" pkt_pos="99461" pkt_size="41" width="1280" height="720" pix_fmt="yuv420p" sample_aspect_ratio="1:1" pict_type="P" coded_picture_number="6" display_picture_number="0" interlaced_frame="0" top_field_first="0" repeat_pict="0" color_range="tv" color_space="bt709" color_primaries="bt709" color_transfer="bt709" chroma_location="left"/>
<frame media_type="video" stream_index="0" key_frame="0" pkt_pts="21021" pkt_pts_time="0.233567" pkt_dts="21021" pkt_dts_time="0.233567" best_effort_timestamp="21021" best_effort_timestamp_time="0.233567" pkt_duration="3003" pkt_duration_time="0.033367" pkt_pos="99502" pkt_size="41" width="1280" height="720" pix_fmt="yuv420p" sample_aspect_ratio="1:1" pict_type="P" coded_picture_number="7" display_picture_number="0" interlaced_frame="0" top_field_first="0" repeat_pict="0" color_range="tv" color_space="bt709" color_primaries="bt709" color_transfer="bt709" chroma_location="left"/>
<frame media_type="video" stream_index="0" key_frame="0" pkt_pts="24024" pkt_pts_time="0.266933" pkt_dts="24024" pkt_dts_time="0.266933" best_effort_timestamp="24024" best_effort_timestamp_time="0.266933" pkt_duration="3003" pkt_duration_time="0.033367" pkt_pos="99543" pkt_size="41" width="1280" height="720" pix_fmt="yuv420p" sample_aspect_ratio="1:1" pict_type="P" coded_picture_number="8" display_picture_number="0" interlaced_frame="0" top_field_first="0" repeat_pict="0" color_range="tv" color_space="bt709" color_primaries="bt709" color_transfer="bt709" chroma_location="left"/>
<frame media_type="video" stream_index="0" key_frame="0" pkt_pts="27027" pkt_pts_time="0.300300" pkt_dts="27027" pkt_dts_time="0.300300" best_effort_timestamp="27027" best_effort_timestamp_time="0.300300" pkt_duration="3003" pkt_duration_time="0.033367" pkt_pos="99584" pkt_size="41" width="1280" height="720" pix_fmt="yuv420p" sample_aspect_ratio="1:1" pict_type="P" coded_picture_number="9" display_picture_number="0" interlaced_frame="0" top_field_first="0" repeat_pict="0" color_range="tv" color_space="bt709" color_primaries="bt709" color_transfer="bt709" chroma_location="left"/>
<frame media_type="video" stream_index="0" key_frame="0" pkt_pts="30030" pkt_pts_time="0.333667" pkt_dts="30030" pkt_dts_time="0.333667" best_effort_timestamp="30030" best_effort_timestamp_time="0.333667" pkt_duration="3003" pkt_duration_time="0.033367" pkt_pos="99625" pkt_size="41" width="1280" height="720" pix_fmt="yuv420p" sample_aspect_ratio="1:1" pict_type="P" coded_picture_number="10" display_picture_number="0" interlaced_frame="0" top_field_first="0" repeat_pict="0" color_range="tv" color_space="bt709" color_primaries="bt709" color_transfer="bt709" chroma_location="left"/>
<frame media_type="video" stream_index="0" key_frame="0" pkt_pts="33033" pkt_pts_time="0.367033" pkt_dts="33033" pkt_dts_time="0.367033" best_effort_timestamp="33033" best_effort_timestamp_time="0.367033" pkt_duration="3003" pkt_duration_time="0.033367" pkt_pos="99666" pkt_size="41" width="1280" height="720" pix_fmt="yuv420p" sample_aspect_ratio="1:1" pict_type="P" coded_picture_number="11" display_picture_number="0" interlaced_frame="0" top_field_first="0" repeat_pict="0" color_range="tv" color_space="bt709" color_primaries="bt709" color_transfer="bt709" chroma_location="left"/>
<frame media_type="video" stream_index="0" key_frame="0" pkt_pts="36036" pkt_pts_time="0.400400" pkt_dts="36036" pkt_dts_time="0.400400" best_effort_timestamp="36036" best_effort_timestamp_time="0.400400" pkt_duration="3003" pkt_duration_time="0.033367" pkt_pos="99707" pkt_size="41" width="1280" height="720" pix_fmt="yuv420p" sample_aspect_ratio="1:1" pict_type="P" coded_picture_number="12" display_picture_number="0" interlaced_frame="0" top_field_first="0" repeat_pict="0" color_range="tv" color_space="bt709" color_primaries="bt709" color_transfer="bt709" chroma_location="left"/>
<frame media_type="video" stream_index="0" key_frame="0" pkt_pts="39039" pkt_pts_time="0.433767" pkt_dts="39039" pkt_dts_time="0.433767" best_effort_timestamp="39039" best_effort_timestamp_time="0.433767" pkt_duration="3003" pkt_duration_time="0.033367" pkt_pos="99748" pkt_size="41" width="1280" height="720" pix_fmt="yuv420p" sample_aspect_ratio="1:1" pict_type="P" coded_picture_number="13" display_picture_number="0" interlaced_frame="0" top_field_first="0" repeat_pict="0" color_range="tv" color_space="bt709" color_primaries="bt709" color_transfer="bt709" chroma_location="left"/>
<frame media_type="video" stream_index="0" key_frame="0" pkt_pts="42042" pkt_pts_time="0.467133" pkt_dts="42042" pkt_dts_time="0.467133" best_effort_timestamp="42042" best_effort_timestamp_time="0.467133" pkt_duration="3003" pkt_duration_time="0.033367" pkt_pos="107902" pkt_size="41" width="1280" height="720" pix_fmt="yuv420p" sample_aspect_ratio="1:1" pict_type="P" coded_picture_number="14" display_picture_number="0" interlaced_frame="0" top_field_first="0" repeat_pict="0" color_range="tv" color_space="bt709" color_primaries="bt709" color_transfer="bt709" chroma_location="left"/>
<frame media_type="video" stream_index="0" key_frame="0" pkt_pts="45045" pkt_pts_time="0.500500" pkt_dts="45045" pkt_dts_time="0.500500" best_effort_timestamp="45045" best_effort_timestamp_time="0.500500" pkt_duration="3003" pkt_duration_time="0.033367" pkt_pos="107943" pkt_size="104144" width="1280" height="720" pix_fmt="yuv420p" sample_aspect_ratio="1:1" pict_type="I" coded_picture_number="15" display_picture_number="0" interlaced_frame="0" top_field_first="0" repeat_pict="0" color_range="tv" color_space="bt709" color_primaries="bt709" color_transfer="bt709" chroma_location="left"/>
<frame media_type="video" stream_index="0" key_frame="0" pkt_pts="48048" pkt_pts_time="0.533867" pkt_dts="48048" pkt_dts_time="0.533867" best_effort_timestamp="48048" best_effort_timestamp_time="0.533867" pkt_duration="3003" pkt_duration_time="0.033367" pkt_pos="215193" pkt_size="532" width="1280" height="720" pix_fmt="yuv420p" sample_aspect_ratio="1:1" pict_type="B" coded_picture_number="17" display_picture_number="0" interlaced_frame="0" top_field_first="0" repeat_pict="0" color_range="tv" color_space="bt709" color_primaries="bt709" color_transfer="bt709" chroma_location="left"/>
liuqideMacBook-Pro:ffmpeg liuqi$
|