Recherche avancée

Médias (1)

Mot : - Tags -/getid3

Autres articles (27)

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

Sur d’autres sites (5895)

  • Systemd service (python loop -> ffmpeg stream)

    7 janvier 2019, par Kevitto

    I am currently running a stream with ffmpeg, through icecast2 through a python snippet (Fig1). I have created a systemd service to run said python script on boot (Fig2) and use a custom target (Fig3) to make sure it loads once every other service is loaded, mostly for icecast2.

    I’ve conducted multiple tests, and the stream works fine if launched either from the python code or if I restart the service attached to it.

    My problem is, on a (re)boot of the system, the service runs for approximately 15 seconds, then the stream dies. I’ve read so much on python and systemd, but I can’t for the life of me figure out where the problem lies. I’ve tried changing my python code, the unit load order and anything else I found online that could help, but found nothing.

    Fig1 (dxstream.py)

    import sys
    import time
    import subprocess

    def start():
       return subprocess.Popen(r’ffpmeg -re -f alsa -ac2 -i hw:1,0 -acodec mp3 -ab 320k -f mp3 icecast://sourcehackme@localhost:8000/stream', shell=True)

    testProcess = start()

    while True:

       res = testProcess.poll()
       if res is not None:
           testProcess = start()
       time.sleep(1)

    Fig2 (dxstream.service)

    [Unit]
    Description=ffmpeg stream starter
    After=multi-user.target
    [Service]
    Type=idle
    Execstart=/usr/bin/python /usr/local/bin/dxstream.py
    Restart=on-failure

    [Install]
    WantedBy=custom.target

    Fig3 (custom.target)

    [Unit]
    Description=Custom Target
    Requires=multi-user.target
    After=multi-user.target
    AllowIsolate=yes
  • How can I stream raw video frames AND audio to FFMPEG with Python 2.7 ?

    18 novembre 2017, par Just Askin

    I am streaming raw video frames from Pygame to FFMPEG, then sending to a rtmp stream, but for the life of me, I can’t figure out how to send live audio using the same Python module. It does not need to be the Pygame mixer, but I am not opposed to using it if that is where the best answer lies. I’m pretty sure it’s not though.

    My question is this : What is the best strategy to send live audio output from a program to FFMPEG along with raw video frames simultaneously from the same Python module ?

    My program is large, and eventually I would like to build options to switch audio inputs from a queue of music, a microphone, or any other random sounds from any program I want to use. But for the time being, I just want something to work. I am starting off with a simple Espeak command.

    Here is my Python commands :

    command = ['ffmpeg', '-re', '-framerate', '22', '-s', '1280x720', '-pix_fmt', 'rgba', '-f', 'rawvideo', '-i', '-', '-f', 's16le', '-ar', '22500', '-i', '/tmp/audio', '-preset', ultrafast', '-pix_fmt', 'rgba', '-b:v', '2500', '-s', 'hd720', '-r', '25', '-g', '50', '-crf', '20', '-f', 'flv', 'rtmp://xxx' ]

    pipe = sp.Popen(command, stdin=sp.PIPE)

    Then I send my frames to stdin from within my main while True: loop.

    The problem I run into with this strategy is I can’t figure out how to shove audio into FFMPEG from within Python without blocking the pipe. After hours of research, I am pretty confident I can’t use the pipe to send the audio along with the frames. I thought the named pipe was my solution (which works running Espeak outside of Python), but it blocks Python until the Espeak is done... so no good.

    I assume I need threading for multiprocessing, but I cannot figure out from the official documentation or any other resources as to how I can solve my problem with it.

    The ['-f', 's16le', '-ar', '22500', '-i', '/tmp/audio'] are settings that work if I run espeak from a separate terminal with espeak 'some text' --stdout > /tmp/audio.

    I am using Centos 7, Python 2.7, pygame, the latest build of FFMPEG,

  • How exactly does this Jaccard distance logic (get_jaccarddist) in FFmpeg work ?

    23 mars 2024, par stilloo

    I see this C code in FFmpeg source signature_lookup file for Jaccard distance in method get_jaccarddist.

    


    If you see in the code below that is calculating for 5 BagOfWords.

    


    Now for two BagOfWords with say nothing in common intersection would be 0, that means jaccarddist would be 0, so ideally its a bad pair but this if condition jaccarddist >= sc->thworddist, would be false isn't it but we want it to be true as its bad pair ?

    


    What are the default values of sc->thworddist ?

    


    Also surprised why jaccarddist is int and not float/double ?

    


    /**
 * calculates the jaccard distance and evaluates a pair of coarse signatures as good
 * @return 0 if pair is bad, 1 otherwise
 */
static int get_jaccarddist(SignatureContext *sc, CoarseSignature *first, CoarseSignature *second)
{
    int jaccarddist, i, composdist = 0, cwthcount = 0;
    for (i = 0; i < 5; i++) {
        if ((jaccarddist = intersection_word(first->data[i], second->data[i])) > 0) {
            jaccarddist /= union_word(first->data[i], second->data[i]);
        }
        if (jaccarddist >= sc->thworddist) {
            if (++cwthcount > 2) {
                /* more than half (5/2) of distances are too wide */
                return 0;
            }
        }
        composdist += jaccarddist;
        if (composdist > sc->thcomposdist) {
            return 0;
        }
    }
    return 1;
}