While using ffmpeg.ffprobe, and if you want json output, the output is like this:
Error: unable to open display { . . [response object] . . }
Response object is the json object returned by ffprobe, which is ok. But the first error is not. It ruins the output and also causes command executer to exit with error.
Must prints only the output, without any extra info.
Error: unable to open display
{
"streams": [
{
"index": 0,
"codec_name": "hevc",
"codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)",
"profile": "Main 10",
"codec_type": "video",
"codec_time_base": "1001/24000",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"width": 1280,
"height": 536,
"coded_width": 1280,
"coded_height": 536,
"closed_captions": 0,
"has_b_frames": 2,
"sample_aspect_ratio": "1:1",
"display_aspect_ratio": "160:67",
"pix_fmt": "yuv420p10le",
"level": 93,
"color_range": "tv",
"color_space": "bt709",
"color_transfer": "bt709",
"color_primaries": "bt709",
"refs": 1,
"r_frame_rate": "24000/1001",
"avg_frame_rate": "24000/1001",
"time_base": "1/1000",
"start_pts": 0,
"start_time": "0.000000",
"disposition": {
"default": 1,
"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
},
"tags": {
"BPS": "409206",
"NUMBER_OF_FRAMES": "252960",
"NUMBER_OF_BYTES": "539668202",
"_STATISTICS_WRITING_APP": "mkvmerge v67.0.0 ('Under Stars') 64-bit",
"_STATISTICS_WRITING_DATE_UTC": "2022-04-17 22:08:37",
"_STATISTICS_TAGS": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES",
"DURATION": "02:55:50.539000000"
}
},
{
"index": 1,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"profile": "HE-AAC",
"codec_type": "audio",
"codec_time_base": "1/48000",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 6,
"channel_layout": "5.1",
"bits_per_sample": 0,
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/1000",
"start_pts": 23,
"start_time": "0.023000",
"disposition": {
"default": 1,
"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
},
"tags": {
"language": "eng",
"BPS": "214070",
"NUMBER_OF_FRAMES": "247275",
"NUMBER_OF_BYTES": "282316302",
"_STATISTICS_WRITING_APP": "mkvmerge v67.0.0 ('Under Stars') 64-bit",
"_STATISTICS_WRITING_DATE_UTC": "2022-04-17 22:08:37",
"_STATISTICS_TAGS": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES",
"DURATION": "02:55:50.422000000"
}
},
{
"index": 2,
"codec_name": "subrip",
"codec_long_name": "SubRip subtitle",
"codec_type": "subtitle",
"codec_time_base": "0/1",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/1000",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 10553328,
"duration": "10553.328000",
"disposition": {
"default": 1,
"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
},
"tags": {
"language": "eng",
"BPS": "53",
"NUMBER_OF_FRAMES": "2573",
"NUMBER_OF_BYTES": "71095",
"_STATISTICS_WRITING_APP": "mkvmerge v67.0.0 ('Under Stars') 64-bit",
"_STATISTICS_WRITING_DATE_UTC": "2022-04-17 22:08:37",
"_STATISTICS_TAGS": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES",
"DURATION": "02:55:53.328000000"
}
}
],
"format": {
"filename": "/root/iostreamer-client/storage/media/movie/12.mkv",
"nb_streams": 3,
"nb_programs": 0,
"format_name": "matroska,webm",
"format_long_name": "Matroska / WebM",
"start_time": "0.000000",
"duration": "10553.328000",
"size": "825766928",
"bit_rate": "625976",
"probe_score": 100,
"tags": {
"title": "PSArips.com | The.Batman.2022.INTERNAL.720p.10bit.WEBRip.6CH.x265.HEVC-PSA",
"ENCODER": "Lavf58.45.100"
}
}
}
What happened?
While using ffmpeg.ffprobe, and if you want json output, the output is like this:
Error: unable to open display { . . [response object] . . }Response object is the json object returned by ffprobe, which is ok. But the first error is not. It ruins the output and also causes command executer to exit with error.
And this is the full command
ffmpeg.ffprobe -v quiet -print_format json -show_format -show_streams test.mkvWhat should have happened?
Must prints only the output, without any extra info.
Output of
snap info $snap_nameOutput of
snap connections $snap_nameOutput of
snap versionRelevant log output
No response
Teminal output of app
Error: unable to open display { "streams": [ { "index": 0, "codec_name": "hevc", "codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)", "profile": "Main 10", "codec_type": "video", "codec_time_base": "1001/24000", "codec_tag_string": "[0][0][0][0]", "codec_tag": "0x0000", "width": 1280, "height": 536, "coded_width": 1280, "coded_height": 536, "closed_captions": 0, "has_b_frames": 2, "sample_aspect_ratio": "1:1", "display_aspect_ratio": "160:67", "pix_fmt": "yuv420p10le", "level": 93, "color_range": "tv", "color_space": "bt709", "color_transfer": "bt709", "color_primaries": "bt709", "refs": 1, "r_frame_rate": "24000/1001", "avg_frame_rate": "24000/1001", "time_base": "1/1000", "start_pts": 0, "start_time": "0.000000", "disposition": { "default": 1, "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 }, "tags": { "BPS": "409206", "NUMBER_OF_FRAMES": "252960", "NUMBER_OF_BYTES": "539668202", "_STATISTICS_WRITING_APP": "mkvmerge v67.0.0 ('Under Stars') 64-bit", "_STATISTICS_WRITING_DATE_UTC": "2022-04-17 22:08:37", "_STATISTICS_TAGS": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", "DURATION": "02:55:50.539000000" } }, { "index": 1, "codec_name": "aac", "codec_long_name": "AAC (Advanced Audio Coding)", "profile": "HE-AAC", "codec_type": "audio", "codec_time_base": "1/48000", "codec_tag_string": "[0][0][0][0]", "codec_tag": "0x0000", "sample_fmt": "fltp", "sample_rate": "48000", "channels": 6, "channel_layout": "5.1", "bits_per_sample": 0, "r_frame_rate": "0/0", "avg_frame_rate": "0/0", "time_base": "1/1000", "start_pts": 23, "start_time": "0.023000", "disposition": { "default": 1, "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 }, "tags": { "language": "eng", "BPS": "214070", "NUMBER_OF_FRAMES": "247275", "NUMBER_OF_BYTES": "282316302", "_STATISTICS_WRITING_APP": "mkvmerge v67.0.0 ('Under Stars') 64-bit", "_STATISTICS_WRITING_DATE_UTC": "2022-04-17 22:08:37", "_STATISTICS_TAGS": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", "DURATION": "02:55:50.422000000" } }, { "index": 2, "codec_name": "subrip", "codec_long_name": "SubRip subtitle", "codec_type": "subtitle", "codec_time_base": "0/1", "codec_tag_string": "[0][0][0][0]", "codec_tag": "0x0000", "r_frame_rate": "0/0", "avg_frame_rate": "0/0", "time_base": "1/1000", "start_pts": 0, "start_time": "0.000000", "duration_ts": 10553328, "duration": "10553.328000", "disposition": { "default": 1, "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 }, "tags": { "language": "eng", "BPS": "53", "NUMBER_OF_FRAMES": "2573", "NUMBER_OF_BYTES": "71095", "_STATISTICS_WRITING_APP": "mkvmerge v67.0.0 ('Under Stars') 64-bit", "_STATISTICS_WRITING_DATE_UTC": "2022-04-17 22:08:37", "_STATISTICS_TAGS": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", "DURATION": "02:55:53.328000000" } } ], "format": { "filename": "/root/iostreamer-client/storage/media/movie/12.mkv", "nb_streams": 3, "nb_programs": 0, "format_name": "matroska,webm", "format_long_name": "Matroska / WebM", "start_time": "0.000000", "duration": "10553.328000", "size": "825766928", "bit_rate": "625976", "probe_score": 100, "tags": { "title": "PSArips.com | The.Batman.2022.INTERNAL.720p.10bit.WEBRip.6CH.x265.HEVC-PSA", "ENCODER": "Lavf58.45.100" } } }