Recherche avancée

Médias (2)

Mot : - Tags -/kml

Autres articles (78)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

  • Formulaire personnalisable

    21 juin 2013, par

    Cette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
    Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire. (...)

Sur d’autres sites (4155)

  • How do I pipe a stream to ffmpeg using the subprocess library

    15 juin 2020, par Jackson

    Using the following command I can pipe the stream data from streamlink to ffmpeg and save the stream as an mp4 file.

    



    streamlink https://www.youtube.com/watch?v=UmclL6funN8 best -O | ffmpeg -i pipe:0 -c:v copy -c:a copy "test.mp4"


    



    I would like to implement this inside a Python script but I am not able to get the stream to pipe into the ffmpeg process.

    



    url = "https://www.youtube.com/watch?v=UmclL6funN8"
process = subprocess.Popen(("streamlink", url, "best", "-O"), stdout=subprocess.PIPE)
output = subprocess.check_output(('ffmpeg', '-i', 'pipe:0', '-c:v', 'copy', '-c:a', 'copy', "test.mp4"), stdin=process.stdout)


    



    Can anyone see where I am going wrong ?

    


  • Python pipe ffmpeg stream to numpy in realtime

    29 mai 2020, par Dadidum

    im trying to get the frames out of a rtp stream via ffmpeg in realtime in python. At my server the frames are piped from numpy arrays into ffmpeg and should be at the client piped back to numpy for further manipulation. The server creates a sdp file which is given as input to the client. 
It looks like this :

    



    v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 127.0.0.1
t=0 0
a=tool:libavformat 58.42.102
m=video 5004 RTP/AVP 96
b=AS:19000
a=rtpmap:96 H265/90000


    



    With ffplay or VLC the stream can be received but with my python code not, at first needs ca. 5sec for each frame and the image is just some random coloured pixels.
The client :

    



    dimension = '{}x{}'.format(480, 240)
sdf_file = "video.sdp"

command = ['FFMPEG',
           '-protocol_whitelist', 'udp,rtp,file,pipe,crypto,data',
           '-i', sdf_file,
           '-pix_fmt', 'bgr24',
           '-r', '24',
           '-video_size', dimension,
           '-f', 'image2pipe', '-']

size = 480 * 240 * 3
proc = sp.Popen(command, stdout=sp.PIPE)

while True:
    try:
        tic = time.perf_counter()
        frame = proc.stdout.read(size)
        print(frame)
        if frame is None:
            print('no input')
            break
        image = np.frombuffer(frame, dtype='uint8').reshape(240, 480, 3)
        toc = time.perf_counter()
        print(f"performed calc in {(toc - tic) * 1000:0.4f} miliseconds")
        cv2.imshow('received', image)
    except Exception as e:
        print(e)

cv2.destroyAllWindows()
proc.stdin.close()
proc.wait()


    



    Any ideas, how i can get the frames in realtime ? Thanky for your help

    


  • FFmpeg blocking pipe until done ?

    23 mai 2020, par ZeroTek

    I am currently working on a C++ Program (running on Linux) that should run FFmpeg as external Utility to encode the Audio Streams of a Video File to AC3 using popen() and capture the Output through the Pipe.

    



    Here is a Sample Code on how I tried to achieve this :

    



    int bufferSize = 2048;
char buffer[bufferSize];

FILE *handle = popen("ffmpeg  -i filename.mkv -map 0 -codec:v copy -codec:s copy -codec:a ac3 -f matroska -", "r");
int d = fileno(handle);

while(read(d, buffer, bufferSize) > 0)
{
    // Process Data here
}


    



    Actually this works, but not as I expected. The following happens here : FFmpeg starts, encodes the whole file and my program keeps hanging on read(). Once FFmpeg is done my program continues and reads the data from the pipe.

    



    But what I actually wanted was to read the output of FFmpeg while it's encoding the file. Now I wonder how to make it work that Way ? Is FFmpeg blocking the pipe, does not write anything to it until it's done or is my code not capable of reading while the pipe is written ? Or is there any argument I need to pass to FFmpeg ?