[FFmpeg-trac] #8228(ffprobe:new): ffprobe -show_entries side_data creates invalid JSON
FFmpeg
trac at avcodec.org
Tue Oct 8 04:32:35 EEST 2019
#8228: ffprobe -show_entries side_data creates invalid JSON
-------------------------------------+-------------------------------------
Reporter: Loomes | Type: defect
Status: new | Priority: important
Component: ffprobe | Version: 4.2
Keywords: ffrpobe, | Blocked By:
JSON, side_data |
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
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.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/8228>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list