[FFmpeg-devel] [PATCH] fate/ffprobe: add some stream metadata.

Clément Bœsch ubitux at gmail.com
Thu Sep 27 09:50:58 CEST 2012


From: Clément Bœsch <clement.boesch at smartjog.com>

---
 tests/Makefile                 |    2 ++
 tests/ref/fate/ffprobe_compact |   62 ++++++++++++++++-----------------
 tests/ref/fate/ffprobe_csv     |   62 ++++++++++++++++-----------------
 tests/ref/fate/ffprobe_default |   67 ++++++++++++++++++-----------------
 tests/ref/fate/ffprobe_flat    |   67 ++++++++++++++++++-----------------
 tests/ref/fate/ffprobe_ini     |   71 ++++++++++++++++++++-----------------
 tests/ref/fate/ffprobe_json    |   75 ++++++++++++++++++++++------------------
 tests/ref/fate/ffprobe_xml     |   67 ++++++++++++++++++-----------------
 8 files changed, 250 insertions(+), 223 deletions(-)

diff --git a/tests/Makefile b/tests/Makefile
index 68620006..f13bc7e 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -34,6 +34,8 @@ tests/data/ffprobe-test.nut: ffmpeg$(HOSTEXESUF) | tests/data
 	$(M)./$< \
         -f lavfi -i "aevalsrc=sin(400*PI*2*t)::d=0.125[out0]; testsrc=d=0.125[out1]; testsrc=s=100x100:d=0.125[out2]" \
         -f ffmetadata -i $(SRC_PATH)/tests/test.ffmeta \
+        -metadata:s:1 title=foobar -metadata:s:1 duration_ts=field-and-tags-conflict-attempt \
+        -metadata:s:0 E=MC2 \
         -flags +bitexact -map 0:0 -map 0:1 -map 0:2 -map_metadata 1 \
         -vcodec rawvideo -acodec pcm_s16le \
         -y $@ 2>/dev/null
diff --git a/tests/ref/fate/ffprobe_compact b/tests/ref/fate/ffprobe_compact
index 71239fe..178a00e 100644
--- a/tests/ref/fate/ffprobe_compact
+++ b/tests/ref/fate/ffprobe_compact
@@ -1,32 +1,32 @@
-packet|codec_type=audio|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=1024|duration_time=0.023220|convergence_duration=N/A|convergence_duration_time=N/A|size=2048|pos=403|flags=K
-frame|media_type=audio|key_frame=1|pkt_pts=0|pkt_pts_time=0.000000|pkt_dts=0|pkt_dts_time=0.000000|pkt_duration=1024|pkt_duration_time=0.023220|pkt_pos=403|sample_fmt=s16|nb_samples=1024|channels=1|channel_layout=unknown
-packet|codec_type=video|stream_index=1|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=1|duration_time=0.040000|convergence_duration=N/A|convergence_duration_time=N/A|size=230400|pos=2478|flags=K
-frame|media_type=video|key_frame=1|pkt_pts=0|pkt_pts_time=0.000000|pkt_dts=0|pkt_dts_time=0.000000|pkt_duration=1|pkt_duration_time=0.040000|pkt_pos=2478|width=320|height=240|pix_fmt=rgb24|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|reference=0
-packet|codec_type=video|stream_index=2|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=1|duration_time=0.040000|convergence_duration=N/A|convergence_duration_time=N/A|size=30000|pos=232899|flags=K
-frame|media_type=video|key_frame=1|pkt_pts=0|pkt_pts_time=0.000000|pkt_dts=0|pkt_dts_time=0.000000|pkt_duration=1|pkt_duration_time=0.040000|pkt_pos=232899|width=100|height=100|pix_fmt=rgb24|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|reference=0
-packet|codec_type=audio|stream_index=0|pts=1024|pts_time=0.023220|dts=1024|dts_time=0.023220|duration=1024|duration_time=0.023220|convergence_duration=N/A|convergence_duration_time=N/A|size=2048|pos=262904|flags=K
-frame|media_type=audio|key_frame=1|pkt_pts=1024|pkt_pts_time=0.023220|pkt_dts=1024|pkt_dts_time=0.023220|pkt_duration=1024|pkt_duration_time=0.023220|pkt_pos=262904|sample_fmt=s16|nb_samples=1024|channels=1|channel_layout=unknown
-packet|codec_type=video|stream_index=1|pts=1|pts_time=0.040000|dts=1|dts_time=0.040000|duration=1|duration_time=0.040000|convergence_duration=N/A|convergence_duration_time=N/A|size=230400|pos=264980|flags=K
-frame|media_type=video|key_frame=1|pkt_pts=1|pkt_pts_time=0.040000|pkt_dts=1|pkt_dts_time=0.040000|pkt_duration=1|pkt_duration_time=0.040000|pkt_pos=264980|width=320|height=240|pix_fmt=rgb24|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|reference=0
-packet|codec_type=video|stream_index=2|pts=1|pts_time=0.040000|dts=1|dts_time=0.040000|duration=1|duration_time=0.040000|convergence_duration=N/A|convergence_duration_time=N/A|size=30000|pos=495402|flags=K
-frame|media_type=video|key_frame=1|pkt_pts=1|pkt_pts_time=0.040000|pkt_dts=1|pkt_dts_time=0.040000|pkt_duration=1|pkt_duration_time=0.040000|pkt_pos=495402|width=100|height=100|pix_fmt=rgb24|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|reference=0
-packet|codec_type=audio|stream_index=0|pts=2048|pts_time=0.046440|dts=2048|dts_time=0.046440|duration=1024|duration_time=0.023220|convergence_duration=N/A|convergence_duration_time=N/A|size=2048|pos=525407|flags=K
-frame|media_type=audio|key_frame=1|pkt_pts=2048|pkt_pts_time=0.046440|pkt_dts=2048|pkt_dts_time=0.046440|pkt_duration=1024|pkt_duration_time=0.023220|pkt_pos=525407|sample_fmt=s16|nb_samples=1024|channels=1|channel_layout=unknown
-packet|codec_type=audio|stream_index=0|pts=3072|pts_time=0.069660|dts=3072|dts_time=0.069660|duration=1024|duration_time=0.023220|convergence_duration=N/A|convergence_duration_time=N/A|size=2048|pos=527478|flags=K
-frame|media_type=audio|key_frame=1|pkt_pts=3072|pkt_pts_time=0.069660|pkt_dts=3072|pkt_dts_time=0.069660|pkt_duration=1024|pkt_duration_time=0.023220|pkt_pos=527478|sample_fmt=s16|nb_samples=1024|channels=1|channel_layout=unknown
-packet|codec_type=video|stream_index=1|pts=2|pts_time=0.080000|dts=2|dts_time=0.080000|duration=1|duration_time=0.040000|convergence_duration=N/A|convergence_duration_time=N/A|size=230400|pos=529554|flags=K
-frame|media_type=video|key_frame=1|pkt_pts=2|pkt_pts_time=0.080000|pkt_dts=2|pkt_dts_time=0.080000|pkt_duration=1|pkt_duration_time=0.040000|pkt_pos=529554|width=320|height=240|pix_fmt=rgb24|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|reference=0
-packet|codec_type=video|stream_index=2|pts=2|pts_time=0.080000|dts=2|dts_time=0.080000|duration=1|duration_time=0.040000|convergence_duration=N/A|convergence_duration_time=N/A|size=30000|pos=759976|flags=K
-frame|media_type=video|key_frame=1|pkt_pts=2|pkt_pts_time=0.080000|pkt_dts=2|pkt_dts_time=0.080000|pkt_duration=1|pkt_duration_time=0.040000|pkt_pos=759976|width=100|height=100|pix_fmt=rgb24|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|reference=0
-packet|codec_type=audio|stream_index=0|pts=4096|pts_time=0.092880|dts=4096|dts_time=0.092880|duration=1024|duration_time=0.023220|convergence_duration=N/A|convergence_duration_time=N/A|size=2048|pos=789981|flags=K
-frame|media_type=audio|key_frame=1|pkt_pts=4096|pkt_pts_time=0.092880|pkt_dts=4096|pkt_dts_time=0.092880|pkt_duration=1024|pkt_duration_time=0.023220|pkt_pos=789981|sample_fmt=s16|nb_samples=1024|channels=1|channel_layout=unknown
-packet|codec_type=audio|stream_index=0|pts=5120|pts_time=0.116100|dts=5120|dts_time=0.116100|duration=1024|duration_time=0.023220|convergence_duration=N/A|convergence_duration_time=N/A|size=2048|pos=792052|flags=K
-frame|media_type=audio|key_frame=1|pkt_pts=5120|pkt_pts_time=0.116100|pkt_dts=5120|pkt_dts_time=0.116100|pkt_duration=1024|pkt_duration_time=0.023220|pkt_pos=792052|sample_fmt=s16|nb_samples=1024|channels=1|channel_layout=unknown
-packet|codec_type=video|stream_index=1|pts=3|pts_time=0.120000|dts=3|dts_time=0.120000|duration=1|duration_time=0.040000|convergence_duration=N/A|convergence_duration_time=N/A|size=230400|pos=794128|flags=K
-frame|media_type=video|key_frame=1|pkt_pts=3|pkt_pts_time=0.120000|pkt_dts=3|pkt_dts_time=0.120000|pkt_duration=1|pkt_duration_time=0.040000|pkt_pos=794128|width=320|height=240|pix_fmt=rgb24|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|reference=0
-packet|codec_type=video|stream_index=2|pts=3|pts_time=0.120000|dts=3|dts_time=0.120000|duration=1|duration_time=0.040000|convergence_duration=N/A|convergence_duration_time=N/A|size=30000|pos=1024550|flags=K
-frame|media_type=video|key_frame=1|pkt_pts=3|pkt_pts_time=0.120000|pkt_dts=3|pkt_dts_time=0.120000|pkt_duration=1|pkt_duration_time=0.040000|pkt_pos=1024550|width=100|height=100|pix_fmt=rgb24|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|reference=0
-stream|index=0|codec_name=pcm_s16le|profile=unknown|codec_type=audio|codec_time_base=1/44100|codec_tag_string=[1][0][0][0]|codec_tag=0x0001|default=0|forced=0|sample_fmt=s16|sample_rate=44100|channels=1|bits_per_sample=16|id=N/A|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/44100|start_pts=0|start_time=0.000000|duration_ts=527313|duration=11.957211|bit_rate=705600|nb_frames=N/A|nb_read_frames=6|nb_read_packets=6
-stream|index=1|codec_name=rawvideo|profile=unknown|codec_type=video|codec_time_base=1/25|codec_tag_string=RGB[24]|codec_tag=0x18424752|default=0|forced=0|width=320|height=240|has_b_frames=0|sample_aspect_ratio=1:1|display_aspect_ratio=4:3|pix_fmt=rgb24|level=-99|timecode=N/A|attached_pic=0|id=N/A|r_frame_rate=25/1|avg_frame_rate=0/0|time_base=1/25|start_pts=0|start_time=0.000000|duration_ts=299|duration=11.960000|bit_rate=N/A|nb_frames=N/A|nb_read_frames=4|nb_read_packets=4
+packet|codec_type=audio|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=1024|duration_time=0.023220|convergence_duration=N/A|convergence_duration_time=N/A|size=2048|pos=505|flags=K
+frame|media_type=audio|key_frame=1|pkt_pts=0|pkt_pts_time=0.000000|pkt_dts=0|pkt_dts_time=0.000000|pkt_duration=1024|pkt_duration_time=0.023220|pkt_pos=505|sample_fmt=s16|nb_samples=1024|channels=1|channel_layout=unknown
+packet|codec_type=video|stream_index=1|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=1|duration_time=0.040000|convergence_duration=N/A|convergence_duration_time=N/A|size=230400|pos=2580|flags=K
+frame|media_type=video|key_frame=1|pkt_pts=0|pkt_pts_time=0.000000|pkt_dts=0|pkt_dts_time=0.000000|pkt_duration=1|pkt_duration_time=0.040000|pkt_pos=2580|width=320|height=240|pix_fmt=rgb24|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|reference=0
+packet|codec_type=video|stream_index=2|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=1|duration_time=0.040000|convergence_duration=N/A|convergence_duration_time=N/A|size=30000|pos=233001|flags=K
+frame|media_type=video|key_frame=1|pkt_pts=0|pkt_pts_time=0.000000|pkt_dts=0|pkt_dts_time=0.000000|pkt_duration=1|pkt_duration_time=0.040000|pkt_pos=233001|width=100|height=100|pix_fmt=rgb24|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|reference=0
+packet|codec_type=audio|stream_index=0|pts=1024|pts_time=0.023220|dts=1024|dts_time=0.023220|duration=1024|duration_time=0.023220|convergence_duration=N/A|convergence_duration_time=N/A|size=2048|pos=263006|flags=K
+frame|media_type=audio|key_frame=1|pkt_pts=1024|pkt_pts_time=0.023220|pkt_dts=1024|pkt_dts_time=0.023220|pkt_duration=1024|pkt_duration_time=0.023220|pkt_pos=263006|sample_fmt=s16|nb_samples=1024|channels=1|channel_layout=unknown
+packet|codec_type=video|stream_index=1|pts=1|pts_time=0.040000|dts=1|dts_time=0.040000|duration=1|duration_time=0.040000|convergence_duration=N/A|convergence_duration_time=N/A|size=230400|pos=265082|flags=K
+frame|media_type=video|key_frame=1|pkt_pts=1|pkt_pts_time=0.040000|pkt_dts=1|pkt_dts_time=0.040000|pkt_duration=1|pkt_duration_time=0.040000|pkt_pos=265082|width=320|height=240|pix_fmt=rgb24|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|reference=0
+packet|codec_type=video|stream_index=2|pts=1|pts_time=0.040000|dts=1|dts_time=0.040000|duration=1|duration_time=0.040000|convergence_duration=N/A|convergence_duration_time=N/A|size=30000|pos=495504|flags=K
+frame|media_type=video|key_frame=1|pkt_pts=1|pkt_pts_time=0.040000|pkt_dts=1|pkt_dts_time=0.040000|pkt_duration=1|pkt_duration_time=0.040000|pkt_pos=495504|width=100|height=100|pix_fmt=rgb24|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|reference=0
+packet|codec_type=audio|stream_index=0|pts=2048|pts_time=0.046440|dts=2048|dts_time=0.046440|duration=1024|duration_time=0.023220|convergence_duration=N/A|convergence_duration_time=N/A|size=2048|pos=525509|flags=K
+frame|media_type=audio|key_frame=1|pkt_pts=2048|pkt_pts_time=0.046440|pkt_dts=2048|pkt_dts_time=0.046440|pkt_duration=1024|pkt_duration_time=0.023220|pkt_pos=525509|sample_fmt=s16|nb_samples=1024|channels=1|channel_layout=unknown
+packet|codec_type=audio|stream_index=0|pts=3072|pts_time=0.069660|dts=3072|dts_time=0.069660|duration=1024|duration_time=0.023220|convergence_duration=N/A|convergence_duration_time=N/A|size=2048|pos=527580|flags=K
+frame|media_type=audio|key_frame=1|pkt_pts=3072|pkt_pts_time=0.069660|pkt_dts=3072|pkt_dts_time=0.069660|pkt_duration=1024|pkt_duration_time=0.023220|pkt_pos=527580|sample_fmt=s16|nb_samples=1024|channels=1|channel_layout=unknown
+packet|codec_type=video|stream_index=1|pts=2|pts_time=0.080000|dts=2|dts_time=0.080000|duration=1|duration_time=0.040000|convergence_duration=N/A|convergence_duration_time=N/A|size=230400|pos=529656|flags=K
+frame|media_type=video|key_frame=1|pkt_pts=2|pkt_pts_time=0.080000|pkt_dts=2|pkt_dts_time=0.080000|pkt_duration=1|pkt_duration_time=0.040000|pkt_pos=529656|width=320|height=240|pix_fmt=rgb24|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|reference=0
+packet|codec_type=video|stream_index=2|pts=2|pts_time=0.080000|dts=2|dts_time=0.080000|duration=1|duration_time=0.040000|convergence_duration=N/A|convergence_duration_time=N/A|size=30000|pos=760078|flags=K
+frame|media_type=video|key_frame=1|pkt_pts=2|pkt_pts_time=0.080000|pkt_dts=2|pkt_dts_time=0.080000|pkt_duration=1|pkt_duration_time=0.040000|pkt_pos=760078|width=100|height=100|pix_fmt=rgb24|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|reference=0
+packet|codec_type=audio|stream_index=0|pts=4096|pts_time=0.092880|dts=4096|dts_time=0.092880|duration=1024|duration_time=0.023220|convergence_duration=N/A|convergence_duration_time=N/A|size=2048|pos=790083|flags=K
+frame|media_type=audio|key_frame=1|pkt_pts=4096|pkt_pts_time=0.092880|pkt_dts=4096|pkt_dts_time=0.092880|pkt_duration=1024|pkt_duration_time=0.023220|pkt_pos=790083|sample_fmt=s16|nb_samples=1024|channels=1|channel_layout=unknown
+packet|codec_type=audio|stream_index=0|pts=5120|pts_time=0.116100|dts=5120|dts_time=0.116100|duration=1024|duration_time=0.023220|convergence_duration=N/A|convergence_duration_time=N/A|size=2048|pos=792154|flags=K
+frame|media_type=audio|key_frame=1|pkt_pts=5120|pkt_pts_time=0.116100|pkt_dts=5120|pkt_dts_time=0.116100|pkt_duration=1024|pkt_duration_time=0.023220|pkt_pos=792154|sample_fmt=s16|nb_samples=1024|channels=1|channel_layout=unknown
+packet|codec_type=video|stream_index=1|pts=3|pts_time=0.120000|dts=3|dts_time=0.120000|duration=1|duration_time=0.040000|convergence_duration=N/A|convergence_duration_time=N/A|size=230400|pos=794230|flags=K
+frame|media_type=video|key_frame=1|pkt_pts=3|pkt_pts_time=0.120000|pkt_dts=3|pkt_dts_time=0.120000|pkt_duration=1|pkt_duration_time=0.040000|pkt_pos=794230|width=320|height=240|pix_fmt=rgb24|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|reference=0
+packet|codec_type=video|stream_index=2|pts=3|pts_time=0.120000|dts=3|dts_time=0.120000|duration=1|duration_time=0.040000|convergence_duration=N/A|convergence_duration_time=N/A|size=30000|pos=1024652|flags=K
+frame|media_type=video|key_frame=1|pkt_pts=3|pkt_pts_time=0.120000|pkt_dts=3|pkt_dts_time=0.120000|pkt_duration=1|pkt_duration_time=0.040000|pkt_pos=1024652|width=100|height=100|pix_fmt=rgb24|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|reference=0
+stream|index=0|codec_name=pcm_s16le|profile=unknown|codec_type=audio|codec_time_base=1/44100|codec_tag_string=[1][0][0][0]|codec_tag=0x0001|default=0|forced=0|sample_fmt=s16|sample_rate=44100|channels=1|bits_per_sample=16|id=N/A|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/44100|start_pts=0|start_time=0.000000|duration_ts=527364|duration=11.958367|bit_rate=705600|nb_frames=N/A|nb_read_frames=6|nb_read_packets=6|tag:E=MC2
+stream|index=1|codec_name=rawvideo|profile=unknown|codec_type=video|codec_time_base=1/25|codec_tag_string=RGB[24]|codec_tag=0x18424752|default=0|forced=0|width=320|height=240|has_b_frames=0|sample_aspect_ratio=1:1|display_aspect_ratio=4:3|pix_fmt=rgb24|level=-99|timecode=N/A|attached_pic=0|id=N/A|r_frame_rate=25/1|avg_frame_rate=0/0|time_base=1/25|start_pts=0|start_time=0.000000|duration_ts=299|duration=11.960000|bit_rate=N/A|nb_frames=N/A|nb_read_frames=4|nb_read_packets=4|tag:title=foobar|tag:duration_ts=field-and-tags-conflict-attempt
 stream|index=2|codec_name=rawvideo|profile=unknown|codec_type=video|codec_time_base=1/25|codec_tag_string=RGB[24]|codec_tag=0x18424752|default=0|forced=0|width=100|height=100|has_b_frames=0|sample_aspect_ratio=1:1|display_aspect_ratio=1:1|pix_fmt=rgb24|level=-99|timecode=N/A|attached_pic=0|id=N/A|r_frame_rate=25/1|avg_frame_rate=0/0|time_base=1/25|start_pts=0|start_time=0.000000|duration_ts=299|duration=11.960000|bit_rate=N/A|nb_frames=N/A|nb_read_frames=4|nb_read_packets=4
-format|filename=tests/data/ffprobe-test.nut|nb_streams=3|format_name=nut|start_time=0.000000|duration=11.960000|size=1054625|bit_rate=705434|tag:title=ffprobe test file|tag:comment='A comment with CSV, XML & JSON special chars': <tag value="x">|tag:comment2=I ♥ Üñîçød€
+format|filename=tests/data/ffprobe-test.nut|nb_streams=3|format_name=nut|start_time=0.000000|duration=11.960000|size=1054727|bit_rate=705503|tag:title=ffprobe test file|tag:comment='A comment with CSV, XML & JSON special chars': <tag value="x">|tag:comment2=I ♥ Üñîçød€
diff --git a/tests/ref/fate/ffprobe_csv b/tests/ref/fate/ffprobe_csv
index 86e4a1a..6091766 100644
--- a/tests/ref/fate/ffprobe_csv
+++ b/tests/ref/fate/ffprobe_csv
@@ -1,32 +1,32 @@
-packet,audio,0,0,0.000000,0,0.000000,1024,0.023220,N/A,N/A,2048,403,K
-frame,audio,1,0,0.000000,0,0.000000,1024,0.023220,403,s16,1024,1,unknown
-packet,video,1,0,0.000000,0,0.000000,1,0.040000,N/A,N/A,230400,2478,K
-frame,video,1,0,0.000000,0,0.000000,1,0.040000,2478,320,240,rgb24,1:1,I,0,0,0,0,0,0
-packet,video,2,0,0.000000,0,0.000000,1,0.040000,N/A,N/A,30000,232899,K
-frame,video,1,0,0.000000,0,0.000000,1,0.040000,232899,100,100,rgb24,1:1,I,0,0,0,0,0,0
-packet,audio,0,1024,0.023220,1024,0.023220,1024,0.023220,N/A,N/A,2048,262904,K
-frame,audio,1,1024,0.023220,1024,0.023220,1024,0.023220,262904,s16,1024,1,unknown
-packet,video,1,1,0.040000,1,0.040000,1,0.040000,N/A,N/A,230400,264980,K
-frame,video,1,1,0.040000,1,0.040000,1,0.040000,264980,320,240,rgb24,1:1,I,0,0,0,0,0,0
-packet,video,2,1,0.040000,1,0.040000,1,0.040000,N/A,N/A,30000,495402,K
-frame,video,1,1,0.040000,1,0.040000,1,0.040000,495402,100,100,rgb24,1:1,I,0,0,0,0,0,0
-packet,audio,0,2048,0.046440,2048,0.046440,1024,0.023220,N/A,N/A,2048,525407,K
-frame,audio,1,2048,0.046440,2048,0.046440,1024,0.023220,525407,s16,1024,1,unknown
-packet,audio,0,3072,0.069660,3072,0.069660,1024,0.023220,N/A,N/A,2048,527478,K
-frame,audio,1,3072,0.069660,3072,0.069660,1024,0.023220,527478,s16,1024,1,unknown
-packet,video,1,2,0.080000,2,0.080000,1,0.040000,N/A,N/A,230400,529554,K
-frame,video,1,2,0.080000,2,0.080000,1,0.040000,529554,320,240,rgb24,1:1,I,0,0,0,0,0,0
-packet,video,2,2,0.080000,2,0.080000,1,0.040000,N/A,N/A,30000,759976,K
-frame,video,1,2,0.080000,2,0.080000,1,0.040000,759976,100,100,rgb24,1:1,I,0,0,0,0,0,0
-packet,audio,0,4096,0.092880,4096,0.092880,1024,0.023220,N/A,N/A,2048,789981,K
-frame,audio,1,4096,0.092880,4096,0.092880,1024,0.023220,789981,s16,1024,1,unknown
-packet,audio,0,5120,0.116100,5120,0.116100,1024,0.023220,N/A,N/A,2048,792052,K
-frame,audio,1,5120,0.116100,5120,0.116100,1024,0.023220,792052,s16,1024,1,unknown
-packet,video,1,3,0.120000,3,0.120000,1,0.040000,N/A,N/A,230400,794128,K
-frame,video,1,3,0.120000,3,0.120000,1,0.040000,794128,320,240,rgb24,1:1,I,0,0,0,0,0,0
-packet,video,2,3,0.120000,3,0.120000,1,0.040000,N/A,N/A,30000,1024550,K
-frame,video,1,3,0.120000,3,0.120000,1,0.040000,1024550,100,100,rgb24,1:1,I,0,0,0,0,0,0
-stream,0,pcm_s16le,unknown,audio,1/44100,[1][0][0][0],0x0001,0,0,s16,44100,1,16,N/A,0/0,0/0,1/44100,0,0.000000,527313,11.957211,705600,N/A,6,6
-stream,1,rawvideo,unknown,video,1/25,RGB[24],0x18424752,0,0,320,240,0,1:1,4:3,rgb24,-99,N/A,0,N/A,25/1,0/0,1/25,0,0.000000,299,11.960000,N/A,N/A,4,4
+packet,audio,0,0,0.000000,0,0.000000,1024,0.023220,N/A,N/A,2048,505,K
+frame,audio,1,0,0.000000,0,0.000000,1024,0.023220,505,s16,1024,1,unknown
+packet,video,1,0,0.000000,0,0.000000,1,0.040000,N/A,N/A,230400,2580,K
+frame,video,1,0,0.000000,0,0.000000,1,0.040000,2580,320,240,rgb24,1:1,I,0,0,0,0,0,0
+packet,video,2,0,0.000000,0,0.000000,1,0.040000,N/A,N/A,30000,233001,K
+frame,video,1,0,0.000000,0,0.000000,1,0.040000,233001,100,100,rgb24,1:1,I,0,0,0,0,0,0
+packet,audio,0,1024,0.023220,1024,0.023220,1024,0.023220,N/A,N/A,2048,263006,K
+frame,audio,1,1024,0.023220,1024,0.023220,1024,0.023220,263006,s16,1024,1,unknown
+packet,video,1,1,0.040000,1,0.040000,1,0.040000,N/A,N/A,230400,265082,K
+frame,video,1,1,0.040000,1,0.040000,1,0.040000,265082,320,240,rgb24,1:1,I,0,0,0,0,0,0
+packet,video,2,1,0.040000,1,0.040000,1,0.040000,N/A,N/A,30000,495504,K
+frame,video,1,1,0.040000,1,0.040000,1,0.040000,495504,100,100,rgb24,1:1,I,0,0,0,0,0,0
+packet,audio,0,2048,0.046440,2048,0.046440,1024,0.023220,N/A,N/A,2048,525509,K
+frame,audio,1,2048,0.046440,2048,0.046440,1024,0.023220,525509,s16,1024,1,unknown
+packet,audio,0,3072,0.069660,3072,0.069660,1024,0.023220,N/A,N/A,2048,527580,K
+frame,audio,1,3072,0.069660,3072,0.069660,1024,0.023220,527580,s16,1024,1,unknown
+packet,video,1,2,0.080000,2,0.080000,1,0.040000,N/A,N/A,230400,529656,K
+frame,video,1,2,0.080000,2,0.080000,1,0.040000,529656,320,240,rgb24,1:1,I,0,0,0,0,0,0
+packet,video,2,2,0.080000,2,0.080000,1,0.040000,N/A,N/A,30000,760078,K
+frame,video,1,2,0.080000,2,0.080000,1,0.040000,760078,100,100,rgb24,1:1,I,0,0,0,0,0,0
+packet,audio,0,4096,0.092880,4096,0.092880,1024,0.023220,N/A,N/A,2048,790083,K
+frame,audio,1,4096,0.092880,4096,0.092880,1024,0.023220,790083,s16,1024,1,unknown
+packet,audio,0,5120,0.116100,5120,0.116100,1024,0.023220,N/A,N/A,2048,792154,K
+frame,audio,1,5120,0.116100,5120,0.116100,1024,0.023220,792154,s16,1024,1,unknown
+packet,video,1,3,0.120000,3,0.120000,1,0.040000,N/A,N/A,230400,794230,K
+frame,video,1,3,0.120000,3,0.120000,1,0.040000,794230,320,240,rgb24,1:1,I,0,0,0,0,0,0
+packet,video,2,3,0.120000,3,0.120000,1,0.040000,N/A,N/A,30000,1024652,K
+frame,video,1,3,0.120000,3,0.120000,1,0.040000,1024652,100,100,rgb24,1:1,I,0,0,0,0,0,0
+stream,0,pcm_s16le,unknown,audio,1/44100,[1][0][0][0],0x0001,0,0,s16,44100,1,16,N/A,0/0,0/0,1/44100,0,0.000000,527364,11.958367,705600,N/A,6,6,MC2
+stream,1,rawvideo,unknown,video,1/25,RGB[24],0x18424752,0,0,320,240,0,1:1,4:3,rgb24,-99,N/A,0,N/A,25/1,0/0,1/25,0,0.000000,299,11.960000,N/A,N/A,4,4,foobar,field-and-tags-conflict-attempt
 stream,2,rawvideo,unknown,video,1/25,RGB[24],0x18424752,0,0,100,100,0,1:1,1:1,rgb24,-99,N/A,0,N/A,25/1,0/0,1/25,0,0.000000,299,11.960000,N/A,N/A,4,4
-format,tests/data/ffprobe-test.nut,3,nut,0.000000,11.960000,1054625,705434,ffprobe test file,"'A comment with CSV, XML & JSON special chars': <tag value=""x"">",I ♥ Üñîçød€
+format,tests/data/ffprobe-test.nut,3,nut,0.000000,11.960000,1054727,705503,ffprobe test file,"'A comment with CSV, XML & JSON special chars': <tag value=""x"">",I ♥ Üñîçød€
diff --git a/tests/ref/fate/ffprobe_default b/tests/ref/fate/ffprobe_default
index a9b555b..47921de 100644
--- a/tests/ref/fate/ffprobe_default
+++ b/tests/ref/fate/ffprobe_default
@@ -10,7 +10,7 @@ duration_time=0.023220
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=2048
-pos=403
+pos=505
 flags=K
 [/PACKET]
 [FRAME]
@@ -22,7 +22,7 @@ pkt_dts=0
 pkt_dts_time=0.000000
 pkt_duration=1024
 pkt_duration_time=0.023220
-pkt_pos=403
+pkt_pos=505
 sample_fmt=s16
 nb_samples=1024
 channels=1
@@ -40,7 +40,7 @@ duration_time=0.040000
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=230400
-pos=2478
+pos=2580
 flags=K
 [/PACKET]
 [FRAME]
@@ -52,7 +52,7 @@ pkt_dts=0
 pkt_dts_time=0.000000
 pkt_duration=1
 pkt_duration_time=0.040000
-pkt_pos=2478
+pkt_pos=2580
 width=320
 height=240
 pix_fmt=rgb24
@@ -77,7 +77,7 @@ duration_time=0.040000
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=30000
-pos=232899
+pos=233001
 flags=K
 [/PACKET]
 [FRAME]
@@ -89,7 +89,7 @@ pkt_dts=0
 pkt_dts_time=0.000000
 pkt_duration=1
 pkt_duration_time=0.040000
-pkt_pos=232899
+pkt_pos=233001
 width=100
 height=100
 pix_fmt=rgb24
@@ -114,7 +114,7 @@ duration_time=0.023220
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=2048
-pos=262904
+pos=263006
 flags=K
 [/PACKET]
 [FRAME]
@@ -126,7 +126,7 @@ pkt_dts=1024
 pkt_dts_time=0.023220
 pkt_duration=1024
 pkt_duration_time=0.023220
-pkt_pos=262904
+pkt_pos=263006
 sample_fmt=s16
 nb_samples=1024
 channels=1
@@ -144,7 +144,7 @@ duration_time=0.040000
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=230400
-pos=264980
+pos=265082
 flags=K
 [/PACKET]
 [FRAME]
@@ -156,7 +156,7 @@ pkt_dts=1
 pkt_dts_time=0.040000
 pkt_duration=1
 pkt_duration_time=0.040000
-pkt_pos=264980
+pkt_pos=265082
 width=320
 height=240
 pix_fmt=rgb24
@@ -181,7 +181,7 @@ duration_time=0.040000
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=30000
-pos=495402
+pos=495504
 flags=K
 [/PACKET]
 [FRAME]
@@ -193,7 +193,7 @@ pkt_dts=1
 pkt_dts_time=0.040000
 pkt_duration=1
 pkt_duration_time=0.040000
-pkt_pos=495402
+pkt_pos=495504
 width=100
 height=100
 pix_fmt=rgb24
@@ -218,7 +218,7 @@ duration_time=0.023220
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=2048
-pos=525407
+pos=525509
 flags=K
 [/PACKET]
 [FRAME]
@@ -230,7 +230,7 @@ pkt_dts=2048
 pkt_dts_time=0.046440
 pkt_duration=1024
 pkt_duration_time=0.023220
-pkt_pos=525407
+pkt_pos=525509
 sample_fmt=s16
 nb_samples=1024
 channels=1
@@ -248,7 +248,7 @@ duration_time=0.023220
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=2048
-pos=527478
+pos=527580
 flags=K
 [/PACKET]
 [FRAME]
@@ -260,7 +260,7 @@ pkt_dts=3072
 pkt_dts_time=0.069660
 pkt_duration=1024
 pkt_duration_time=0.023220
-pkt_pos=527478
+pkt_pos=527580
 sample_fmt=s16
 nb_samples=1024
 channels=1
@@ -278,7 +278,7 @@ duration_time=0.040000
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=230400
-pos=529554
+pos=529656
 flags=K
 [/PACKET]
 [FRAME]
@@ -290,7 +290,7 @@ pkt_dts=2
 pkt_dts_time=0.080000
 pkt_duration=1
 pkt_duration_time=0.040000
-pkt_pos=529554
+pkt_pos=529656
 width=320
 height=240
 pix_fmt=rgb24
@@ -315,7 +315,7 @@ duration_time=0.040000
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=30000
-pos=759976
+pos=760078
 flags=K
 [/PACKET]
 [FRAME]
@@ -327,7 +327,7 @@ pkt_dts=2
 pkt_dts_time=0.080000
 pkt_duration=1
 pkt_duration_time=0.040000
-pkt_pos=759976
+pkt_pos=760078
 width=100
 height=100
 pix_fmt=rgb24
@@ -352,7 +352,7 @@ duration_time=0.023220
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=2048
-pos=789981
+pos=790083
 flags=K
 [/PACKET]
 [FRAME]
@@ -364,7 +364,7 @@ pkt_dts=4096
 pkt_dts_time=0.092880
 pkt_duration=1024
 pkt_duration_time=0.023220
-pkt_pos=789981
+pkt_pos=790083
 sample_fmt=s16
 nb_samples=1024
 channels=1
@@ -382,7 +382,7 @@ duration_time=0.023220
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=2048
-pos=792052
+pos=792154
 flags=K
 [/PACKET]
 [FRAME]
@@ -394,7 +394,7 @@ pkt_dts=5120
 pkt_dts_time=0.116100
 pkt_duration=1024
 pkt_duration_time=0.023220
-pkt_pos=792052
+pkt_pos=792154
 sample_fmt=s16
 nb_samples=1024
 channels=1
@@ -412,7 +412,7 @@ duration_time=0.040000
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=230400
-pos=794128
+pos=794230
 flags=K
 [/PACKET]
 [FRAME]
@@ -424,7 +424,7 @@ pkt_dts=3
 pkt_dts_time=0.120000
 pkt_duration=1
 pkt_duration_time=0.040000
-pkt_pos=794128
+pkt_pos=794230
 width=320
 height=240
 pix_fmt=rgb24
@@ -449,7 +449,7 @@ duration_time=0.040000
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=30000
-pos=1024550
+pos=1024652
 flags=K
 [/PACKET]
 [FRAME]
@@ -461,7 +461,7 @@ pkt_dts=3
 pkt_dts_time=0.120000
 pkt_duration=1
 pkt_duration_time=0.040000
-pkt_pos=1024550
+pkt_pos=1024652
 width=100
 height=100
 pix_fmt=rgb24
@@ -494,12 +494,13 @@ avg_frame_rate=0/0
 time_base=1/44100
 start_pts=0
 start_time=0.000000
-duration_ts=527313
-duration=11.957211
+duration_ts=527364
+duration=11.958367
 bit_rate=705600
 nb_frames=N/A
 nb_read_frames=6
 nb_read_packets=6
+TAG:E=MC2
 [/STREAM]
 [STREAM]
 index=1
@@ -532,6 +533,8 @@ bit_rate=N/A
 nb_frames=N/A
 nb_read_frames=4
 nb_read_packets=4
+TAG:title=foobar
+TAG:duration_ts=field-and-tags-conflict-attempt
 [/STREAM]
 [STREAM]
 index=2
@@ -571,8 +574,8 @@ nb_streams=3
 format_name=nut
 start_time=0.000000
 duration=11.960000
-size=1054625
-bit_rate=705434
+size=1054727
+bit_rate=705503
 TAG:title=ffprobe test file
 TAG:comment='A comment with CSV, XML & JSON special chars': <tag value="x">
 TAG:comment2=I ♥ Üñîçød€
diff --git a/tests/ref/fate/ffprobe_flat b/tests/ref/fate/ffprobe_flat
index e9e2f87..e6096e7 100644
--- a/tests/ref/fate/ffprobe_flat
+++ b/tests/ref/fate/ffprobe_flat
@@ -9,7 +9,7 @@ packets_and_frames.packet.0.duration_time="0.023220"
 packets_and_frames.packet.0.convergence_duration="N/A"
 packets_and_frames.packet.0.convergence_duration_time="N/A"
 packets_and_frames.packet.0.size="2048"
-packets_and_frames.packet.0.pos="403"
+packets_and_frames.packet.0.pos="505"
 packets_and_frames.packet.0.flags="K"
 packets_and_frames.frame.0.media_type="audio"
 packets_and_frames.frame.0.key_frame=1
@@ -19,7 +19,7 @@ packets_and_frames.frame.0.pkt_dts=0
 packets_and_frames.frame.0.pkt_dts_time="0.000000"
 packets_and_frames.frame.0.pkt_duration=1024
 packets_and_frames.frame.0.pkt_duration_time="0.023220"
-packets_and_frames.frame.0.pkt_pos="403"
+packets_and_frames.frame.0.pkt_pos="505"
 packets_and_frames.frame.0.sample_fmt="s16"
 packets_and_frames.frame.0.nb_samples=1024
 packets_and_frames.frame.0.channels=1
@@ -35,7 +35,7 @@ packets_and_frames.packet.1.duration_time="0.040000"
 packets_and_frames.packet.1.convergence_duration="N/A"
 packets_and_frames.packet.1.convergence_duration_time="N/A"
 packets_and_frames.packet.1.size="230400"
-packets_and_frames.packet.1.pos="2478"
+packets_and_frames.packet.1.pos="2580"
 packets_and_frames.packet.1.flags="K"
 packets_and_frames.frame.1.media_type="video"
 packets_and_frames.frame.1.key_frame=1
@@ -45,7 +45,7 @@ packets_and_frames.frame.1.pkt_dts=0
 packets_and_frames.frame.1.pkt_dts_time="0.000000"
 packets_and_frames.frame.1.pkt_duration=1
 packets_and_frames.frame.1.pkt_duration_time="0.040000"
-packets_and_frames.frame.1.pkt_pos="2478"
+packets_and_frames.frame.1.pkt_pos="2580"
 packets_and_frames.frame.1.width=320
 packets_and_frames.frame.1.height=240
 packets_and_frames.frame.1.pix_fmt="rgb24"
@@ -68,7 +68,7 @@ packets_and_frames.packet.2.duration_time="0.040000"
 packets_and_frames.packet.2.convergence_duration="N/A"
 packets_and_frames.packet.2.convergence_duration_time="N/A"
 packets_and_frames.packet.2.size="30000"
-packets_and_frames.packet.2.pos="232899"
+packets_and_frames.packet.2.pos="233001"
 packets_and_frames.packet.2.flags="K"
 packets_and_frames.frame.2.media_type="video"
 packets_and_frames.frame.2.key_frame=1
@@ -78,7 +78,7 @@ packets_and_frames.frame.2.pkt_dts=0
 packets_and_frames.frame.2.pkt_dts_time="0.000000"
 packets_and_frames.frame.2.pkt_duration=1
 packets_and_frames.frame.2.pkt_duration_time="0.040000"
-packets_and_frames.frame.2.pkt_pos="232899"
+packets_and_frames.frame.2.pkt_pos="233001"
 packets_and_frames.frame.2.width=100
 packets_and_frames.frame.2.height=100
 packets_and_frames.frame.2.pix_fmt="rgb24"
@@ -101,7 +101,7 @@ packets_and_frames.packet.3.duration_time="0.023220"
 packets_and_frames.packet.3.convergence_duration="N/A"
 packets_and_frames.packet.3.convergence_duration_time="N/A"
 packets_and_frames.packet.3.size="2048"
-packets_and_frames.packet.3.pos="262904"
+packets_and_frames.packet.3.pos="263006"
 packets_and_frames.packet.3.flags="K"
 packets_and_frames.frame.3.media_type="audio"
 packets_and_frames.frame.3.key_frame=1
@@ -111,7 +111,7 @@ packets_and_frames.frame.3.pkt_dts=1024
 packets_and_frames.frame.3.pkt_dts_time="0.023220"
 packets_and_frames.frame.3.pkt_duration=1024
 packets_and_frames.frame.3.pkt_duration_time="0.023220"
-packets_and_frames.frame.3.pkt_pos="262904"
+packets_and_frames.frame.3.pkt_pos="263006"
 packets_and_frames.frame.3.sample_fmt="s16"
 packets_and_frames.frame.3.nb_samples=1024
 packets_and_frames.frame.3.channels=1
@@ -127,7 +127,7 @@ packets_and_frames.packet.4.duration_time="0.040000"
 packets_and_frames.packet.4.convergence_duration="N/A"
 packets_and_frames.packet.4.convergence_duration_time="N/A"
 packets_and_frames.packet.4.size="230400"
-packets_and_frames.packet.4.pos="264980"
+packets_and_frames.packet.4.pos="265082"
 packets_and_frames.packet.4.flags="K"
 packets_and_frames.frame.4.media_type="video"
 packets_and_frames.frame.4.key_frame=1
@@ -137,7 +137,7 @@ packets_and_frames.frame.4.pkt_dts=1
 packets_and_frames.frame.4.pkt_dts_time="0.040000"
 packets_and_frames.frame.4.pkt_duration=1
 packets_and_frames.frame.4.pkt_duration_time="0.040000"
-packets_and_frames.frame.4.pkt_pos="264980"
+packets_and_frames.frame.4.pkt_pos="265082"
 packets_and_frames.frame.4.width=320
 packets_and_frames.frame.4.height=240
 packets_and_frames.frame.4.pix_fmt="rgb24"
@@ -160,7 +160,7 @@ packets_and_frames.packet.5.duration_time="0.040000"
 packets_and_frames.packet.5.convergence_duration="N/A"
 packets_and_frames.packet.5.convergence_duration_time="N/A"
 packets_and_frames.packet.5.size="30000"
-packets_and_frames.packet.5.pos="495402"
+packets_and_frames.packet.5.pos="495504"
 packets_and_frames.packet.5.flags="K"
 packets_and_frames.frame.5.media_type="video"
 packets_and_frames.frame.5.key_frame=1
@@ -170,7 +170,7 @@ packets_and_frames.frame.5.pkt_dts=1
 packets_and_frames.frame.5.pkt_dts_time="0.040000"
 packets_and_frames.frame.5.pkt_duration=1
 packets_and_frames.frame.5.pkt_duration_time="0.040000"
-packets_and_frames.frame.5.pkt_pos="495402"
+packets_and_frames.frame.5.pkt_pos="495504"
 packets_and_frames.frame.5.width=100
 packets_and_frames.frame.5.height=100
 packets_and_frames.frame.5.pix_fmt="rgb24"
@@ -193,7 +193,7 @@ packets_and_frames.packet.6.duration_time="0.023220"
 packets_and_frames.packet.6.convergence_duration="N/A"
 packets_and_frames.packet.6.convergence_duration_time="N/A"
 packets_and_frames.packet.6.size="2048"
-packets_and_frames.packet.6.pos="525407"
+packets_and_frames.packet.6.pos="525509"
 packets_and_frames.packet.6.flags="K"
 packets_and_frames.frame.6.media_type="audio"
 packets_and_frames.frame.6.key_frame=1
@@ -203,7 +203,7 @@ packets_and_frames.frame.6.pkt_dts=2048
 packets_and_frames.frame.6.pkt_dts_time="0.046440"
 packets_and_frames.frame.6.pkt_duration=1024
 packets_and_frames.frame.6.pkt_duration_time="0.023220"
-packets_and_frames.frame.6.pkt_pos="525407"
+packets_and_frames.frame.6.pkt_pos="525509"
 packets_and_frames.frame.6.sample_fmt="s16"
 packets_and_frames.frame.6.nb_samples=1024
 packets_and_frames.frame.6.channels=1
@@ -219,7 +219,7 @@ packets_and_frames.packet.7.duration_time="0.023220"
 packets_and_frames.packet.7.convergence_duration="N/A"
 packets_and_frames.packet.7.convergence_duration_time="N/A"
 packets_and_frames.packet.7.size="2048"
-packets_and_frames.packet.7.pos="527478"
+packets_and_frames.packet.7.pos="527580"
 packets_and_frames.packet.7.flags="K"
 packets_and_frames.frame.7.media_type="audio"
 packets_and_frames.frame.7.key_frame=1
@@ -229,7 +229,7 @@ packets_and_frames.frame.7.pkt_dts=3072
 packets_and_frames.frame.7.pkt_dts_time="0.069660"
 packets_and_frames.frame.7.pkt_duration=1024
 packets_and_frames.frame.7.pkt_duration_time="0.023220"
-packets_and_frames.frame.7.pkt_pos="527478"
+packets_and_frames.frame.7.pkt_pos="527580"
 packets_and_frames.frame.7.sample_fmt="s16"
 packets_and_frames.frame.7.nb_samples=1024
 packets_and_frames.frame.7.channels=1
@@ -245,7 +245,7 @@ packets_and_frames.packet.8.duration_time="0.040000"
 packets_and_frames.packet.8.convergence_duration="N/A"
 packets_and_frames.packet.8.convergence_duration_time="N/A"
 packets_and_frames.packet.8.size="230400"
-packets_and_frames.packet.8.pos="529554"
+packets_and_frames.packet.8.pos="529656"
 packets_and_frames.packet.8.flags="K"
 packets_and_frames.frame.8.media_type="video"
 packets_and_frames.frame.8.key_frame=1
@@ -255,7 +255,7 @@ packets_and_frames.frame.8.pkt_dts=2
 packets_and_frames.frame.8.pkt_dts_time="0.080000"
 packets_and_frames.frame.8.pkt_duration=1
 packets_and_frames.frame.8.pkt_duration_time="0.040000"
-packets_and_frames.frame.8.pkt_pos="529554"
+packets_and_frames.frame.8.pkt_pos="529656"
 packets_and_frames.frame.8.width=320
 packets_and_frames.frame.8.height=240
 packets_and_frames.frame.8.pix_fmt="rgb24"
@@ -278,7 +278,7 @@ packets_and_frames.packet.9.duration_time="0.040000"
 packets_and_frames.packet.9.convergence_duration="N/A"
 packets_and_frames.packet.9.convergence_duration_time="N/A"
 packets_and_frames.packet.9.size="30000"
-packets_and_frames.packet.9.pos="759976"
+packets_and_frames.packet.9.pos="760078"
 packets_and_frames.packet.9.flags="K"
 packets_and_frames.frame.9.media_type="video"
 packets_and_frames.frame.9.key_frame=1
@@ -288,7 +288,7 @@ packets_and_frames.frame.9.pkt_dts=2
 packets_and_frames.frame.9.pkt_dts_time="0.080000"
 packets_and_frames.frame.9.pkt_duration=1
 packets_and_frames.frame.9.pkt_duration_time="0.040000"
-packets_and_frames.frame.9.pkt_pos="759976"
+packets_and_frames.frame.9.pkt_pos="760078"
 packets_and_frames.frame.9.width=100
 packets_and_frames.frame.9.height=100
 packets_and_frames.frame.9.pix_fmt="rgb24"
@@ -311,7 +311,7 @@ packets_and_frames.packet.10.duration_time="0.023220"
 packets_and_frames.packet.10.convergence_duration="N/A"
 packets_and_frames.packet.10.convergence_duration_time="N/A"
 packets_and_frames.packet.10.size="2048"
-packets_and_frames.packet.10.pos="789981"
+packets_and_frames.packet.10.pos="790083"
 packets_and_frames.packet.10.flags="K"
 packets_and_frames.frame.10.media_type="audio"
 packets_and_frames.frame.10.key_frame=1
@@ -321,7 +321,7 @@ packets_and_frames.frame.10.pkt_dts=4096
 packets_and_frames.frame.10.pkt_dts_time="0.092880"
 packets_and_frames.frame.10.pkt_duration=1024
 packets_and_frames.frame.10.pkt_duration_time="0.023220"
-packets_and_frames.frame.10.pkt_pos="789981"
+packets_and_frames.frame.10.pkt_pos="790083"
 packets_and_frames.frame.10.sample_fmt="s16"
 packets_and_frames.frame.10.nb_samples=1024
 packets_and_frames.frame.10.channels=1
@@ -337,7 +337,7 @@ packets_and_frames.packet.11.duration_time="0.023220"
 packets_and_frames.packet.11.convergence_duration="N/A"
 packets_and_frames.packet.11.convergence_duration_time="N/A"
 packets_and_frames.packet.11.size="2048"
-packets_and_frames.packet.11.pos="792052"
+packets_and_frames.packet.11.pos="792154"
 packets_and_frames.packet.11.flags="K"
 packets_and_frames.frame.11.media_type="audio"
 packets_and_frames.frame.11.key_frame=1
@@ -347,7 +347,7 @@ packets_and_frames.frame.11.pkt_dts=5120
 packets_and_frames.frame.11.pkt_dts_time="0.116100"
 packets_and_frames.frame.11.pkt_duration=1024
 packets_and_frames.frame.11.pkt_duration_time="0.023220"
-packets_and_frames.frame.11.pkt_pos="792052"
+packets_and_frames.frame.11.pkt_pos="792154"
 packets_and_frames.frame.11.sample_fmt="s16"
 packets_and_frames.frame.11.nb_samples=1024
 packets_and_frames.frame.11.channels=1
@@ -363,7 +363,7 @@ packets_and_frames.packet.12.duration_time="0.040000"
 packets_and_frames.packet.12.convergence_duration="N/A"
 packets_and_frames.packet.12.convergence_duration_time="N/A"
 packets_and_frames.packet.12.size="230400"
-packets_and_frames.packet.12.pos="794128"
+packets_and_frames.packet.12.pos="794230"
 packets_and_frames.packet.12.flags="K"
 packets_and_frames.frame.12.media_type="video"
 packets_and_frames.frame.12.key_frame=1
@@ -373,7 +373,7 @@ packets_and_frames.frame.12.pkt_dts=3
 packets_and_frames.frame.12.pkt_dts_time="0.120000"
 packets_and_frames.frame.12.pkt_duration=1
 packets_and_frames.frame.12.pkt_duration_time="0.040000"
-packets_and_frames.frame.12.pkt_pos="794128"
+packets_and_frames.frame.12.pkt_pos="794230"
 packets_and_frames.frame.12.width=320
 packets_and_frames.frame.12.height=240
 packets_and_frames.frame.12.pix_fmt="rgb24"
@@ -396,7 +396,7 @@ packets_and_frames.packet.13.duration_time="0.040000"
 packets_and_frames.packet.13.convergence_duration="N/A"
 packets_and_frames.packet.13.convergence_duration_time="N/A"
 packets_and_frames.packet.13.size="30000"
-packets_and_frames.packet.13.pos="1024550"
+packets_and_frames.packet.13.pos="1024652"
 packets_and_frames.packet.13.flags="K"
 packets_and_frames.frame.13.media_type="video"
 packets_and_frames.frame.13.key_frame=1
@@ -406,7 +406,7 @@ packets_and_frames.frame.13.pkt_dts=3
 packets_and_frames.frame.13.pkt_dts_time="0.120000"
 packets_and_frames.frame.13.pkt_duration=1
 packets_and_frames.frame.13.pkt_duration_time="0.040000"
-packets_and_frames.frame.13.pkt_pos="1024550"
+packets_and_frames.frame.13.pkt_pos="1024652"
 packets_and_frames.frame.13.width=100
 packets_and_frames.frame.13.height=100
 packets_and_frames.frame.13.pix_fmt="rgb24"
@@ -437,12 +437,13 @@ streams.stream.0.avg_frame_rate="0/0"
 streams.stream.0.time_base="1/44100"
 streams.stream.0.start_pts=0
 streams.stream.0.start_time="0.000000"
-streams.stream.0.duration_ts=527313
-streams.stream.0.duration="11.957211"
+streams.stream.0.duration_ts=527364
+streams.stream.0.duration="11.958367"
 streams.stream.0.bit_rate="705600"
 streams.stream.0.nb_frames="N/A"
 streams.stream.0.nb_read_frames="6"
 streams.stream.0.nb_read_packets="6"
+streams.stream.tags.E="MC2"
 streams.stream.1.index=1
 streams.stream.1.codec_name="rawvideo"
 streams.stream.1.profile="unknown"
@@ -473,6 +474,8 @@ streams.stream.1.bit_rate="N/A"
 streams.stream.1.nb_frames="N/A"
 streams.stream.1.nb_read_frames="4"
 streams.stream.1.nb_read_packets="4"
+streams.stream.tags.title="foobar"
+streams.stream.tags.duration_ts="field-and-tags-conflict-attempt"
 streams.stream.2.index=2
 streams.stream.2.codec_name="rawvideo"
 streams.stream.2.profile="unknown"
@@ -508,8 +511,8 @@ format.nb_streams=3
 format.format_name="nut"
 format.start_time="0.000000"
 format.duration="11.960000"
-format.size="1054625"
-format.bit_rate="705434"
+format.size="1054727"
+format.bit_rate="705503"
 format.tags.title="ffprobe test file"
 format.tags.comment="'A comment with CSV, XML & JSON special chars': <tag value=\"x\">"
 format.tags.comment2="I ♥ Üñîçød€"
diff --git a/tests/ref/fate/ffprobe_ini b/tests/ref/fate/ffprobe_ini
index 1c38659..fbfdfe6 100644
--- a/tests/ref/fate/ffprobe_ini
+++ b/tests/ref/fate/ffprobe_ini
@@ -12,7 +12,7 @@ duration_time=0.023220
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=2048
-pos=403
+pos=505
 flags=K
 
 [packets_and_frames.frame.0]
@@ -24,7 +24,7 @@ pkt_dts=0
 pkt_dts_time=0.000000
 pkt_duration=1024
 pkt_duration_time=0.023220
-pkt_pos=403
+pkt_pos=505
 sample_fmt=s16
 nb_samples=1024
 channels=1
@@ -42,7 +42,7 @@ duration_time=0.040000
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=230400
-pos=2478
+pos=2580
 flags=K
 
 [packets_and_frames.frame.1]
@@ -54,7 +54,7 @@ pkt_dts=0
 pkt_dts_time=0.000000
 pkt_duration=1
 pkt_duration_time=0.040000
-pkt_pos=2478
+pkt_pos=2580
 width=320
 height=240
 pix_fmt=rgb24
@@ -79,7 +79,7 @@ duration_time=0.040000
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=30000
-pos=232899
+pos=233001
 flags=K
 
 [packets_and_frames.frame.2]
@@ -91,7 +91,7 @@ pkt_dts=0
 pkt_dts_time=0.000000
 pkt_duration=1
 pkt_duration_time=0.040000
-pkt_pos=232899
+pkt_pos=233001
 width=100
 height=100
 pix_fmt=rgb24
@@ -116,7 +116,7 @@ duration_time=0.023220
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=2048
-pos=262904
+pos=263006
 flags=K
 
 [packets_and_frames.frame.3]
@@ -128,7 +128,7 @@ pkt_dts=1024
 pkt_dts_time=0.023220
 pkt_duration=1024
 pkt_duration_time=0.023220
-pkt_pos=262904
+pkt_pos=263006
 sample_fmt=s16
 nb_samples=1024
 channels=1
@@ -146,7 +146,7 @@ duration_time=0.040000
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=230400
-pos=264980
+pos=265082
 flags=K
 
 [packets_and_frames.frame.4]
@@ -158,7 +158,7 @@ pkt_dts=1
 pkt_dts_time=0.040000
 pkt_duration=1
 pkt_duration_time=0.040000
-pkt_pos=264980
+pkt_pos=265082
 width=320
 height=240
 pix_fmt=rgb24
@@ -183,7 +183,7 @@ duration_time=0.040000
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=30000
-pos=495402
+pos=495504
 flags=K
 
 [packets_and_frames.frame.5]
@@ -195,7 +195,7 @@ pkt_dts=1
 pkt_dts_time=0.040000
 pkt_duration=1
 pkt_duration_time=0.040000
-pkt_pos=495402
+pkt_pos=495504
 width=100
 height=100
 pix_fmt=rgb24
@@ -220,7 +220,7 @@ duration_time=0.023220
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=2048
-pos=525407
+pos=525509
 flags=K
 
 [packets_and_frames.frame.6]
@@ -232,7 +232,7 @@ pkt_dts=2048
 pkt_dts_time=0.046440
 pkt_duration=1024
 pkt_duration_time=0.023220
-pkt_pos=525407
+pkt_pos=525509
 sample_fmt=s16
 nb_samples=1024
 channels=1
@@ -250,7 +250,7 @@ duration_time=0.023220
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=2048
-pos=527478
+pos=527580
 flags=K
 
 [packets_and_frames.frame.7]
@@ -262,7 +262,7 @@ pkt_dts=3072
 pkt_dts_time=0.069660
 pkt_duration=1024
 pkt_duration_time=0.023220
-pkt_pos=527478
+pkt_pos=527580
 sample_fmt=s16
 nb_samples=1024
 channels=1
@@ -280,7 +280,7 @@ duration_time=0.040000
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=230400
-pos=529554
+pos=529656
 flags=K
 
 [packets_and_frames.frame.8]
@@ -292,7 +292,7 @@ pkt_dts=2
 pkt_dts_time=0.080000
 pkt_duration=1
 pkt_duration_time=0.040000
-pkt_pos=529554
+pkt_pos=529656
 width=320
 height=240
 pix_fmt=rgb24
@@ -317,7 +317,7 @@ duration_time=0.040000
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=30000
-pos=759976
+pos=760078
 flags=K
 
 [packets_and_frames.frame.9]
@@ -329,7 +329,7 @@ pkt_dts=2
 pkt_dts_time=0.080000
 pkt_duration=1
 pkt_duration_time=0.040000
-pkt_pos=759976
+pkt_pos=760078
 width=100
 height=100
 pix_fmt=rgb24
@@ -354,7 +354,7 @@ duration_time=0.023220
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=2048
-pos=789981
+pos=790083
 flags=K
 
 [packets_and_frames.frame.10]
@@ -366,7 +366,7 @@ pkt_dts=4096
 pkt_dts_time=0.092880
 pkt_duration=1024
 pkt_duration_time=0.023220
-pkt_pos=789981
+pkt_pos=790083
 sample_fmt=s16
 nb_samples=1024
 channels=1
@@ -384,7 +384,7 @@ duration_time=0.023220
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=2048
-pos=792052
+pos=792154
 flags=K
 
 [packets_and_frames.frame.11]
@@ -396,7 +396,7 @@ pkt_dts=5120
 pkt_dts_time=0.116100
 pkt_duration=1024
 pkt_duration_time=0.023220
-pkt_pos=792052
+pkt_pos=792154
 sample_fmt=s16
 nb_samples=1024
 channels=1
@@ -414,7 +414,7 @@ duration_time=0.040000
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=230400
-pos=794128
+pos=794230
 flags=K
 
 [packets_and_frames.frame.12]
@@ -426,7 +426,7 @@ pkt_dts=3
 pkt_dts_time=0.120000
 pkt_duration=1
 pkt_duration_time=0.040000
-pkt_pos=794128
+pkt_pos=794230
 width=320
 height=240
 pix_fmt=rgb24
@@ -451,7 +451,7 @@ duration_time=0.040000
 convergence_duration=N/A
 convergence_duration_time=N/A
 size=30000
-pos=1024550
+pos=1024652
 flags=K
 
 [packets_and_frames.frame.13]
@@ -463,7 +463,7 @@ pkt_dts=3
 pkt_dts_time=0.120000
 pkt_duration=1
 pkt_duration_time=0.040000
-pkt_pos=1024550
+pkt_pos=1024652
 width=100
 height=100
 pix_fmt=rgb24
@@ -496,13 +496,16 @@ avg_frame_rate=0/0
 time_base=1/44100
 start_pts=0
 start_time=0.000000
-duration_ts=527313
-duration=11.957211
+duration_ts=527364
+duration=11.958367
 bit_rate=705600
 nb_frames=N/A
 nb_read_frames=6
 nb_read_packets=6
 
+[streams.stream.tags]
+E=MC2
+
 [streams.stream.1]
 index=1
 codec_name=rawvideo
@@ -535,6 +538,10 @@ nb_frames=N/A
 nb_read_frames=4
 nb_read_packets=4
 
+[streams.stream.tags]
+title=foobar
+duration_ts=field-and-tags-conflict-attempt
+
 [streams.stream.2]
 index=2
 codec_name=rawvideo
@@ -573,8 +580,8 @@ nb_streams=3
 format_name=nut
 start_time=0.000000
 duration=11.960000
-size=1054625
-bit_rate=705434
+size=1054727
+bit_rate=705503
 
 [format.tags]
 title=ffprobe test file
diff --git a/tests/ref/fate/ffprobe_json b/tests/ref/fate/ffprobe_json
index 27b9cd2..93b5f28 100644
--- a/tests/ref/fate/ffprobe_json
+++ b/tests/ref/fate/ffprobe_json
@@ -11,7 +11,7 @@
             "duration": 1024,
             "duration_time": "0.023220",
             "size": "2048",
-            "pos": "403",
+            "pos": "505",
             "flags": "K"
         },
         {
@@ -24,7 +24,7 @@
             "pkt_dts_time": "0.000000",
             "pkt_duration": 1024,
             "pkt_duration_time": "0.023220",
-            "pkt_pos": "403",
+            "pkt_pos": "505",
             "sample_fmt": "s16",
             "nb_samples": 1024,
             "channels": 1
@@ -40,7 +40,7 @@
             "duration": 1,
             "duration_time": "0.040000",
             "size": "230400",
-            "pos": "2478",
+            "pos": "2580",
             "flags": "K"
         },
         {
@@ -53,7 +53,7 @@
             "pkt_dts_time": "0.000000",
             "pkt_duration": 1,
             "pkt_duration_time": "0.040000",
-            "pkt_pos": "2478",
+            "pkt_pos": "2580",
             "width": 320,
             "height": 240,
             "pix_fmt": "rgb24",
@@ -77,7 +77,7 @@
             "duration": 1,
             "duration_time": "0.040000",
             "size": "30000",
-            "pos": "232899",
+            "pos": "233001",
             "flags": "K"
         },
         {
@@ -90,7 +90,7 @@
             "pkt_dts_time": "0.000000",
             "pkt_duration": 1,
             "pkt_duration_time": "0.040000",
-            "pkt_pos": "232899",
+            "pkt_pos": "233001",
             "width": 100,
             "height": 100,
             "pix_fmt": "rgb24",
@@ -114,7 +114,7 @@
             "duration": 1024,
             "duration_time": "0.023220",
             "size": "2048",
-            "pos": "262904",
+            "pos": "263006",
             "flags": "K"
         },
         {
@@ -127,7 +127,7 @@
             "pkt_dts_time": "0.023220",
             "pkt_duration": 1024,
             "pkt_duration_time": "0.023220",
-            "pkt_pos": "262904",
+            "pkt_pos": "263006",
             "sample_fmt": "s16",
             "nb_samples": 1024,
             "channels": 1
@@ -143,7 +143,7 @@
             "duration": 1,
             "duration_time": "0.040000",
             "size": "230400",
-            "pos": "264980",
+            "pos": "265082",
             "flags": "K"
         },
         {
@@ -156,7 +156,7 @@
             "pkt_dts_time": "0.040000",
             "pkt_duration": 1,
             "pkt_duration_time": "0.040000",
-            "pkt_pos": "264980",
+            "pkt_pos": "265082",
             "width": 320,
             "height": 240,
             "pix_fmt": "rgb24",
@@ -180,7 +180,7 @@
             "duration": 1,
             "duration_time": "0.040000",
             "size": "30000",
-            "pos": "495402",
+            "pos": "495504",
             "flags": "K"
         },
         {
@@ -193,7 +193,7 @@
             "pkt_dts_time": "0.040000",
             "pkt_duration": 1,
             "pkt_duration_time": "0.040000",
-            "pkt_pos": "495402",
+            "pkt_pos": "495504",
             "width": 100,
             "height": 100,
             "pix_fmt": "rgb24",
@@ -217,7 +217,7 @@
             "duration": 1024,
             "duration_time": "0.023220",
             "size": "2048",
-            "pos": "525407",
+            "pos": "525509",
             "flags": "K"
         },
         {
@@ -230,7 +230,7 @@
             "pkt_dts_time": "0.046440",
             "pkt_duration": 1024,
             "pkt_duration_time": "0.023220",
-            "pkt_pos": "525407",
+            "pkt_pos": "525509",
             "sample_fmt": "s16",
             "nb_samples": 1024,
             "channels": 1
@@ -246,7 +246,7 @@
             "duration": 1024,
             "duration_time": "0.023220",
             "size": "2048",
-            "pos": "527478",
+            "pos": "527580",
             "flags": "K"
         },
         {
@@ -259,7 +259,7 @@
             "pkt_dts_time": "0.069660",
             "pkt_duration": 1024,
             "pkt_duration_time": "0.023220",
-            "pkt_pos": "527478",
+            "pkt_pos": "527580",
             "sample_fmt": "s16",
             "nb_samples": 1024,
             "channels": 1
@@ -275,7 +275,7 @@
             "duration": 1,
             "duration_time": "0.040000",
             "size": "230400",
-            "pos": "529554",
+            "pos": "529656",
             "flags": "K"
         },
         {
@@ -288,7 +288,7 @@
             "pkt_dts_time": "0.080000",
             "pkt_duration": 1,
             "pkt_duration_time": "0.040000",
-            "pkt_pos": "529554",
+            "pkt_pos": "529656",
             "width": 320,
             "height": 240,
             "pix_fmt": "rgb24",
@@ -312,7 +312,7 @@
             "duration": 1,
             "duration_time": "0.040000",
             "size": "30000",
-            "pos": "759976",
+            "pos": "760078",
             "flags": "K"
         },
         {
@@ -325,7 +325,7 @@
             "pkt_dts_time": "0.080000",
             "pkt_duration": 1,
             "pkt_duration_time": "0.040000",
-            "pkt_pos": "759976",
+            "pkt_pos": "760078",
             "width": 100,
             "height": 100,
             "pix_fmt": "rgb24",
@@ -349,7 +349,7 @@
             "duration": 1024,
             "duration_time": "0.023220",
             "size": "2048",
-            "pos": "789981",
+            "pos": "790083",
             "flags": "K"
         },
         {
@@ -362,7 +362,7 @@
             "pkt_dts_time": "0.092880",
             "pkt_duration": 1024,
             "pkt_duration_time": "0.023220",
-            "pkt_pos": "789981",
+            "pkt_pos": "790083",
             "sample_fmt": "s16",
             "nb_samples": 1024,
             "channels": 1
@@ -378,7 +378,7 @@
             "duration": 1024,
             "duration_time": "0.023220",
             "size": "2048",
-            "pos": "792052",
+            "pos": "792154",
             "flags": "K"
         },
         {
@@ -391,7 +391,7 @@
             "pkt_dts_time": "0.116100",
             "pkt_duration": 1024,
             "pkt_duration_time": "0.023220",
-            "pkt_pos": "792052",
+            "pkt_pos": "792154",
             "sample_fmt": "s16",
             "nb_samples": 1024,
             "channels": 1
@@ -407,7 +407,7 @@
             "duration": 1,
             "duration_time": "0.040000",
             "size": "230400",
-            "pos": "794128",
+            "pos": "794230",
             "flags": "K"
         },
         {
@@ -420,7 +420,7 @@
             "pkt_dts_time": "0.120000",
             "pkt_duration": 1,
             "pkt_duration_time": "0.040000",
-            "pkt_pos": "794128",
+            "pkt_pos": "794230",
             "width": 320,
             "height": 240,
             "pix_fmt": "rgb24",
@@ -444,7 +444,7 @@
             "duration": 1,
             "duration_time": "0.040000",
             "size": "30000",
-            "pos": "1024550",
+            "pos": "1024652",
             "flags": "K"
         },
         {
@@ -457,7 +457,7 @@
             "pkt_dts_time": "0.120000",
             "pkt_duration": 1,
             "pkt_duration_time": "0.040000",
-            "pkt_pos": "1024550",
+            "pkt_pos": "1024652",
             "width": 100,
             "height": 100,
             "pix_fmt": "rgb24",
@@ -490,11 +490,14 @@
             "time_base": "1/44100",
             "start_pts": 0,
             "start_time": "0.000000",
-            "duration_ts": 527313,
-            "duration": "11.957211",
+            "duration_ts": 527364,
+            "duration": "11.958367",
             "bit_rate": "705600",
             "nb_read_frames": "6",
-            "nb_read_packets": "6"
+            "nb_read_packets": "6",
+            "tags": {
+                "E": "MC2"
+            }
         },
         {
             "index": 1,
@@ -521,7 +524,11 @@
             "duration_ts": 299,
             "duration": "11.960000",
             "nb_read_frames": "4",
-            "nb_read_packets": "4"
+            "nb_read_packets": "4",
+            "tags": {
+                "title": "foobar",
+                "duration_ts": "field-and-tags-conflict-attempt"
+            }
         },
         {
             "index": 2,
@@ -557,8 +564,8 @@
         "format_name": "nut",
         "start_time": "0.000000",
         "duration": "11.960000",
-        "size": "1054625",
-        "bit_rate": "705434",
+        "size": "1054727",
+        "bit_rate": "705503",
         "tags": {
             "title": "ffprobe test file",
             "comment": "'A comment with CSV, XML & JSON special chars': <tag value=\"x\">",
diff --git a/tests/ref/fate/ffprobe_xml b/tests/ref/fate/ffprobe_xml
index 6237664..130fcf7 100644
--- a/tests/ref/fate/ffprobe_xml
+++ b/tests/ref/fate/ffprobe_xml
@@ -1,43 +1,48 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ffprobe>
     <packets_and_frames>
-        <packet codec_type="audio" stream_index="0" pts="0" pts_time="0.000000" dts="0" dts_time="0.000000" duration="1024" duration_time="0.023220" size="2048" pos="403" flags="K"/>
-        <frame media_type="audio" key_frame="1" pkt_pts="0" pkt_pts_time="0.000000" pkt_dts="0" pkt_dts_time="0.000000" pkt_duration="1024" pkt_duration_time="0.023220" pkt_pos="403" sample_fmt="s16" nb_samples="1024" channels="1"/>
-        <packet codec_type="video" stream_index="1" pts="0" pts_time="0.000000" dts="0" dts_time="0.000000" duration="1" duration_time="0.040000" size="230400" pos="2478" flags="K"/>
-        <frame media_type="video" key_frame="1" pkt_pts="0" pkt_pts_time="0.000000" pkt_dts="0" pkt_dts_time="0.000000" pkt_duration="1" pkt_duration_time="0.040000" pkt_pos="2478" width="320" height="240" pix_fmt="rgb24" 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" reference="0"/>
-        <packet codec_type="video" stream_index="2" pts="0" pts_time="0.000000" dts="0" dts_time="0.000000" duration="1" duration_time="0.040000" size="30000" pos="232899" flags="K"/>
-        <frame media_type="video" key_frame="1" pkt_pts="0" pkt_pts_time="0.000000" pkt_dts="0" pkt_dts_time="0.000000" pkt_duration="1" pkt_duration_time="0.040000" pkt_pos="232899" width="100" height="100" pix_fmt="rgb24" 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" reference="0"/>
-        <packet codec_type="audio" stream_index="0" pts="1024" pts_time="0.023220" dts="1024" dts_time="0.023220" duration="1024" duration_time="0.023220" size="2048" pos="262904" flags="K"/>
-        <frame media_type="audio" key_frame="1" pkt_pts="1024" pkt_pts_time="0.023220" pkt_dts="1024" pkt_dts_time="0.023220" pkt_duration="1024" pkt_duration_time="0.023220" pkt_pos="262904" sample_fmt="s16" nb_samples="1024" channels="1"/>
-        <packet codec_type="video" stream_index="1" pts="1" pts_time="0.040000" dts="1" dts_time="0.040000" duration="1" duration_time="0.040000" size="230400" pos="264980" flags="K"/>
-        <frame media_type="video" key_frame="1" pkt_pts="1" pkt_pts_time="0.040000" pkt_dts="1" pkt_dts_time="0.040000" pkt_duration="1" pkt_duration_time="0.040000" pkt_pos="264980" width="320" height="240" pix_fmt="rgb24" 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" reference="0"/>
-        <packet codec_type="video" stream_index="2" pts="1" pts_time="0.040000" dts="1" dts_time="0.040000" duration="1" duration_time="0.040000" size="30000" pos="495402" flags="K"/>
-        <frame media_type="video" key_frame="1" pkt_pts="1" pkt_pts_time="0.040000" pkt_dts="1" pkt_dts_time="0.040000" pkt_duration="1" pkt_duration_time="0.040000" pkt_pos="495402" width="100" height="100" pix_fmt="rgb24" 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" reference="0"/>
-        <packet codec_type="audio" stream_index="0" pts="2048" pts_time="0.046440" dts="2048" dts_time="0.046440" duration="1024" duration_time="0.023220" size="2048" pos="525407" flags="K"/>
-        <frame media_type="audio" key_frame="1" pkt_pts="2048" pkt_pts_time="0.046440" pkt_dts="2048" pkt_dts_time="0.046440" pkt_duration="1024" pkt_duration_time="0.023220" pkt_pos="525407" sample_fmt="s16" nb_samples="1024" channels="1"/>
-        <packet codec_type="audio" stream_index="0" pts="3072" pts_time="0.069660" dts="3072" dts_time="0.069660" duration="1024" duration_time="0.023220" size="2048" pos="527478" flags="K"/>
-        <frame media_type="audio" key_frame="1" pkt_pts="3072" pkt_pts_time="0.069660" pkt_dts="3072" pkt_dts_time="0.069660" pkt_duration="1024" pkt_duration_time="0.023220" pkt_pos="527478" sample_fmt="s16" nb_samples="1024" channels="1"/>
-        <packet codec_type="video" stream_index="1" pts="2" pts_time="0.080000" dts="2" dts_time="0.080000" duration="1" duration_time="0.040000" size="230400" pos="529554" flags="K"/>
-        <frame media_type="video" key_frame="1" pkt_pts="2" pkt_pts_time="0.080000" pkt_dts="2" pkt_dts_time="0.080000" pkt_duration="1" pkt_duration_time="0.040000" pkt_pos="529554" width="320" height="240" pix_fmt="rgb24" 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" reference="0"/>
-        <packet codec_type="video" stream_index="2" pts="2" pts_time="0.080000" dts="2" dts_time="0.080000" duration="1" duration_time="0.040000" size="30000" pos="759976" flags="K"/>
-        <frame media_type="video" key_frame="1" pkt_pts="2" pkt_pts_time="0.080000" pkt_dts="2" pkt_dts_time="0.080000" pkt_duration="1" pkt_duration_time="0.040000" pkt_pos="759976" width="100" height="100" pix_fmt="rgb24" 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" reference="0"/>
-        <packet codec_type="audio" stream_index="0" pts="4096" pts_time="0.092880" dts="4096" dts_time="0.092880" duration="1024" duration_time="0.023220" size="2048" pos="789981" flags="K"/>
-        <frame media_type="audio" key_frame="1" pkt_pts="4096" pkt_pts_time="0.092880" pkt_dts="4096" pkt_dts_time="0.092880" pkt_duration="1024" pkt_duration_time="0.023220" pkt_pos="789981" sample_fmt="s16" nb_samples="1024" channels="1"/>
-        <packet codec_type="audio" stream_index="0" pts="5120" pts_time="0.116100" dts="5120" dts_time="0.116100" duration="1024" duration_time="0.023220" size="2048" pos="792052" flags="K"/>
-        <frame media_type="audio" key_frame="1" pkt_pts="5120" pkt_pts_time="0.116100" pkt_dts="5120" pkt_dts_time="0.116100" pkt_duration="1024" pkt_duration_time="0.023220" pkt_pos="792052" sample_fmt="s16" nb_samples="1024" channels="1"/>
-        <packet codec_type="video" stream_index="1" pts="3" pts_time="0.120000" dts="3" dts_time="0.120000" duration="1" duration_time="0.040000" size="230400" pos="794128" flags="K"/>
-        <frame media_type="video" key_frame="1" pkt_pts="3" pkt_pts_time="0.120000" pkt_dts="3" pkt_dts_time="0.120000" pkt_duration="1" pkt_duration_time="0.040000" pkt_pos="794128" width="320" height="240" pix_fmt="rgb24" 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" reference="0"/>
-        <packet codec_type="video" stream_index="2" pts="3" pts_time="0.120000" dts="3" dts_time="0.120000" duration="1" duration_time="0.040000" size="30000" pos="1024550" flags="K"/>
-        <frame media_type="video" key_frame="1" pkt_pts="3" pkt_pts_time="0.120000" pkt_dts="3" pkt_dts_time="0.120000" pkt_duration="1" pkt_duration_time="0.040000" pkt_pos="1024550" width="100" height="100" pix_fmt="rgb24" 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" reference="0"/>
+        <packet codec_type="audio" stream_index="0" pts="0" pts_time="0.000000" dts="0" dts_time="0.000000" duration="1024" duration_time="0.023220" size="2048" pos="505" flags="K"/>
+        <frame media_type="audio" key_frame="1" pkt_pts="0" pkt_pts_time="0.000000" pkt_dts="0" pkt_dts_time="0.000000" pkt_duration="1024" pkt_duration_time="0.023220" pkt_pos="505" sample_fmt="s16" nb_samples="1024" channels="1"/>
+        <packet codec_type="video" stream_index="1" pts="0" pts_time="0.000000" dts="0" dts_time="0.000000" duration="1" duration_time="0.040000" size="230400" pos="2580" flags="K"/>
+        <frame media_type="video" key_frame="1" pkt_pts="0" pkt_pts_time="0.000000" pkt_dts="0" pkt_dts_time="0.000000" pkt_duration="1" pkt_duration_time="0.040000" pkt_pos="2580" width="320" height="240" pix_fmt="rgb24" 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" reference="0"/>
+        <packet codec_type="video" stream_index="2" pts="0" pts_time="0.000000" dts="0" dts_time="0.000000" duration="1" duration_time="0.040000" size="30000" pos="233001" flags="K"/>
+        <frame media_type="video" key_frame="1" pkt_pts="0" pkt_pts_time="0.000000" pkt_dts="0" pkt_dts_time="0.000000" pkt_duration="1" pkt_duration_time="0.040000" pkt_pos="233001" width="100" height="100" pix_fmt="rgb24" 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" reference="0"/>
+        <packet codec_type="audio" stream_index="0" pts="1024" pts_time="0.023220" dts="1024" dts_time="0.023220" duration="1024" duration_time="0.023220" size="2048" pos="263006" flags="K"/>
+        <frame media_type="audio" key_frame="1" pkt_pts="1024" pkt_pts_time="0.023220" pkt_dts="1024" pkt_dts_time="0.023220" pkt_duration="1024" pkt_duration_time="0.023220" pkt_pos="263006" sample_fmt="s16" nb_samples="1024" channels="1"/>
+        <packet codec_type="video" stream_index="1" pts="1" pts_time="0.040000" dts="1" dts_time="0.040000" duration="1" duration_time="0.040000" size="230400" pos="265082" flags="K"/>
+        <frame media_type="video" key_frame="1" pkt_pts="1" pkt_pts_time="0.040000" pkt_dts="1" pkt_dts_time="0.040000" pkt_duration="1" pkt_duration_time="0.040000" pkt_pos="265082" width="320" height="240" pix_fmt="rgb24" 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" reference="0"/>
+        <packet codec_type="video" stream_index="2" pts="1" pts_time="0.040000" dts="1" dts_time="0.040000" duration="1" duration_time="0.040000" size="30000" pos="495504" flags="K"/>
+        <frame media_type="video" key_frame="1" pkt_pts="1" pkt_pts_time="0.040000" pkt_dts="1" pkt_dts_time="0.040000" pkt_duration="1" pkt_duration_time="0.040000" pkt_pos="495504" width="100" height="100" pix_fmt="rgb24" 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" reference="0"/>
+        <packet codec_type="audio" stream_index="0" pts="2048" pts_time="0.046440" dts="2048" dts_time="0.046440" duration="1024" duration_time="0.023220" size="2048" pos="525509" flags="K"/>
+        <frame media_type="audio" key_frame="1" pkt_pts="2048" pkt_pts_time="0.046440" pkt_dts="2048" pkt_dts_time="0.046440" pkt_duration="1024" pkt_duration_time="0.023220" pkt_pos="525509" sample_fmt="s16" nb_samples="1024" channels="1"/>
+        <packet codec_type="audio" stream_index="0" pts="3072" pts_time="0.069660" dts="3072" dts_time="0.069660" duration="1024" duration_time="0.023220" size="2048" pos="527580" flags="K"/>
+        <frame media_type="audio" key_frame="1" pkt_pts="3072" pkt_pts_time="0.069660" pkt_dts="3072" pkt_dts_time="0.069660" pkt_duration="1024" pkt_duration_time="0.023220" pkt_pos="527580" sample_fmt="s16" nb_samples="1024" channels="1"/>
+        <packet codec_type="video" stream_index="1" pts="2" pts_time="0.080000" dts="2" dts_time="0.080000" duration="1" duration_time="0.040000" size="230400" pos="529656" flags="K"/>
+        <frame media_type="video" key_frame="1" pkt_pts="2" pkt_pts_time="0.080000" pkt_dts="2" pkt_dts_time="0.080000" pkt_duration="1" pkt_duration_time="0.040000" pkt_pos="529656" width="320" height="240" pix_fmt="rgb24" 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" reference="0"/>
+        <packet codec_type="video" stream_index="2" pts="2" pts_time="0.080000" dts="2" dts_time="0.080000" duration="1" duration_time="0.040000" size="30000" pos="760078" flags="K"/>
+        <frame media_type="video" key_frame="1" pkt_pts="2" pkt_pts_time="0.080000" pkt_dts="2" pkt_dts_time="0.080000" pkt_duration="1" pkt_duration_time="0.040000" pkt_pos="760078" width="100" height="100" pix_fmt="rgb24" 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" reference="0"/>
+        <packet codec_type="audio" stream_index="0" pts="4096" pts_time="0.092880" dts="4096" dts_time="0.092880" duration="1024" duration_time="0.023220" size="2048" pos="790083" flags="K"/>
+        <frame media_type="audio" key_frame="1" pkt_pts="4096" pkt_pts_time="0.092880" pkt_dts="4096" pkt_dts_time="0.092880" pkt_duration="1024" pkt_duration_time="0.023220" pkt_pos="790083" sample_fmt="s16" nb_samples="1024" channels="1"/>
+        <packet codec_type="audio" stream_index="0" pts="5120" pts_time="0.116100" dts="5120" dts_time="0.116100" duration="1024" duration_time="0.023220" size="2048" pos="792154" flags="K"/>
+        <frame media_type="audio" key_frame="1" pkt_pts="5120" pkt_pts_time="0.116100" pkt_dts="5120" pkt_dts_time="0.116100" pkt_duration="1024" pkt_duration_time="0.023220" pkt_pos="792154" sample_fmt="s16" nb_samples="1024" channels="1"/>
+        <packet codec_type="video" stream_index="1" pts="3" pts_time="0.120000" dts="3" dts_time="0.120000" duration="1" duration_time="0.040000" size="230400" pos="794230" flags="K"/>
+        <frame media_type="video" key_frame="1" pkt_pts="3" pkt_pts_time="0.120000" pkt_dts="3" pkt_dts_time="0.120000" pkt_duration="1" pkt_duration_time="0.040000" pkt_pos="794230" width="320" height="240" pix_fmt="rgb24" 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" reference="0"/>
+        <packet codec_type="video" stream_index="2" pts="3" pts_time="0.120000" dts="3" dts_time="0.120000" duration="1" duration_time="0.040000" size="30000" pos="1024652" flags="K"/>
+        <frame media_type="video" key_frame="1" pkt_pts="3" pkt_pts_time="0.120000" pkt_dts="3" pkt_dts_time="0.120000" pkt_duration="1" pkt_duration_time="0.040000" pkt_pos="1024652" width="100" height="100" pix_fmt="rgb24" 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" reference="0"/>
     </packets_and_frames>
 
     <streams>
-        <stream index="0" codec_name="pcm_s16le" codec_type="audio" codec_time_base="1/44100" codec_tag_string="[1][0][0][0]" codec_tag="0x0001" default="0" forced="0" sample_fmt="s16" sample_rate="44100" channels="1" bits_per_sample="16" r_frame_rate="0/0" avg_frame_rate="0/0" time_base="1/44100" start_pts="0" start_time="0.000000" duration_ts="527313" duration="11.957211" bit_rate="705600" nb_read_frames="6" nb_read_packets="6"/>
-        <stream index="1" codec_name="rawvideo" codec_type="video" codec_time_base="1/25" codec_tag_string="RGB[24]" codec_tag="0x18424752" default="0" forced="0" width="320" height="240" has_b_frames="0" sample_aspect_ratio="1:1" display_aspect_ratio="4:3" pix_fmt="rgb24" level="-99" attached_pic="0" r_frame_rate="25/1" avg_frame_rate="0/0" time_base="1/25" start_pts="0" start_time="0.000000" duration_ts="299" duration="11.960000" nb_read_frames="4" nb_read_packets="4"/>
+        <stream index="0" codec_name="pcm_s16le" codec_type="audio" codec_time_base="1/44100" codec_tag_string="[1][0][0][0]" codec_tag="0x0001" default="0" forced="0" sample_fmt="s16" sample_rate="44100" channels="1" bits_per_sample="16" r_frame_rate="0/0" avg_frame_rate="0/0" time_base="1/44100" start_pts="0" start_time="0.000000" duration_ts="527364" duration="11.958367" bit_rate="705600" nb_read_frames="6" nb_read_packets="6">
+            <tag key="E" value="MC2"/>
+        </stream>
+        <stream index="1" codec_name="rawvideo" codec_type="video" codec_time_base="1/25" codec_tag_string="RGB[24]" codec_tag="0x18424752" default="0" forced="0" width="320" height="240" has_b_frames="0" sample_aspect_ratio="1:1" display_aspect_ratio="4:3" pix_fmt="rgb24" level="-99" attached_pic="0" r_frame_rate="25/1" avg_frame_rate="0/0" time_base="1/25" start_pts="0" start_time="0.000000" duration_ts="299" duration="11.960000" nb_read_frames="4" nb_read_packets="4">
+            <tag key="title" value="foobar"/>
+            <tag key="duration_ts" value="field-and-tags-conflict-attempt"/>
+        </stream>
         <stream index="2" codec_name="rawvideo" codec_type="video" codec_time_base="1/25" codec_tag_string="RGB[24]" codec_tag="0x18424752" default="0" forced="0" width="100" height="100" has_b_frames="0" sample_aspect_ratio="1:1" display_aspect_ratio="1:1" pix_fmt="rgb24" level="-99" attached_pic="0" r_frame_rate="25/1" avg_frame_rate="0/0" time_base="1/25" start_pts="0" start_time="0.000000" duration_ts="299" duration="11.960000" nb_read_frames="4" nb_read_packets="4"/>
     </streams>
 
-    <format filename="tests/data/ffprobe-test.nut" nb_streams="3" format_name="nut" start_time="0.000000" duration="11.960000" size="1054625" bit_rate="705434">
+    <format filename="tests/data/ffprobe-test.nut" nb_streams="3" format_name="nut" start_time="0.000000" duration="11.960000" size="1054727" bit_rate="705503">
         <tag key="title" value="ffprobe test file"/>
         <tag key="comment" value="'A comment with CSV, XML & JSON special chars': <tag value="x">"/>
         <tag key="comment2" value="I ♥ Üñîçød€"/>
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list