Recherche avancée

Médias (1)

Mot : - Tags -/book

Autres articles (79)

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

Sur d’autres sites (9287)

  • Updated version number for last commit.

    29 juin 2014, par blueimp
    Updated version number for last commit.
  • ffmpeg black screen issue for video video generation from a list of frames

    11 mai 2023, par arlaine

    I used a video to generate a list of frames from it, then I wanted to create multiple videos from this list of frames.
I've set starting and ending frames indexes for each "sub video", so for example,
indexes = [[0, 64], [64, 110], [110, 234], [234, 449]], and those indexes will help my code generate 4 videos of various durations. The idea is to decompose the original video into multiple sub videos. My code is working just fine, the video generated.

    


    But every sub video start with multiple seconds of black screen, only the first generated video (so the one using indexes[0] for starting and ending frames) is generated without this black screen part. I've tried changing the frame rate for each sub_video, according to the number of frames and things like that, but I didn't work. You can find my code below

    


    for i, (start_idx, end_idx) in enumerate(self.video_frames_indexes):
    if end_idx - start_idx > 10:
        shape = cv2.imread(f'output/video_reconstitution/{video_name}/final/frame_{start_idx}.jpg').shape
        os.system(f'ffmpeg -r 30 -s {shape[0]}x{shape[1]} -i output/video_reconstitution/{video_name}/final/frame_%d.JPG'
              f' -vf "select=between(n\,{start_idx}\,{end_idx})" -vcodec libx264 -crf 25'
              f' output/video_reconstitution/IMG_7303/sub_videos/serrage_{i}.mp4')


    


    Just the ffmpeg command

    


    ffmpeg -r 30 -s {shape[0]}x{shape[1]} -i output/video_reconstitution/{video_name}/final/frame_%d.JPG -vf "select=between(n\,{start_idx}\,{end_idx})" -vcodec libx264 -crf 25 output/video_reconstitution/IMG_7303/sub_videos/serrage_{i}.mp4


    


  • Xvfb records a black screen

    11 mai 2024, par Vivek

    I am trying a record a video by running xvfb inside a docker image. No matter what I do it gives me black screen.

    


    Screen size same in xvfb and ffmpeg and puppeteer.

    


    It will would really great if someone can help.

    


    
start-xvfb.sh
---------------------------------------------------------------------
# Start Xvfb
Xvfb :99 -screen 0 1280x720x24 &

# Set the display environment variable
export DISPLAY=:99

# Run the application (assuming it starts with npm start)
npm run dev


    


    Dockerfile

    


    FROM node:lts-alpine3.19

# Install dependencies using apk
RUN apk update && \
    apk add --no-cache \
    gnupg \
    ffmpeg \
    libx11 \
    libxcomposite \
    libxdamage \
    libxi \
    libxtst \
    nss \
    cups-libs \
    libxrandr \
    alsa-lib \
    pango \
    gtk+3.0 \
    xvfb \
    bash \
    curl \
    udev \
    ttf-freefont \
    chromium \
    chromium-chromedriver

# Set working directory
WORKDIR /app

# Copy package.json and install dependencies
COPY package.json .
RUN npm install --force

# Copy remaining source code
COPY . .

# Add a script to start Xvfb
COPY start-xvfb.sh /app/start-xvfb.sh
RUN chmod +x /app/start-xvfb.sh

# Expose the port
EXPOSE 4200
EXPOSE 3000

# Command to start Xvfb and run the application
CMD ["./start-xvfb.sh"]


    


    Below

    


    this is code code that launches puppeteer and from a nodejs application and create spawns a process for ffmpeg

    


    export class UnixBrowserRecorder implements Recorder {&#xA;&#xA;  url = &#x27;https://stackoverflow.com/questions/3143698/uncaught-syntaxerror-unexpected-token&#x27;; // Replace with your URL&#xA;  outputFilePath = `/app/output_video.mp4`; // Output file path within the container&#xA;  durationInSeconds = 6; // Duration of the video in seconds&#xA;  resolution = &#x27;1280x720&#x27;;&#xA;&#xA;  public async capture(): Promise<string> {&#xA;    const browser = await puppeteer.launch({&#xA;      args: [&#xA;        &#x27;--no-sandbox&#x27;, // Required in Docker&#xA;        &#x27;--disable-setuid-sandbox&#x27;, // Required in Docker&#xA;        &#x27;--disable-dev-shm-usage&#x27;, // Required in Docker&#xA;        &#x27;--headless&#x27;, // Run browser in headless mode&#xA;        &#x27;--disable-gpu&#x27;, // Disable GPU acceleration&#xA;        `--window-size=${this.resolution}` // Set window size&#xA;      ],&#xA;      executablePath: &#x27;/usr/bin/chromium&#x27; // Specify the path to Chromium executable&#xA;    });&#xA;&#xA;    const page = await browser.newPage();&#xA;    await page.goto(this.url);&#xA;&#xA;    await page.screenshot({&#xA;      "type": "png", // can also be "jpeg" or "webp" (recommended)&#xA;      "path": `/app/screenshot.png`,  // where to save it&#xA;      "fullPage": true,  // will scroll down to capture everything if true&#xA;    });&#xA;&#xA;    //ffmpeg -video_size `DISPLAY=:5 xdpyinfo | grep &#x27;dimensions:&#x27;|awk &#x27;{print $2}&#x27;` -framerate 30 -f x11grab -i :5.0&#x2B;0,0 output.mpg&#xA;&#xA;    const ffmpegProcess = spawn(&#x27;ffmpeg&#x27;, [&#xA;      &#x27;-video_size&#x27;, this.resolution,&#xA;      &#x27;-framerate&#x27;, &#x27;30&#x27;,&#xA;      &#x27;-f&#x27;, &#x27;x11grab&#x27;,&#xA;      &#x27;-i&#x27;, &#x27;:99&#x27;, // Use display :99 (assuming Xvfb is running on this display)&#xA;      &#x27;-t&#x27;, this.durationInSeconds.toString(),&#xA;      &#x27;-c:v&#x27;, &#x27;libx264&#x27;,&#xA;      &#x27;-loglevel&#x27;, &#x27;debug&#x27;,&#xA;      &#x27;-pix_fmt&#x27;, &#x27;yuv420p&#x27;,&#xA;      this.outputFilePath&#xA;    ]);&#xA;&#xA;    // Log ffmpeg output&#xA;    ffmpegProcess.stdout.on(&#x27;data&#x27;, data => {&#xA;      console.log(`ffmpegProcess stdout: ${data}`);&#xA;    });&#xA;&#xA;    ffmpegProcess.stderr.on(&#x27;data&#x27;, data => {&#xA;      console.error(`ffmpegProcess stderr: ${data}`);&#xA;    });&#xA;&#xA;    // Handle ffmpegProcess process exit&#xA;    ffmpegProcess.on(&#x27;close&#x27;, code => {&#xA;      console.log(`ffmpeg process exited with code ${code}`);&#xA;    });&#xA;&#xA;    // Wait for the duration to complete&#xA;    await new Promise(resolve => setTimeout(resolve, this.durationInSeconds * 1000));&#xA;&#xA;    // Close the FFmpeg stream and process&#xA;    ffmpegProcess.stdin.end();&#xA;    // Close Puppeteer&#xA;    await page.close();&#xA;    await browser.close();&#xA;&#xA;    return "Video generated successfully";&#xA;  }&#xA;}&#xA;</string>

    &#xA;

    enter image description here

    &#xA;