snapcrafters / ffmpeg

Record, convert, and stream audio and video
9 stars 11 forks source link

[Bug]: ffmpeg.ffprobe throws error along side with the result #76

Open leobgm opened 2 years ago

leobgm commented 2 years ago

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.mkv

What should have happened?

Must prints only the output, without any extra info.

Output of snap info $snap_name

name:      ffmpeg
summary:   A complete solution to record, convert and stream audio and video.
publisher: Snapcrafters
store-url: https://snapcraft.io/ffmpeg
contact:   https://github.com/snapcrafters/ffmpeg/issues
license:   unset
description: |
  FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream,
  filter and play pretty much anything that humans and machines have created. It supports the most
  obscure ancient formats up to the cutting edge. No matter if they were designed by some standards
  committee, the community or a corporation.

  This snap is maintained by the Snapcrafters community, and is not necessarily endorsed or
  officially maintained by the upstream developers.
commands:
  - ffmpeg
  - ffmpeg.ffplay
  - ffmpeg.ffprobe
snap-id:      Ee7LGphwQR669pcfCCdl0oJQouta69to
tracking:     latest/stable
refresh-date: today at 04:53 UTC
channels:
  latest/stable:    4.3.1                2020-11-08 (1286)  83MB -
  latest/candidate: ↑                                            
  latest/beta:      ↑                                            
  latest/edge:      n4.4.1-2-gcc33e73618 2021-12-20 (1334) 160MB -
installed:          4.3.1                           (1286)  83MB -

Output of snap connections $snap_name

Interface         Plug                     Slot             Notes
alsa              ffmpeg:alsa              -                -
audio-playback    ffmpeg:audio-playback    :audio-playback  -
audio-record      ffmpeg:audio-record      -                -
camera            ffmpeg:camera            -                -
desktop           ffmpeg:desktop           :desktop         -
hardware-observe  ffmpeg:hardware-observe  -                -
home              ffmpeg:home              :home            -
network           ffmpeg:network           :network         -
network-bind      ffmpeg:network-bind      :network-bind    -
opengl            ffmpeg:opengl            :opengl          -
optical-drive     ffmpeg:optical-drive     :optical-drive   -
pulseaudio        ffmpeg:pulseaudio        :pulseaudio      -
removable-media   ffmpeg:removable-media   -                -
wayland           ffmpeg:wayland           :wayland         -
x11               ffmpeg:x11               :x11             -

Output of snap version

snap    2.55.3
snapd   2.55.3
series  16
ubuntu  20.04
kernel  5.4.0-100-generic

Relevant 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"
        }
    }
}
makeitcount commented 10 months ago

@leobgm did you figure out a solution to this problem? I am also facing the same issue