Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (65)

  • Gestion générale des documents

    13 mai 2011, par

    MédiaSPIP ne modifie jamais le document original mis en ligne.
    Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
    Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

Sur d’autres sites (6578)

  • Stream to Facebook Live using OpenCV

    23 mai 2022, par Lanzy Erin

    I am planning to stream a video file to Facebook Live but I want to programmatically edit its frames like adding texts depending. My problem is that I don't know how to properly send data to Facebook Live. I tried ffmpeg but it doesn't work.

    


    Here is my code that I tried

    


    import subprocess
import cv2

rtmp_url = "rtmps://live-api-s.facebook.com:443/rtmp/FB-1081417119476224-0-AbwwMK91tFTjFy2j"

path = "7.mp4"
cap = cv2.VideoCapture(path)

# gather video info to ffmpeg
fps = int(cap.get(cv2.CAP_PROP_FPS))
width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))

# command and params for ffmpeg
command = ['ffmpeg',
           '-y',
           '-f', 'rawvideo',
           '-vcodec', 'rawvideo',
           '-pix_fmt', 'bgr24',
           '-s', f"{width}x{height}",
           '-r', str(fps),
           '-i', '-',
           '-c:v', 'libx264',
           '-pix_fmt', 'yuv420p',
           '-preset', 'ultrafast',
           '-f', 'flv',
           rtmp_url]

# using subprocess and pipe to fetch frame data
p = subprocess.Popen(command, stdin=subprocess.PIPE)

while cap.isOpened():
    ret, frame = cap.read()
    if not ret:
        print("frame read failed")
        break

    # YOUR CODE FOR PROCESSING FRAME HERE

    # write to pipe
    p.stdin.write(frame.tobytes())


    


  • Convert mp3 to aac stream for facebook video with ffmpeg

    17 août 2022, par Miro Barsocchi

    I want to start a live video in a Facebook page and I can do this using ffmpeg. The input is, as a video stream, a static image, suppose image.jpg and as audio a streaming content that currently is in mp3 format.
Due to facebook limitation, the audio format should be aac, so the idea is to convert the audio from mp3 to aac and send everything to facebook. What I'm using is this command

    


    ffmpeg -loop 1 -f image2 -i image.jpg -i https://some.streaming.service/mp3 -c:a libfdk_aac -pix_fmt yuv420p  -profile:v baseline  -bufsize 6000k  -maxrate 1500k  -vcodec libx264  -preset veryfast  -g 30  -r 30  -f flv  -flvflags no_duration_filesize  "rtmps://live-api-s.facebook.com:443/rtmp/FB-KEYTOSTREAM"


    


    where https://some.streaming.service/mp3 is a streaming in mp3 format. It "almost" work in the sense that it returns no error but I can not start streaming because, from facebook side, it seems that I'm not sending the stream : the "Start Live session" is not enabled

    


    enter image description here

    


    If I stop ffmpeg, then for a second, the button is enabled and I can stream a few seconds of what I want. It seems that the error is related to the fact that there is no buffer of data that arrives, will be converted, and directly sent to the output. If, instead of a mp3 streaming audio, I use a mp3 file then no problem.

    


    I'm quite sure that ffmpeg can do this type of conversion, but can someone help me understand the flag(s) that I'm missing ?

    


    I've tried also with -re with no luck.

    


  • Facebook Graph API - Getting error 2207026 when trying to upload video

    22 novembre 2022, par NiVeK92

    I try to upload a video via the graph API but as the title states, I get an error that states that I use an unsupported video format.

    


    I thought maybe the original video file doesn't match the video specifications as defined on https://developers.facebook.com/docs/instagram-api/reference/ig-user/media#video-specifications so I wrote a function to convert the file to match the specification, using ffmpeg with the following command (I tried many different ones, but this is the last one I tried)

    


    ffmpeg -i ${tmpInFile} -vf format=yuv420p -vf scale=-2:720 -pix_fmt yuv420p -r 30 -movflags +faststart -c:v libx264 -b:v 3M -c:a aac -b:a 128k -ac 2 -ar 44100 -shortest -f mp4 ${tmpOutFile}

    


    Unfortunately, the error persists.

    


    Here's the complete process :

    


    First I use await fetch('/api/convert-mp4', { method: 'POST', body: file }); to send the uploaded video file to the backend.

    


    Next I get the blob data from the request with const blob = await request.blob();.

    


    Then I create a temporary file with await fs.writeFile(tmpInFile, await blob.stream()).

    


    Then I call ffmpeg with the above command mentioned above and then read the file with const buffer = await fs.readFile(tmpOutFile);.

    


    Then I send the buffer as response body back to the client with return {status: 200,body: buffer}.

    


    Then I get the blob data from the response with const blob = await convertVideoResponse.blob();.

    


    Finally I convert it back into a file object with
const convertedFile = new File([blob], file.name, { type: 'video/mp4' });

    


    This file I upload to Supabase Storage (https://supabase.com/storage), and get a publicly accessible url (which I confirmed by opening it in an incognito tab).

    


    In the supabase dashboard I can see the video file has the correct media container (video/mp4) and the file size is small enough.

    


    Does anyone have an idea what could be the issue ?

    


    Edit :

    


    By changing the ffmpeg command to use h265 instead of h254 ffmpeg -i ${tmpInFile} -vf format=yuv420p -vf scale=-2:1350 -pix_fmt yuv420p -r 30 -movflags +faststart -c:v libx265 -vtag hvc1 -an -x265-params crf=25 -b:v 3M -c:a copy -c:a aac -b:a 128k -ac 2 -ar 44100 -shortest -f mp4 ${tmpOutFile} I managed to get it to work for some videos but not all, which confuses me, as I assumed that the video attributes should be the same for all videos processed by the same command.