LinuxCommandLibrary

gst-discoverer-1.0

Analyze media file format and metadata

TLDR

Print file metadata

$ gst-discoverer-1.0 [path/to/file]
copy

SYNOPSIS

gst-discoverer-1.0 [OPTIONS] URI

PARAMETERS

URI
    The path or URL to the media file or stream to analyze. This can be a local file path (e.g., file:///path/to/media.mp4), a network URI (e.g., http://example.com/stream.mp3), or other GStreamer-supported URIs.

-v, --verbose
    Displays more detailed and verbose information about the discovery process and the media properties. This can include GStreamer debug messages related to the discovery.

-a, --async
    Performs the media discovery process asynchronously. This means the command will return immediately, potentially allowing for non-blocking operations in scripts, though the output might not be directly available without further integration.

-c N, --timeout=N
    Sets a timeout for the discovery process in seconds. If the discovery does not complete within this time, the command will exit, preventing indefinite hangs on problematic or very large media sources.

-s, --simulate-tags
    Simulates the extraction of tags. This might be useful for testing tag parsing without needing the full media data, or for cases where actual tag extraction is slow or problematic.

-i N, --indent=N
    Indents the output by N spaces, improving readability for nested information structures.

--disable-color
    Disables colored output, which can be useful when redirecting output to files or in terminals that do not support ANSI color codes.

DESCRIPTION

gst-discoverer-1.0 is a command-line utility provided by the GStreamer multimedia framework. Its primary purpose is to inspect and extract detailed information about media files or URIs (Uniform Resource Identifiers). When invoked with a specific media source, it analyzes the content and provides a comprehensive report, including details such as the overall duration, container format, and information about each individual stream (e.g., audio, video, subtitle).

For each stream, it typically lists the codec, resolution (for video), sample rate (for audio), bitrate, language, and other relevant properties. Additionally, it can display embedded metadata tags like title, artist, album, genre, and more. This tool is invaluable for developers, system administrators, and users who need to debug multimedia issues, verify media file properties, or understand the underlying structure and codecs of a media asset without playing it. It leverages GStreamer's powerful plugin architecture to support a wide array of media formats and codecs.

CAVEATS

GStreamer Dependency: gst-discoverer-1.0 requires a working GStreamer 1.x installation with the necessary base plugins. Without appropriate plugins (e.g., for MP4, WebM, or specific codecs), it may fail to discover or fully analyze certain media formats.

Network Connectivity: When analyzing network URIs (e.g., http://, rtmp://), stable network connectivity is essential. Timeout settings (-c) can help manage slow or unresponsive network sources.

Resource Usage: Analyzing very large media files or streams can consume significant CPU and memory resources, especially with verbose output enabled.

Partial Files: If the media file is incomplete or corrupted, the tool might only be able to extract partial information or report errors.

<I>COMMON OUTPUT INFORMATION</I>

The output of gst-discoverer-1.0 typically includes:

Duration: The total length of the media.
Seekable: Whether the media can be randomly accessed (seeking).
Live: Indicates if it's a live stream.
Container Format: The overall wrapper format (e.g., MP4, Matroska, Ogg).
Streams: A list of all elementary streams (e.g., audio, video, text). For each stream, details like codec (e.g., H.264, AAC), resolution, frame rate, sample rate, bitrate, language, and stream ID are provided.
Tags: Embedded metadata like title, artist, album, genre, date, and sometimes cover art details.

<I>EXAMPLE USAGE</I>

To inspect a local video file:
gst-discoverer-1.0 file:///home/user/myvideo.mp4

To inspect a network audio stream with verbose output and a timeout:
gst-discoverer-1.0 -v -c 30 http://example.com/radio.mp3

To analyze a file in the current directory:
gst-discoverer-1.0 myaudio.ogg (Note: Relative paths work directly, file:// is optional for local files).

HISTORY

gst-discoverer-1.0 is an integral part of the GStreamer 1.0 series, which was released after the long-standing GStreamer 0.10 series. The 1.0 branch introduced a more stable API, improved thread safety, and significant performance enhancements compared to its predecessor. The discoverer concept itself existed in earlier forms within GStreamer, but gst-discoverer-1.0 provides a refined and robust standalone utility for media analysis, leveraging the modern GStreamer 1.x API for comprehensive and reliable media introspection. Its development mirrors the continuous evolution of the GStreamer framework to meet the growing demands of modern multimedia applications.

SEE ALSO

Copied to clipboard