Recherche avancée

Médias (17)

Mot : - Tags -/wired

Autres articles (49)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

Sur d’autres sites (7660)

  • How to dump ALL metadata from a media file, including cover image title ? [closed]

    9 avril, par Unideal

    I have an MP3 song :

    


    # ffprobe -hide_banner -i filename.mp3
Input #0, mp3, from 'filename.mp3':
  Metadata:
    composer        : Music Author
    title           : Song Name
    artist          : Singer
    encoder         : Lavf61.7.100
    genre           : Rock
    date            : 2025
  Duration: 00:03:14.04, start: 0.023021, bitrate: 208 kb/s
  Stream #0:0: Audio: mp3 (mp3float), 48000 Hz, stereo, fltp, 192 kb/s
      Metadata:
        encoder         : Lavc61.19
  Stream #0:1: Video: png, rgb24(pc, gbr/unknown/unknown), 600x600 [SAR 1:1 DAR 1:1], 90k tbr, 90k tbn (attached pic)
      Metadata:
        title           : Cover
        comment         : Cover (front)


    


    The task is to save its metadata to a text file and restore from that file later. Both goals should be accomplished with ffmpeg.

    


    The simpliest method is to run :

    


    # ffmpeg -i filename.mp3 -f ffmetadata metadata.txt


    


    After that, metadata.txt contains :

    


    ;FFMETADATA1
composer=Music Author
title=Song Name
artist=Singer
date=2025
genre=Rock
encoder=Lavf61.7.100


    


    I got global metadata only, but stream-specific info (cover image title and comment in my case) are missing.

    


    Google suggested a more complex form of the command above to extract all metadata fields without any exclusions :

    


    # ffmpeg -y -i filename.mp3 -c copy -map_metadata 0 -map_metadata:s:v 0:s:v -map_metadata:s:a 0:s:a -f ffmetadata metadata.txt


    


    But the output is exactly the same :

    


    ;FFMETADATA1
composer=Music Author
title=Song Name
artist=Singer
date=2025
genre=Rock
encoder=Lavf61.7.100


    


    Again, no info about the attached image.

    


    Please explain what am I doing wrong.

    


  • libav live transcode to SFML SoundStream, garbled and noise

    20 juin 2021, par William Lohan

    I'm so close to have this working but playing with the output sample format or codec context doesn't seem to solve and don't know where to go from here.

    


    #include <iostream>&#xA;#include <sfml></sfml>Audio.hpp>&#xA;#include "MyAudioStream.h"&#xA;&#xA;extern "C"&#xA;{&#xA;#include <libavutil></libavutil>opt.h>&#xA;#include <libavutil></libavutil>avutil.h>&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libavutil></libavutil>audio_fifo.h>&#xA;#include <libswresample></libswresample>swresample.h>&#xA;}&#xA;&#xA;void setupInput(AVFormatContext *input_format_context, AVCodecContext **input_codec_context, const char *streamURL)&#xA;{&#xA;  // av_find_input_format("mp3");&#xA;  avformat_open_input(&amp;input_format_context, streamURL, NULL, NULL);&#xA;  avformat_find_stream_info(input_format_context, NULL);&#xA;&#xA;  AVDictionary *metadata = input_format_context->metadata;&#xA;  AVDictionaryEntry *name = av_dict_get(metadata, "icy-name", NULL, 0);&#xA;  if (name != NULL)&#xA;  {&#xA;    std::cout &lt;&lt; name->value &lt;&lt; std::endl;&#xA;  }&#xA;  AVDictionaryEntry *title = av_dict_get(metadata, "StreamTitle", NULL, 0);&#xA;  if (title != NULL)&#xA;  {&#xA;    std::cout &lt;&lt; title->value &lt;&lt; std::endl;&#xA;  }&#xA;&#xA;  AVStream *stream = input_format_context->streams[0];&#xA;  AVCodecParameters *codec_params = stream->codecpar;&#xA;  AVCodec *codec = avcodec_find_decoder(codec_params->codec_id);&#xA;  *input_codec_context = avcodec_alloc_context3(codec);&#xA;&#xA;  avcodec_parameters_to_context(*input_codec_context, codec_params);&#xA;  avcodec_open2(*input_codec_context, codec, NULL);&#xA;}&#xA;&#xA;void setupOutput(AVCodecContext *input_codec_context, AVCodecContext **output_codec_context)&#xA;{&#xA;  AVCodec *output_codec = avcodec_find_encoder(AV_CODEC_ID_PCM_S16LE); // AV_CODEC_ID_PCM_S16LE ?? AV_CODEC_ID_PCM_S16BE&#xA;  *output_codec_context = avcodec_alloc_context3(output_codec);&#xA;  (*output_codec_context)->channels = 2;&#xA;  (*output_codec_context)->channel_layout = av_get_default_channel_layout(2);&#xA;  (*output_codec_context)->sample_rate = input_codec_context->sample_rate;&#xA;  (*output_codec_context)->sample_fmt = output_codec->sample_fmts[0]; // AV_SAMPLE_FMT_S16 ??&#xA;  avcodec_open2(*output_codec_context, output_codec, NULL);&#xA;}&#xA;&#xA;void setupResampler(AVCodecContext *input_codec_context, AVCodecContext *output_codec_context, SwrContext **resample_context)&#xA;{&#xA;  *resample_context = swr_alloc_set_opts(&#xA;      *resample_context,&#xA;      output_codec_context->channel_layout,&#xA;      output_codec_context->sample_fmt,&#xA;      output_codec_context->sample_rate,&#xA;      input_codec_context->channel_layout,&#xA;      input_codec_context->sample_fmt,&#xA;      input_codec_context->sample_rate,&#xA;      0, NULL);&#xA;  swr_init(*resample_context);&#xA;}&#xA;&#xA;MyAudioStream::MyAudioStream()&#xA;{&#xA;  input_format_context = avformat_alloc_context();&#xA;  resample_context = swr_alloc();&#xA;}&#xA;&#xA;MyAudioStream::~MyAudioStream()&#xA;{&#xA;  // clean up&#xA;  avformat_close_input(&amp;input_format_context);&#xA;  avformat_free_context(input_format_context);&#xA;}&#xA;&#xA;void MyAudioStream::load(const char *streamURL)&#xA;{&#xA;&#xA;  setupInput(input_format_context, &amp;input_codec_context, streamURL);&#xA;  setupOutput(input_codec_context, &amp;output_codec_context);&#xA;  setupResampler(input_codec_context, output_codec_context, &amp;resample_context);&#xA;&#xA;  initialize(output_codec_context->channels, output_codec_context->sample_rate);&#xA;}&#xA;&#xA;bool MyAudioStream::onGetData(Chunk &amp;data)&#xA;{&#xA;&#xA;  // init&#xA;  AVFrame *input_frame = av_frame_alloc();&#xA;  AVPacket *input_packet = av_packet_alloc();&#xA;  input_packet->data = NULL;&#xA;  input_packet->size = 0;&#xA;&#xA;  // read&#xA;  av_read_frame(input_format_context, input_packet);&#xA;  avcodec_send_packet(input_codec_context, input_packet);&#xA;  avcodec_receive_frame(input_codec_context, input_frame);&#xA;&#xA;  // convert&#xA;  uint8_t *converted_input_samples = (uint8_t *)calloc(output_codec_context->channels, sizeof(*converted_input_samples));&#xA;  av_samples_alloc(&amp;converted_input_samples, NULL, output_codec_context->channels, input_frame->nb_samples, output_codec_context->sample_fmt, 0);&#xA;  swr_convert(resample_context, &amp;converted_input_samples, input_frame->nb_samples, (const uint8_t **)input_frame->extended_data, input_frame->nb_samples);&#xA;&#xA;  data.sampleCount = input_frame->nb_samples;&#xA;  data.samples = (sf::Int16 *)converted_input_samples;&#xA;&#xA;  // av_freep(&amp;converted_input_samples[0]);&#xA;  // free(converted_input_samples);&#xA;  av_packet_free(&amp;input_packet);&#xA;  av_frame_free(&amp;input_frame);&#xA;&#xA;  return true;&#xA;}&#xA;&#xA;void MyAudioStream::onSeek(sf::Time timeOffset)&#xA;{&#xA;  // no op&#xA;}&#xA;&#xA;sf::Int64 MyAudioStream::onLoop()&#xA;{&#xA;  // no loop&#xA;  return -1;&#xA;}&#xA;&#xA;</iostream>

    &#xA;

    Called with

    &#xA;

    #include <iostream>&#xA;&#xA;#include "./MyAudioStream.h"&#xA;&#xA;extern "C"&#xA;{&#xA;#include <libavutil></libavutil>opt.h>&#xA;#include <libavutil></libavutil>avutil.h>&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;}&#xA;&#xA;const char *streamURL = "http://s5radio.ponyvillelive.com:8026/stream.mp3";&#xA;&#xA;int main(int, char **)&#xA;{&#xA;&#xA;  MyAudioStream myStream;&#xA;&#xA;  myStream.load(streamURL);&#xA;&#xA;  std::cout &lt;&lt; "Hello, world!" &lt;&lt; std::endl;&#xA;&#xA;  myStream.play();&#xA;&#xA;  while (myStream.getStatus() == MyAudioStream::Playing)&#xA;  {&#xA;    sf::sleep(sf::seconds(0.1f));&#xA;  }&#xA;&#xA;  return 0;&#xA;}&#xA;</iostream>

    &#xA;

  • libav live transcode to SFML SoundStream, grabbled and noise

    19 juin 2021, par William Lohan

    I'm so close to have this working but playing with the output sample format or codec context doesn't seem to solve and don't know where to go from here.

    &#xA;

    #include <iostream>&#xA;#include <sfml></sfml>Audio.hpp>&#xA;#include "MyAudioStream.h"&#xA;&#xA;extern "C"&#xA;{&#xA;#include <libavutil></libavutil>opt.h>&#xA;#include <libavutil></libavutil>avutil.h>&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libavutil></libavutil>audio_fifo.h>&#xA;#include <libswresample></libswresample>swresample.h>&#xA;}&#xA;&#xA;void setupInput(AVFormatContext *input_format_context, AVCodecContext **input_codec_context, const char *streamURL)&#xA;{&#xA;  // av_find_input_format("mp3");&#xA;  avformat_open_input(&amp;input_format_context, streamURL, NULL, NULL);&#xA;  avformat_find_stream_info(input_format_context, NULL);&#xA;&#xA;  AVDictionary *metadata = input_format_context->metadata;&#xA;  AVDictionaryEntry *name = av_dict_get(metadata, "icy-name", NULL, 0);&#xA;  if (name != NULL)&#xA;  {&#xA;    std::cout &lt;&lt; name->value &lt;&lt; std::endl;&#xA;  }&#xA;  AVDictionaryEntry *title = av_dict_get(metadata, "StreamTitle", NULL, 0);&#xA;  if (title != NULL)&#xA;  {&#xA;    std::cout &lt;&lt; title->value &lt;&lt; std::endl;&#xA;  }&#xA;&#xA;  AVStream *stream = input_format_context->streams[0];&#xA;  AVCodecParameters *codec_params = stream->codecpar;&#xA;  AVCodec *codec = avcodec_find_decoder(codec_params->codec_id);&#xA;  *input_codec_context = avcodec_alloc_context3(codec);&#xA;&#xA;  avcodec_parameters_to_context(*input_codec_context, codec_params);&#xA;  avcodec_open2(*input_codec_context, codec, NULL);&#xA;}&#xA;&#xA;void setupOutput(AVCodecContext *input_codec_context, AVCodecContext **output_codec_context)&#xA;{&#xA;  AVCodec *output_codec = avcodec_find_encoder(AV_CODEC_ID_PCM_S16LE); // AV_CODEC_ID_PCM_S16LE ?? AV_CODEC_ID_PCM_S16BE&#xA;  *output_codec_context = avcodec_alloc_context3(output_codec);&#xA;  (*output_codec_context)->channels = 2;&#xA;  (*output_codec_context)->channel_layout = av_get_default_channel_layout(2);&#xA;  (*output_codec_context)->sample_rate = input_codec_context->sample_rate;&#xA;  (*output_codec_context)->sample_fmt = output_codec->sample_fmts[0]; // AV_SAMPLE_FMT_S16 ??&#xA;  avcodec_open2(*output_codec_context, output_codec, NULL);&#xA;}&#xA;&#xA;void setupResampler(AVCodecContext *input_codec_context, AVCodecContext *output_codec_context, SwrContext **resample_context)&#xA;{&#xA;  *resample_context = swr_alloc_set_opts(&#xA;      *resample_context,&#xA;      output_codec_context->channel_layout,&#xA;      output_codec_context->sample_fmt,&#xA;      output_codec_context->sample_rate,&#xA;      input_codec_context->channel_layout,&#xA;      input_codec_context->sample_fmt,&#xA;      input_codec_context->sample_rate,&#xA;      0, NULL);&#xA;  swr_init(*resample_context);&#xA;}&#xA;&#xA;MyAudioStream::MyAudioStream()&#xA;{&#xA;  input_format_context = avformat_alloc_context();&#xA;  resample_context = swr_alloc();&#xA;}&#xA;&#xA;MyAudioStream::~MyAudioStream()&#xA;{&#xA;  // clean up&#xA;  avformat_close_input(&amp;input_format_context);&#xA;  avformat_free_context(input_format_context);&#xA;}&#xA;&#xA;void MyAudioStream::load(const char *streamURL)&#xA;{&#xA;&#xA;  setupInput(input_format_context, &amp;input_codec_context, streamURL);&#xA;  setupOutput(input_codec_context, &amp;output_codec_context);&#xA;  setupResampler(input_codec_context, output_codec_context, &amp;resample_context);&#xA;&#xA;  initialize(output_codec_context->channels, output_codec_context->sample_rate);&#xA;}&#xA;&#xA;bool MyAudioStream::onGetData(Chunk &amp;data)&#xA;{&#xA;&#xA;  // init&#xA;  AVFrame *input_frame = av_frame_alloc();&#xA;  AVPacket *input_packet = av_packet_alloc();&#xA;  input_packet->data = NULL;&#xA;  input_packet->size = 0;&#xA;&#xA;  // read&#xA;  av_read_frame(input_format_context, input_packet);&#xA;  avcodec_send_packet(input_codec_context, input_packet);&#xA;  avcodec_receive_frame(input_codec_context, input_frame);&#xA;&#xA;  // convert&#xA;  uint8_t *converted_input_samples = (uint8_t *)calloc(output_codec_context->channels, sizeof(*converted_input_samples));&#xA;  av_samples_alloc(&amp;converted_input_samples, NULL, output_codec_context->channels, input_frame->nb_samples, output_codec_context->sample_fmt, 0);&#xA;  swr_convert(resample_context, &amp;converted_input_samples, input_frame->nb_samples, (const uint8_t **)input_frame->extended_data, input_frame->nb_samples);&#xA;&#xA;  data.sampleCount = input_frame->nb_samples;&#xA;  data.samples = (sf::Int16 *)converted_input_samples;&#xA;&#xA;  // av_freep(&amp;converted_input_samples[0]);&#xA;  // free(converted_input_samples);&#xA;  av_packet_free(&amp;input_packet);&#xA;  av_frame_free(&amp;input_frame);&#xA;&#xA;  return true;&#xA;}&#xA;&#xA;void MyAudioStream::onSeek(sf::Time timeOffset)&#xA;{&#xA;  // no op&#xA;}&#xA;&#xA;sf::Int64 MyAudioStream::onLoop()&#xA;{&#xA;  // no loop&#xA;  return -1;&#xA;}&#xA;&#xA;</iostream>

    &#xA;

    Called with

    &#xA;

    #include <iostream>&#xA;&#xA;#include "./MyAudioStream.h"&#xA;&#xA;extern "C"&#xA;{&#xA;#include <libavutil></libavutil>opt.h>&#xA;#include <libavutil></libavutil>avutil.h>&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;}&#xA;&#xA;const char *streamURL = "http://s5radio.ponyvillelive.com:8026/stream.mp3";&#xA;&#xA;int main(int, char **)&#xA;{&#xA;&#xA;  MyAudioStream myStream;&#xA;&#xA;  myStream.load(streamURL);&#xA;&#xA;  std::cout &lt;&lt; "Hello, world!" &lt;&lt; std::endl;&#xA;&#xA;  myStream.play();&#xA;&#xA;  while (myStream.getStatus() == MyAudioStream::Playing)&#xA;  {&#xA;    sf::sleep(sf::seconds(0.1f));&#xA;  }&#xA;&#xA;  return 0;&#xA;}&#xA;</iostream>

    &#xA;