Recherche avancée

Médias (3)

Mot : - Tags -/spip

Autres articles (91)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (15483)

  • How to eliminate ffplay delay on local network

    17 janvier 2021, par Vigrond

    I am streaming audio from one computer to another on my local LAN.

    


    Server command :

    


    ffmpeg -re -f alsa -ac 2 -i default -fflags nobuffer -flags low_delay -sdp_file ~/sdp_stream -f rtp rtp://192.168.1.5:1234


    


    Client command :

    


    ffplay -fflags nobuffer -flags low_delay -nodisp -fast -framedrop -infbuf -protocol_whitelist rtp,file,udp sdp_stream


    


    This works with near-zero delay for a while, but after a bit the delay increases over time.

    


    My perception of delay is due to playing a youtube video or spotify on the server, and experiencing a delay on the client (both monitors in front of me).

    


    I am certain that it should be possible to set this up correctly with near zero delay on my local hardwired network, but I can't seem to find the correct setting in the ffmpeg docs.

    


    Any help appreciated.

    


  • Video overlay of several network inputs using ffmpeg

    1er juin 2018, par Hristo Ivanov

    I am writing my first program using the FFMPEG libraries, unfortunately it’s not a simple one.

    What I need is to :

    • capture several network inputs(udp).
    • demux the inputs.
    • overlay the video streams.
    • mix the audio(or some other logic).
    • encode the resulting streams.
    • remux the streams and write the result to file.

    For now I am playing with the ffmpeg.exe tool trying achieve this functionality. The command I have looks like this :

    .\ffmpeg.exe -threads auto -y -i input0 -i input1 \
       -filter_complex "[0:v]scale=1920x1080[v0];[1:v]scale=480x270[v1];[v0][v1]overlay=1440:810[v2]" \
       -map [v2] -map 0:a -c:v libx264 -preset ultrafast -c:a copy output.mp4

    When input0 and input1 are files the resulting output is correct, on the other hand, when the inputs are udp streams the resulting output is not correct, the video freezes most of the time.

    The file inputs are generated from the udp streams, using the following command :

    .\ffmpeg.exe -threads auto -y -i "udp://@ip:port" -c copy -f mpegts input1.mpg

    Question 1.
    Why is the above command not producing good ouput for udp streams ? What are the differences between the original stream and the dump of that stream for ffmpeg.exe.

    Question 2.
    Is there some argument/s that can fix the command ?

    Question 3.
    What kind of logic/algorithm is needed to correctly overlay two network streams.

  • FFmpeg, decode mp3 packet after sending by network

    4 août 2022, par Stanislav

    Good day, everyone.
    
Working with FFmpeg.
    
And have some issues with decoding, I cannot find in docs and forums.
The code is not simple, so I will try to explain firstly in words, may be someone really skilled in ffmpeg will understand the issue by words. But if the code really helps, i will try to post it.

    


    So, firstly in general, what i want to do. I want to capture voice, encode to mp3, get packet, send to network, on the other side : accept the packet, decode and play. Why not to use ffmpeg streaming ? Well, because this packet will be modified a little bit, and may be encoded/crypted, so ffmpeg has no functions to do this, and i should do it manually.
    
Well, what i managed to do now. Now i can encode and decode via file. This code works fine, without any issues. So generally i can encode and decode mp3, and play, so i assume that my code for encoding/decoding works fine.

    


    So, than i just change code, making no saving to file, and send packets via network instead.
    
This is the method, standard, well, i use to send packet to decoder on the accepting side.

    


      result = avcodec_send_packet( codecContext, networkPacket );
  if( result < 0 ) {
    if( result != AVERROR(EAGAIN) ) {
      qDebug() << "Some decoding error occured: " << result;
      return;
    }
  }


    


    networkPacket is the AVPacket restored from network.

    


      AVPacket* networkPacket = NULL;
  networkPacket = av_packet_alloc();
  ...


    


    And that is the way i restore it.

    


    void FFmpegPlay::processNetworkPacket( MediaPacket* mediaPacket ) {

  qDebug() << "FFmpegPlay::processNetworkPacket start";

  int result;

  AVPacket* networkPacket = NULL;
  networkPacket = av_packet_alloc();

  networkPacket->size = mediaPacket->data.size();
  networkPacket->data = (uint8_t*) malloc( mediaPacket->data.size() + AV_INPUT_BUFFER_PADDING_SIZE );
  memcpy( networkPacket->data, mediaPacket->data.data(), mediaPacket->data.size() );
  networkPacket->pts = mediaPacket->pts;
  networkPacket->dts = mediaPacket->dts;
  networkPacket->flags = mediaPacket->flags;
  networkPacket->duration = mediaPacket->duration;
  networkPacket->pos = mediaPacket->pos;
  ...


    


    And there i get -22, EINVAL, invalid argument.
Docs tell me :

    


    AVERROR(EINVAL):   codec not opened, it is an encoder, or requires flush


    


    Well, my codec really opened, this is decoder, and this is first call, so i think that flush is not required. So i assume, that issue is in packet and codec setup. I also tried different flags, and always get this error. Codec just doesn't want to accept packet.

    


    So, now i have explained the situation.
    
And question is : Is there any special options or flags for ffmpeg mp3 decoder to implement what is explained above ? Which one of them i should change ?

    


    Upd.
After some testing, i decided to make more clear test and check if i can decode immediately after encoding, without network, and it looks like i can do that.
So it looks like in network case the decoder should be initialized somehow special, or have some options.
Well, i'm dealing initialization by copying AVCodecParameters from original and sending them by network. Maybe i should change them some special way ?

    


    I'm stuck on this one. And have no idea how to deal with it. So any help is appreciated.