Opened 17 months ago

Last modified 17 months ago

#8680 new defect

FFprobe produces invalid JSON

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

Description

Summary of the bug:
How to reproduce:

% ffprobe -print_format json -count_frames -select_streams v:0 -show_entries frame=pkt_pts_time:tags -f lavfi "movie='file.mp4',select='gt(scene,0.0)'"

ffprobe version N-97836-g050b72ab5e Copyright (c) 2007-2020 the FFmpeg developers
  built with Apple clang version 11.0.3 (clang-1103.0.32.29)
  configuration: 
  libavutil      56. 46.100 / 56. 46.100
  libavcodec     58. 86.100 / 58. 86.100
  libavformat    58. 43.100 / 58. 43.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 82.100 /  7. 82.100
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
{
Input #0, lavfi, from 'movie='file.mp4',select='gt(scene,0.0)'':
  Duration: N/A, start: 0.016683, bitrate: N/A
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 59.94 fps, 59.94 tbr, 19001 tbn, 19001 tbc
    "packets_and_frames": [
        {
            "type": "packet"            "tags": {
                "lavfi.scene_score": "0.065193"
            },
            "side_data_list": [
                {

                }
            ]
        },
[...  Truncated for the bugreport ...]

The "type": "packet" "tags": { is not valid JSON.

Change History (1)

comment:1 by ePirat, 17 months ago

Sorry, the description got lost:

Under certain circumstances ffprobe can produce invalid JSON output when its asked to only include specific tags and there are additional frame tags. Specifically the -show_entries frame=pkt_pts_time:tags is what causes the problem, using frame_tags instead of just tags works around the issue.

Note: See TracTickets for help on using tickets.