Opened 7 months ago

Closed 7 months ago

#10613 closed defect (fixed)

ffprobe outputs invalid xml

Reported by: nuro Owned by:
Priority: normal Component: ffprobe
Version: git-master Keywords:
Cc: nuro Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by nuro)

Summary of the bug:

Because of recent change https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/d2d3a83ad932161a2c572416d7ddfe460a15bba5,
ffprobe outputs invalid xml. (null)

<?xml version="1.0" encoding="UTF-8"?>
<ffprobe>
    <streams>
        <stream index="0" codec_name="mpeg1video" codec_long_name="MPEG-1 video" codec_type="video" codec_tag_string="[0][0][0][0]" codec_tag="0x0000" width="320" height="240" coded_width="0" coded_height="0" closed_captions="0" film_grain="0" has_b_frames="1" sample_aspect_ratio="49:33" display_aspect_ratio="196:99" pix_fmt="yuv420p" level="-99" color_range="tv" chroma_location="center" field_order="progressive" refs="1" r_frame_rate="60/1" avg_frame_rate="25/1" time_base="1/1200000" duration_ts="35563887" duration="29.636572" bit_rate="1638400" extradata_size="12">
            <disposition default="0" dub="0" original="0" comment="0" lyrics="0" karaoke="0" forced="0" hearing_impaired="0" visual_impaired="0" clean_effects="0" attached_pic="0" timed_thumbnails="0" captions="0" descriptions="0" metadata="0" dependent="0" still_image="0"/>
            <side_data_list>
                <(null) key="side_data_type" value="CPB properties"/>
 max_bitrate="0" min_bitrate="0" avg_bitrate="0" buffer_size="327680" vbv_delay="-1"            </side_data_list>
        </stream>
    </streams>

    <format filename="C:\nostartinfo.mpeg" nb_streams="1" nb_programs="0" format_name="mpegvideo" format_long_name="raw MPEG video" duration="29.636573" size="6069570" bit_rate="1638399" probe_score="51"/>
</ffprobe>

How to reproduce:

% ffprobe -show_streams -show_format -print_format xml -v quiet nostartinfo.mpeg

Attachments (1)

0001-ffprobe-fix-side_data-int-rendering.patch (4.8 KB ) - added by Stefano Sabatini 7 months ago.

Download all attachments as: .zip

Change History (8)

comment:1 by nuro, 7 months ago

Description: modified (diff)

comment:2 by nuro, 7 months ago

Version: unspecifiedgit-master

comment:3 by nuro, 7 months ago

Component: undeterminedffprobe

by Stefano Sabatini, 7 months ago

comment:4 by Stefano Sabatini, 7 months ago

I'm able to reproduce, attaching a provisional patch.

If you can test it would be helpful.

Note that this (together with the other "fix" which "broke" it) fixes a long-standing issue with the rendering of side data, as variable fields elements cannot contain fields with arbitrary names or that would break the schema.

New output looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<ffprobe>
    <streams>
        <stream index="0" codec_name="mpeg1video" codec_long_name="MPEG-1 video" codec_type="video" codec_tag_string="[0][0][0][0]" codec_tag="0x0000" width="320" height="240" coded_width="0" coded_height="0" closed_captions="0" film_grain="0" has_b_frames="1" sample_aspect_ratio="1:1" display_aspect_ratio="4:3" pix_fmt="yuv420p" level="-99" color_range="tv" chroma_location="center" field_order="progressive" refs="1" id="0x1e0" r_frame_rate="60000/1001" avg_frame_rate="30000/1001" time_base="1/90000" start_pts="48003" start_time="0.533367" duration_ts="719218" duration="7.991311" bit_rate="104857200" extradata_size="12">
            <disposition default="0" dub="0" original="0" comment="0" lyrics="0" karaoke="0" forced="0" hearing_impaired="0" visual_impaired="0" clean_effects="0" attached_pic="0" timed_thumbnails="0" captions="0" descriptions="0" metadata="0" dependent="0" still_image="0"/>
            <side_data_list>
                <datum key="side_data_type" value="CPB properties"/>
                <datum key="max_bitrate" value="0"/>
                <datum key="min_bitrate" value="0"/>
                <datum key="avg_bitrate" value="0"/>
                <datum key="buffer_size" value="49152"/>
                <datum key="vbv_delay" value="-1"/>
            </side_data_list>
        </stream>
        <stream index="1" codec_name="mp2" codec_long_name="MP2 (MPEG audio layer 2)" codec_type="audio" codec_tag_string="[0][0][0][0]" codec_tag="0x0000" sample_fmt="s16p" sample_rate="22050" channels="1" channel_layout="mono" bits_per_sample="0" initial_padding="0" id="0x1c0" r_frame_rate="0/0" avg_frame_rate="0/0" time_base="1/90000" start_pts="46040" start_time="0.511556" duration_ts="272755" duration="3.030611" bit_rate="160000">
            <disposition default="0" dub="0" original="0" comment="0" lyrics="0" karaoke="0" forced="0" hearing_impaired="0" visual_impaired="0" clean_effects="0" attached_pic="0" timed_thumbnails="0" captions="0" descriptions="0" metadata="0" dependent="0" still_image="0"/>
        </stream>
    </streams>

    <format filename="slow.disc.mpeg" nb_streams="2" nb_programs="0" format_name="mpeg" format_long_name="MPEG-PS (MPEG-2 Program Stream)" start_time="0.511556" duration="8.013122" size="256000" bit_rate="255580" probe_score="26"/>
</ffprobe>

Thanks for the report.

comment:5 by nuro, 7 months ago

This is what it looked like before the breaking change.

<?xml version="1.0" encoding="UTF-8"?>
<ffprobe>
    <streams>
        <stream index="0" codec_name="mpeg1video" codec_long_name="MPEG-1 video" codec_type="video" codec_tag_string="[0][0][0][0]" codec_tag="0x0000" width="320" height="240" coded_width="0" coded_height="0" closed_captions="0" film_grain="0" has_b_frames="1" sample_aspect_ratio="49:33" display_aspect_ratio="196:99" pix_fmt="yuv420p" level="-99" color_range="tv" chroma_location="center" refs="1" r_frame_rate="60/1" avg_frame_rate="25/1" time_base="1/1200000" duration_ts="35563887" duration="29.636572" bit_rate="1638400" extradata_size="12">
            <disposition default="0" dub="0" original="0" comment="0" lyrics="0" karaoke="0" forced="0" hearing_impaired="0" visual_impaired="0" clean_effects="0" attached_pic="0" timed_thumbnails="0" captions="0" descriptions="0" metadata="0" dependent="0" still_image="0"/>
            <side_data_list>
                <side_data side_data_type="CPB properties" max_bitrate="0" min_bitrate="0" avg_bitrate="0" buffer_size="327680" vbv_delay="-1"/>
            </side_data_list>
        </stream>
    </streams>

    <format filename="C:\nostartinfo.mpeg" nb_streams="1" nb_programs="0" format_name="mpegvideo" format_long_name="raw MPEG video" duration="29.636573" size="6069570" bit_rate="1638399" probe_score="51"/>
</ffprobe>

This is what it looks like after applying the patch

<?xml version="1.0" encoding="UTF-8"?>
<ffprobe>
    <streams>
        <stream index="0" codec_name="mpeg1video" codec_long_name="MPEG-1 video" codec_type="video" codec_tag_string="[0][0][0][0]" codec_tag="0x0000" width="320" height="240" coded_width="0" coded_height="0" closed_captions="0" film_grain="0" has_b_frames="1" sample_aspect_ratio="49:33" display_aspect_ratio="196:99" pix_fmt="yuv420p" level="-99" color_range="tv" chroma_location="center" field_order="progressive" refs="1" r_frame_rate="60/1" avg_frame_rate="25/1" time_base="1/1200000" duration_ts="35563887" duration="29.636572" bit_rate="1638400" extradata_size="12">
            <disposition default="0" dub="0" original="0" comment="0" lyrics="0" karaoke="0" forced="0" hearing_impaired="0" visual_impaired="0" clean_effects="0" attached_pic="0" timed_thumbnails="0" captions="0" descriptions="0" metadata="0" dependent="0" still_image="0"/>
            <side_data_list>
                <datum key="side_data_type" value="CPB properties"/>
                <datum key="max_bitrate" value="0"/>
                <datum key="min_bitrate" value="0"/>
                <datum key="avg_bitrate" value="0"/>
                <datum key="buffer_size" value="327680"/>
                <datum key="vbv_delay" value="-1"/>
            </side_data_list>
        </stream>
    </streams>

    <format filename="C:\nostartinfo.mpeg" nb_streams="1" nb_programs="0" format_name="mpegvideo" format_long_name="raw MPEG video" duration="29.636573" size="6069570" bit_rate="1638399" probe_score="51"/>
</ffprobe>

Thanks a lot for your contributions!

comment:6 by Stefano Sabatini, 7 months ago

Fixed in commit 2b0973dedb257f971d29.

Thanks for the report!

comment:7 by Stefano Sabatini, 7 months ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.