Opened 2 years ago

Closed 2 years ago

#8228 closed defect (fixed)

ffprobe -show_entries side_data creates invalid JSON

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

Description

Summary of the bug: I tried to get a JSON from ffprobe to get sidedata information from several video files, but it seems the generated JSON ist malformed and therefore not convenient for further processing. My command:

ffprobe -read_intervals %+#2 -select_streams v:0 -show_frames -show_entries side_data "source.mkv" -print_format json -of json > "source_sidedata.json"

ffmpeg version: ffmpeg-20191004-e6625ca-win64-static <http://ffmpeg.zeranoe.com/builds/>
The resulting JSON files always looks like

{
    "packets_and_frames": [
        {
            "type": "packet",

        },
        {
            "type": "packet",

        },
        {
            "type": "frame",
            "media_type": "audio",
            "stream_index": 1,
            "key_frame": 1,
            "pkt_pts": 171,
            "pkt_pts_time": "0.171000",
            "pkt_dts": 171,
            "pkt_dts_time": "0.171000",
            "best_effort_timestamp": 171,
            "best_effort_timestamp_time": "0.171000",
            "pkt_duration": 21,
            "pkt_duration_time": "0.021000",
            "pkt_pos": "313258",
            "pkt_size": "1522",
            "sample_fmt": "fltp",
            "nb_samples": 1024,
            "channels": 6,
            "channel_layout": "5.1"
        },
[...]

Obviously the problem is the comma which is always set after the last line ""type": "packet" in the "packets_and_frames" section. ffprobe usually gives me proper JSON files but the comma problem appears when "-show_entries side_data" is used.

Change History (1)

comment:1 by James, 2 years ago

Analyzed by developer: set
Keywords: ffrpobe JSON side_data removed
Priority: importantnormal
Reproduced by developer: set
Resolution: fixed
Status: newclosed
Version: 4.2git-master
Note: See TracTickets for help on using tickets.