Opened 4 years ago

Closed 23 months ago

#8680 closed defect (fixed)

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 (2)

comment:1 by ePirat, 4 years 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.

comment:2 by Marton Balint, 23 months ago

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