ffmpeg -hide_banner -loglevel error

This is alluded to in a comment below the current answer.

The option -hide_banner was introduced in late 2013 -- https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2013-December/152349.html )

-loglevel warning leads to more output than the error level (but less than the default info level) as it shows all warning messages.

-loglevel panic is the least verbose output (omitting even error messages) but is undocumented.

The official -loglevel documentation can be found in the ffmpeg Documentation under Generic options, subsection -loglevel [flags+]loglevel | -v [flags+]loglevel.

Answer from Hugues on Stack Exchange
Top answer
1 of 6
16

set loglevel to quiet

ffmpeg.input(file).output(filename, loglevel="quiet").run()
2 of 6
5

It has been 1 year and 8 months since you have asked this question, you might already have a solution for that. However, I found a solution to solve your problem.

You can solve this problem by modifying the original ffmpeg code when you package your python program.

First, find your ffmpeg lib folder, if you install with the default location, you can check your libs here: C:\Users\User\AppData\Local\Programs\Python\Python310\Lib\site-packages\ffmpeg.

Second, find _probe.py and modify codes, here is the code that already got modified, any change is written in the comments. You need to Popen add args: shell=True, stdin=subprocess.PIPE.

import json
import subprocess
from ._run import Error
from ._utils import convert_kwargs_to_cmd_line_args


def probe(filename, cmd='ffprobe', **kwargs):
    """Run ffprobe on the specified file and return a JSON representation of the output.

    Raises:
        :class:`ffmpeg.Error`: if ffprobe returns a non-zero exit code,
        an :class:`Error` is returned with a generic error message.
        The stderr output can be retrieved by accessing the
        ``stderr`` property of the exception.
    """
    args = [cmd, '-show_format', '-show_streams', '-of', 'json']
    args += convert_kwargs_to_cmd_line_args(kwargs)
    args += [filename]

    # Original: p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    # Popen add args: shell=True, stdin=subprocess.PIPE,

    p = subprocess.Popen(args, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    out, err = p.communicate()
    if p.returncode != 0:
        raise Error('ffprobe', out, err)
    return json.loads(out.decode('utf-8'))


__all__ = ['probe']

Then, go to _run.py. You need to add shell=True, modify stdin=subprocess.PIPE or modify pipe_stdin=True (The code section below is just a part of the code):

@output_operator()
def run_async(
    stream_spec,
    cmd='ffmpeg',
    pipe_stdin=False,
    pipe_stdout=False,
    pipe_stderr=False,
    quiet=False,
    overwrite_output=False,
):
    """Asynchronously invoke ffmpeg for the supplied node graph.

Args:
    pipe_stdin: if True, connect pipe to subprocess stdin (to be
        used with ``pipe:`` ffmpeg inputs).
    pipe_stdout: if True, connect pipe to subprocess stdout (to be
        used with ``pipe:`` ffmpeg outputs).
    pipe_stderr: if True, connect pipe to subprocess stderr.
    quiet: shorthand for setting ``capture_stdout`` and
        ``capture_stderr``.
    **kwargs: keyword-arguments passed to ``get_args()`` (e.g.
        ``overwrite_output=True``).

Returns:
    A `subprocess Popen`_ object representing the child process.

Examples:
    Run and stream input::

        process = (
            ffmpeg
            .input('pipe:', format='rawvideo', pix_fmt='rgb24', s='{}x{}'.format(width, height))
            .output(out_filename, pix_fmt='yuv420p')
            .overwrite_output()
            .run_async(pipe_stdin=True)
        )
        process.communicate(input=input_data)

    Run and capture output::

        process = (
            ffmpeg
            .input(in_filename)
            .output('pipe':, format='rawvideo', pix_fmt='rgb24')
            .run_async(pipe_stdout=True, pipe_stderr=True)
        )
        out, err = process.communicate()

    Process video frame-by-frame using numpy::

        process1 = (
            ffmpeg
            .input(in_filename)
            .output('pipe:', format='rawvideo', pix_fmt='rgb24')
            .run_async(pipe_stdout=True)
        )

        process2 = (
            ffmpeg
            .input('pipe:', format='rawvideo', pix_fmt='rgb24', s='{}x{}'.format(width, height))
            .output(out_filename, pix_fmt='yuv420p')
            .overwrite_output()
            .run_async(pipe_stdin=True)
        )

        while True:
            in_bytes = process1.stdout.read(width * height * 3)
            if not in_bytes:
                break
            in_frame = (
                np
                .frombuffer(in_bytes, np.uint8)
                .reshape([height, width, 3])
            )
            out_frame = in_frame * 0.3
            process2.stdin.write(
                frame
                .astype(np.uint8)
                .tobytes()
            )

        process2.stdin.close()
        process1.wait()
        process2.wait()

.. _subprocess Popen: https://docs.python.org/3/library/subprocess.html#popen-objects
"""
    args = compile(stream_spec, cmd, overwrite_output=overwrite_output)
    stdin_stream = subprocess.PIPE if pipe_stdin else None
    stdout_stream = subprocess.PIPE if pipe_stdout or quiet else None
    stderr_stream = subprocess.PIPE if pipe_stderr or quiet else None

    # Original: return subprocess.Popen(
    #           args, stdin=pipe_stdin, stdout=stdout_stream, stderr=stderr_stream)    
    # Add shell=True, modify stdin=subprocess.PIPE or modify pipe_stdin=True

    return subprocess.Popen(
        args, shell=True, stdin=subprocess.PIPE, stdout=stdout_stream, stderr=stderr_stream
    )
Discussions

Mute console output
Hello, I am slightly confused, is there a way to disable the FFMPEG console output? Sorry if I missed it in the docs. More on github.com
🌐 github.com
1
June 27, 2019
Add a way to pass arbitrary arguments to ffmpeg.run()
I'd like to pass -loglevel quiet to ffmpeg.run. More on github.com
🌐 github.com
15
September 20, 2017
python - Disable output in subprocess call ffmpeg - Stack Overflow
I am currently using the following command in python to convert my .webm file to .ogg subprocess.call(['ffmpeg', '-i', songfile, songfile + ".ogg"]) This prints out a bunch of output whi... More on stackoverflow.com
🌐 stackoverflow.com
July 16, 2021
windows - Interpreting ffmpeg output in Python - Stack Overflow
I started working in FFmpeg and I want to create a list that will contain start and end timestamps of silence intervals. I did print out these intervals using the FFmpeg but I need to format that o... More on stackoverflow.com
🌐 stackoverflow.com
🌐
GitHub
github.com › kkroening › ffmpeg-python › blob › master › examples › split_silence.py
ffmpeg-python/examples/split_silence.py at master · kkroening/ffmpeg-python
Python bindings for FFmpeg - with complex filtering support - ffmpeg-python/examples/split_silence.py at master · kkroening/ffmpeg-python
Author   kkroening
🌐
DEV Community
dev.to › dak425 › automatically-trim-silence-from-video-with-ffmpeg-and-python-2kol
Automatically trim silence from video with ffmpeg and python - DEV Community
January 31, 2021 - Use that text file in a python script that sections out the parts of the video with audio, and save the new version with the silence removed · Now, with the process laid out, lets look at the scripts doing the heavy lifting. Here is the script for generating the silence timestamp data: #!/usr/bin/env sh IN=$1 THRESH=$2 DURATION=$3 ffmpeg -hide_banner -vn -i $IN -af "silencedetect=n=${THRESH}dB:d=${DURATION}" -f null - 2>&1 | grep "silence_end" | awk '{print $5 " " $8}' > silence.txt
🌐
GitHub
github.com › kkroening › ffmpeg-python › issues › 223
Mute console output · Issue #223 · kkroening/ffmpeg-python
June 27, 2019 - kkroening / ffmpeg-python Public · Notifications · You must be signed in to change notification settings · Fork 936 · Star 10.9k · New issueCopy link · New issueCopy link · Closed · Closed · Mute console output#223 · Copy link · 1ghost1 · opened · on Jun 27, 2019 ·
Author   1ghost1
🌐
DevelopersIO
dev.classmethod.jp › en › articles › split-audio-at-silence-python-ffmpeg-claude-code
I created a Python script with Claude Code to automatically split audio files at silent intervals | DevelopersIO
4 days ago - #!/usr/bin/env python3 """CLI tool to segment audio files at silent intervals. Dependencies: ffmpeg / ffprobe (must be in PATH) """ import argparse import csv import re import subprocess from dataclasses import dataclass from pathlib import Path SILENCE_RE = re.compile(r"silence_end:\s*([\d.]+)\s*\|\s*silence_duration:\s*([\d.]+)") @dataclass(frozen=True) class Silence: """Detected silence interval.""" start: float end: float duration: float @dataclass(frozen=True) class Content: """Content interval between Silence and Silence.""" start: float end: float @dataclass(frozen=True) class Segment:
🌐
DEV Community
dev.to › dak425 › a-update-to-my-automated-silence-trimming-script-1d4d
An update to my automated silence trimming script - DEV Community
June 27, 2021 - #!/usr/bin/env python # Import the necessary libraries and modules import sys import subprocess import os from moviepy.editor import VideoFileClip, concatenate_videoclips # Read the command-line arguments input_path = sys.argv[1] out_path = sys.argv[2] threshold = sys.argv[3] duration = sys.argv[4] # Read the optional fifth command-line argument try: ease = float(sys.argv[5]) # If the fifth argument is not provided, use a default value except IndexError: ease = 0.2 # Set the minimum duration of a clip minimum_duration = 1.0 # Define a function to generate a list of timestamps for silence perio
🌐
FFmpeg Python
kkroening.github.io › ffmpeg-python
ffmpeg-python: Python bindings for FFmpeg — ffmpeg-python documentation
The .audio and .video operators can be used to reference the audio/video portions of a stream so that they can be processed separately and then re-combined later in the pipeline. This dilemma is intrinsic to ffmpeg, and ffmpeg-python tries to stay out of the way while users may refer to the official ffmpeg documentation as to why certain filters drop audio.
Find elsewhere
🌐
GitHub
github.com › kkroening › ffmpeg-python › issues › 30
Add a way to pass arbitrary arguments to ffmpeg.run() · Issue #30 · kkroening/ffmpeg-python
September 20, 2017 - I've used ffmpeg.run(stream, cmd=['ffmpeg', '-loglevel', 'quiet']) as a workaround, but it looks like GlobalNode is very restricted.
Author   elelayan
🌐
PyPI
pypi.org › project › audio-silence-marks
audio-silence-marks · PyPI
Creates a list of "silences" timecodes in audio files using FFmpeg and its filter silencedetect.
      » pip install audio-silence-marks
    
Published   Dec 09, 2021
Version   0.1.3
🌐
Donald Feury
donaldfeury.xyz › remove-the-silent-parts-of-a-video-using-ffmpeg-and-python
Remove the Silent Parts of a Video Using FFmpeg and Python
September 6, 2021 - Use FFmpeg filter silencedetect filter to generate an output of sections of the video's audio with silence · Next, we pipe that output through a few programs to get the output in the format that I want ...
🌐
GitHub
github.com › kkroening › ffmpeg-python › issues › 515
Run FFmpeg silently · Issue #515 · kkroening/ffmpeg-python
March 22, 2021 - When using Python ffmpeg it is often nice to run it silently without any stdout to the terminal. Solution: Add flag that supports silent runtime
Author   caniko
🌐
YouTube
youtube.com › watch
How to remove the silent parts of a video using ffmpeg and python - YouTube
🎨 Artist/Thumbnail Creator: https://jawhaj.art📝 Blog: https://donaldfeury.xyz/topics👥Memberships: https://vod.strms.net/j/UCTHij3Ac5GizLsn5yB4IX_Q Moviep...
Published   May 8, 2020
🌐
GitHub
github.com › kkroening › ffmpeg-python › issues › 195
quiet mode for run_async method might cause ffmpeg process to stick. · Issue #195 · kkroening/ffmpeg-python
April 19, 2019 - But I found that setting the parameter "quiet" of the encoder process to True (which set both stdout and stderr to PIPE) will cause the ffmpeg process to stick at some stage ( and in this case, I cannot write anything into its stdin).
Author   ArchieMeng
🌐
Medium
onkar-patil.medium.com › how-to-remove-silence-from-an-audio-using-python-50fd2c00557d
How to Remove Silence from an Audio using Python | by Onkar Patil | Medium
June 30, 2022 - # Silence detect ffmpeg -i silence.mp3 -af silencedetect=n=-50dB:d=5 -f null -# This will detect silence having noise threshold less than 50db and # silent duration of 5 sec# Silence Remove ffmpeg -i silence.mp3 -af silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-90dB -f null - To run this command in python and to get the desired output out of it, I wrote below function.
🌐
FFmpeg
ffmpeg.org › ffmpeg.html
ffmpeg Documentation
3 weeks ago - Show nothing at all; be silent.