Skip to content

Use ffprobe to gather metadata #3

@CGillen

Description

@CGillen

Turns out, ffprobe can gather metadata on shoutcast v1, v2, and icecast streams in a semi-similar pattern. We should use ffprobe -i <url> -show_entries format_tags -of default=noprint_wrappers=1 -show_streams -v error

This is what we get from an icecast server:

> ffprobe -i <url> -show_entries format_tags -of default=noprint_wrappers=1 -show_streams -v error

index=0
codec_name=vorbis
codec_long_name=Vorbis
profile=unknown
codec_type=audio
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
sample_fmt=fltp
sample_rate=48000
channels=2
channel_layout=stereo
bits_per_sample=0
initial_padding=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/48000
start_pts=7945600
start_time=165.533333
duration_ts=N/A
duration=N/A
bit_rate=320000
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
extradata_size=4010
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
DISPOSITION:non_diegetic=0
DISPOSITION:captions=0
DISPOSITION:descriptions=0
DISPOSITION:metadata=0
DISPOSITION:dependent=0
DISPOSITION:still_image=0
TAG:title=<artist> - <title>
TAG:server=Icecast 2.4.4
TAG:icy-br=320
TAG:icy-description=Server description
TAG:icy-genre=Genre
TAG:icy-name=Station Title
TAG:icy-pub=0

Do some checks for how Shoutcast v1/v2 formats it's output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions