Recherche avancée

Médias (39)

Mot : - Tags -/audio

Autres articles (91)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Le plugin : Gestion de la mutualisation

    2 mars 2010, par

    Le plugin de Gestion de mutualisation permet de gérer les différents canaux de mediaspip depuis un site maître. Il a pour but de fournir une solution pure SPIP afin de remplacer cette ancienne solution.
    Installation basique
    On installe les fichiers de SPIP sur le serveur.
    On ajoute ensuite le plugin "mutualisation" à la racine du site comme décrit ici.
    On customise le fichier mes_options.php central comme on le souhaite. Voilà pour l’exemple celui de la plateforme mediaspip.net :
    < ?php (...)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (13844)

  • Xvfb and pulse audio not sync

    14 décembre 2023, par Matrix 404

    I'm excited to introduce my new JavaScript server-side library called XFP Streamer, designed to handle recording and streaming Puppeteer window content. However, I'm currently facing an issue with audio synchronization, and I could really use some help from someone experienced with ffmpeg and recording in general.

    &#xA;

    The library's repository is available on GitHub, and I warmly welcome any contributions or assistance. Feel free to check it out at https://github.com/mboussaid/xfp-streamer.

    &#xA;

    Below is a simple example demonstrating how to record the Google website into a file.flv video file using XFP :

    &#xA;

    const XFP = require(&#x27;./index&#x27;);&#xA;XFP.onReady().then(async ()=>{&#xA;    // create new xfp instance&#xA;    const xfp = new XFP({&#xA;        debug:1&#xA;    });&#xA;    await xfp.onStart();&#xA;    // record everyting inside the file file.flv&#xA;    xfp.pipeToFile(&#x27;file.flv&#x27;,{&#xA;        debug:1&#xA;    })&#xA;    // xfp.pipeToRtmp(&#x27;file.flv&#x27;,&#x27;RTMP LINK HERE&#x27;)&#xA;    await xfp.onUseUrl(&#x27;https://www.google.com&#x27;) // navigate to google&#xA;    setTimeout(async ()=>{&#xA;        await xfp.onStop();&#xA;    },5000) // stop everyting after 5 seconds&#xA;},(missing)=>{&#xA;    // missing tools&#xA;    console.log(&#x27;Missing tools&#x27;,missing)&#xA;})&#xA;

    &#xA;

    Please note that to ensure proper functionality, you will need to have the following tools installed :

    &#xA;

    pulseaudio&#xA;xvfb&#xA;ffmpeg&#xA;pactl&#xA;pacmd&#xA;Currently, I'm facing an issue with audio and video synchronization not working as expected. If you have experience with ffmpeg and recording, I would greatly appreciate your help in resolving this issue.

    &#xA;

    Thank you all for your support, and I look forward to your contributions !

    &#xA;

    Best regards,

    &#xA;

  • Can't correctly decode an image frame using PyAV

    17 avril 2023, par Martin Blore

    I'm trying to simply encode and decode a capture frame from the web-cam. I want to be able to send this over TCP but at the moment I'm having trouble performing this just locally.

    &#xA;

    Here's my code that simply takes the frame from the web-cam, encodes, then decodes, and displays the two images in a new window. The two images look like this :

    &#xA;

    1

    &#xA;

    Here's the code :

    &#xA;

    import struct&#xA;import cv2&#xA;import socket&#xA;import av&#xA;import time&#xA;import os&#xA;&#xA;class PerfTimer:&#xA;    def __init__(self, name):&#xA;        self.name = name&#xA;&#xA;    def __enter__(self):&#xA;        self.start_time = time.perf_counter()&#xA;&#xA;    def __exit__(self, type, value, traceback):&#xA;        end_time = time.perf_counter()&#xA;        print(f"&#x27;{self.name}&#x27; taken:", end_time - self.start_time, "seconds.")&#xA;&#xA;os.environ[&#x27;AV_PYTHON_AVISYNTH&#x27;] = &#x27;C:/ffmpeg/bin&#x27;&#xA;&#xA;socket_enabled = False&#xA;sock = None&#xA;if socket_enabled:&#xA;    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)&#xA;    print("Connecting to server...")&#xA;    sock.connect((&#x27;127.0.0.1&#x27;, 8000))&#xA;&#xA;# Set up video capture.&#xA;print("Opening web cam...")&#xA;cap = cv2.VideoCapture(0, cv2.CAP_DSHOW)&#xA;cap.set(cv2.CAP_PROP_FRAME_WIDTH, 800)&#xA;cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 600)&#xA;&#xA;# Initialize the encoder.&#xA;encoder = av.CodecContext.create(&#x27;h264&#x27;, &#x27;w&#x27;)&#xA;encoder.width = 800&#xA;encoder.height = 600&#xA;encoder.pix_fmt = &#x27;yuv420p&#x27;&#xA;encoder.bit_rate = 5000&#xA;&#xA;# Initialize the decoder.&#xA;decoder = av.CodecContext.create(&#x27;h264&#x27;, &#x27;r&#x27;)&#xA;decoder.width = 800&#xA;decoder.height = 600&#xA;decoder.pix_fmt = &#x27;yuv420p&#x27;&#xA;decoder.bit_rate = 5000&#xA;&#xA;print("Streaming...")&#xA;while(cap.isOpened()):&#xA;    &#xA;    # Capture the frame from the camera.&#xA;    ret, orig_frame = cap.read()&#xA;&#xA;    cv2.imshow(&#x27;Source Video&#x27;, orig_frame)&#xA;&#xA;    # Convert to YUV.&#xA;    img_yuv = cv2.cvtColor(orig_frame, cv2.COLOR_BGR2YUV_I420)&#xA;&#xA;    # Create a video frame object from the num py array.&#xA;    video_frame = av.VideoFrame.from_ndarray(img_yuv, format=&#x27;yuv420p&#x27;)&#xA;&#xA;    with PerfTimer("Encoding") as p:&#xA;        encoded_frames = encoder.encode(video_frame)&#xA;&#xA;    # Sometimes the encode results in no frames encoded, so lets skip the frame.&#xA;    if len(encoded_frames) == 0:&#xA;        continue&#xA;&#xA;    print(f"Decoding {len(encoded_frames)} frames...")&#xA;&#xA;    for frame in encoded_frames:&#xA;        encoded_frame_bytes = bytes(frame)&#xA;&#xA;        if socket_enabled:&#xA;            # Get the size of the encoded frame in bytes&#xA;            size = struct.pack(&#x27;code>

    &#xA;

  • I need to create a streaming app Where videos store in aws S3

    27 juillet 2023, par abuzar zaidi

    I need to create a video streaming app. where my videos will store in S3 and the video will stream from the backend. Right now I am trying to use ffmpeg in the backend but it does not work properly.

    &#xA;

    what am I doing wrong in this code ? And if ffmpeg not support streaming video that store in aws s3 please suggest other options.

    &#xA;

    Backend

    &#xA;

    const express = require(&#x27;express&#x27;);&#xA;const aws = require(&#x27;aws-sdk&#x27;);&#xA;const ffmpeg = require(&#x27;fluent-ffmpeg&#x27;);&#xA;const cors = require(&#x27;cors&#x27;); &#xA;const app = express();&#xA;&#xA;//   Set up AWS credentials&#xA;aws.config.update({&#xA;accessKeyId: &#x27;#######################&#x27;,&#xA;secretAccessKey: &#x27;###############&#x27;,&#xA;region: &#x27;###############3&#x27;,&#xA;});&#xA;&#xA;const s3 = new aws.S3();&#xA;app.use(cors());&#xA;&#xA;app.get(&#x27;/stream&#x27;, (req, res) => {&#xA;const bucketName = &#x27;#######&#x27;;&#xA;const key = &#x27;##############&#x27;; // Replace with the key/path of the video file in the S3 bucket&#xA;const params = { Bucket: bucketName, Key: key };&#xA;const videoStream = s3.getObject(params).createReadStream();&#xA;&#xA;// Transcode to HLS format&#xA; const hlsStream = ffmpeg(videoStream)&#xA;.format(&#x27;hls&#x27;)&#xA;.outputOptions([&#xA;  &#x27;-hls_time 10&#x27;,&#xA;  &#x27;-hls_list_size 0&#x27;,&#xA;  &#x27;-hls_segment_filename segments/segment%d.ts&#x27;,&#xA; ])&#xA;.pipe(res);&#xA;&#xA;// Transcode to DASH format and pipe the output to the response&#xA;ffmpeg(videoStream)&#xA;.format(&#x27;dash&#x27;)&#xA;.outputOptions([&#xA;  &#x27;-init_seg_name init-stream$RepresentationID$.mp4&#x27;,&#xA;  &#x27;-media_seg_name chunk-stream$RepresentationID$-$Number%05d$.mp4&#x27;,&#xA; ])&#xA;.output(res)&#xA;.run();&#xA;});&#xA;&#xA;const port = 5000;&#xA;app.listen(port, () => {&#xA;console.log(`Server running on http://localhost:${port}`);&#xA;});&#xA;

    &#xA;

    Frontend

    &#xA;

        import React from &#x27;react&#x27;;&#xA;&#xA;    const App = () => {&#xA;     const videoUrl = &#x27;http://localhost:3000/api/playlist/runPlaylist/6c3e7af45a3b8a5caf2fef17a42ef9a0&#x27;; //          Replace with your backend URL&#xA;Please list down solution or option i can use here&#xA;    const videoUrl = &#x27;http://localhost:5000/stream&#x27;;&#xA;         return (&#xA;      <div>&#xA;      <h1>Video Streaming Example</h1>&#xA;      <video controls="controls">&#xA;        <source src="{videoUrl}" type="video/mp4"></source>&#xA;        Your browser does not support the video tag.&#xA;      </video>&#xA;    </div>&#xA;     );&#xA;     };&#xA;&#xA;    export default App;&#xA;

    &#xA;