Recherche avancée

Médias (0)

Mot : - Tags -/clipboard

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (91)

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (3648)

  • FFMPEG rtmp stream slow and only works on chrome

    18 juin 2023, par DrMeepso

    I am trying to stream to twitch from a Node.js script for fun ! so far i have got it working but its slow and seemingly limited to 10-12 fps.

    


    Here is my code, i am trying to stream a Node-Canvas to twitch so i can do stuff without the overhead of OBS and in a console :

    


    import { createCanvas } from 'canvas';
import { spawn } from 'child_process'
import fs from 'fs';

const canvas = createCanvas(1920, 1080);
const ctx = canvas.getContext('2d');
// create a ffmpeg process that will stream the canvas to a rtmp server
const ffmpeg = spawn('ffmpeg', [
    '-re', // read input at native frame rate
    '-f', 'image2pipe', // tell ffmpeg to expect raw image stream
    '-vcodec', 'png', // tell ffmpeg to expect jpeg encoded images
    '-r', '10', // tell ffmpeg to expect 60 fps
    '-s', '1920x1080', // tell ffmpeg to expect size 1920x1080
    '-i', '-', // tell ffmpeg to expect input from stdin
    //'-c:v', 'h264_amf', // tell ffmpeg to encode in h264 codec AMD
    '-c:v', 'libx264', // tell ffmpeg to encode in h264 codec
    '-pix_fmt', 'yuv420p', // tell ffmpeg to encode in yuv420p format
    '-preset', 'ultrafast', // tell ffmpeg to use ultrafast encoding preset
    '-g', '20', // set the keyframe interval to 2 seconds so twitch will not reject the stream
    '-f', 'flv', // tell ffmpeg that we are going to stream flv video
    "rtmp://live.restream.io/live/"
]);

ffmpeg.on('close', (code, signal) => {
    console.log('FFmpeg child process closed, code ' + code + ', signal ' + signal);
})

ffmpeg.on('error', (err) => {
    console.log('FFmpeg child process error: ' + err.message);
})

ffmpeg.stderr.on('data', (data) => {
    //console.log('FFmpeg stderr: ' + data);
    //ParseFFPMPEGOutput(data.toString());
})

ffmpeg.stdout.on('data', (data) => {
    console.log('FFmpeg stdout: ' + data);
})

var DrawingCatagorys: string[] = []
fs.readFileSync('categories.txt').toString().split('\n').forEach(function (line) { DrawingCatagorys.push(line); })

function ParseFFPMPEGOutput(data: string) {

    if (data.includes('frame=')) {
        let frame = data.split('frame=')[1].split('fps')[0].trim();
        let fps = data.split('fps=')[1].split('q=')[0].trim();
        let size = data.split('size=')[1].split('time=')[0].trim();
        let time = data.split('time=')[1].split('bitrate=')[0].trim();
        let bitrate = data.split('bitrate=')[1].split('speed=')[0].trim();

        console.log(`Frame: ${frame} FPS: ${fps} Size: ${size} Time: ${time} Bitrate: ${bitrate}`);
    }

}

// create a png stream
setInterval(() => {
    // convert canvas to png
    const buffer = canvas.toBuffer('image/png');
    // write png stream to stdin of ffmpeg process
    ffmpeg.stdin.write(buffer);
}, 2);


    


    Im thinking it has to do with Node-Canvas just being slow but i have no idea, also even on my gaming rig it cant pull 1x speed while streaming always sitting around 0.95 - 0.98 and about 9.2 fps. also it only works on chrome and not firefox ? i have no idea why probably a codec thing

    


  • Have an error running one batch script to concatenate avi files, when a very similar script works fine

    1er juillet 2023, par hw22s

    When I run the following bath script to concatenate the .avi files in a folder, I get an error. I am using powershell on a windows computer
Script :

    


    # Set the folder path where the AVI files are located
$folderPath = "C:\Users\HomePC\hswlab\Desktop\videos\eyeblink\022223\2023_04_24\16_15_23\My_WebCam"

# Get all AVI files in the folder
$aviFiles = Get-ChildItem -Path $folderPath -Filter "*.avi" | Sort-Object Name

# Check if there are at least 2 AVI files for concatenation
if ($aviFiles.Count -ge 2) {
    $videoFiles = $aviFiles.FullName

    Write-Host "Input Files for Concatenation:"
    foreach ($file in $aviFiles) {
        Write-Host $file.Name
    }

    $outputFile = Join-Path -Path $folderPath -ChildPath "concatenated.avi"

    # Create the FFmpeg command for concatenation
    $concatArguments = "-f", "concat", "-i", "`"concat:$videoFiles`"", "-c", "copy", "`"$outputFile`""

    $command = "ffmpeg $concatArguments"
    Write-Host "FFmpeg Command: $command"

    try {
        $process = Start-Process -FilePath "ffmpeg" -ArgumentList $concatArguments -NoNewWindow -PassThru -Wait -ErrorAction Stop
        Write-Host "Concatenation complete. Output file: $outputFile"
    } catch {
        Write-Host "Error occurred while executing FFmpeg command:"
        Write-Host "Error message: $($_.Exception.Message)"
    }
} else {
    Write-Host "Not enough AVI files found in the folder for concatenation."
}



    


    Output with error (and no concatenated file is actually produced, needless to say) :

    


    Input Files for Concatenation:
webcam0.avi
webcam1.avi
FFmpeg Command: ffmpeg -f concat -i "concat:C:\Users\HomePC\hswlab\Desktop\videos\eyeblink\022223\2023_04_24\16_15_23\My_WebCam\webcam0.avi C:\Users\HomePC\hswlab\Desktop\videos\eyeblink\022223\2023_04_24\16_15_23\My_WebCam\webcam1.avi" -c copy "C:\Users\HomePC\hswlab\Desktop\videos\eyeblink\022223\2023_04_24\16_15_23\My_WebCam\concatenated.avi"
ffmpeg version 2023-06-27-git-9b6d191a66-essentials_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      58. 13.101 / 58. 13.101
  libavcodec     60. 21.100 / 60. 21.100
  libavformat    60.  9.100 / 60.  9.100
  libavdevice    60.  2.100 / 60.  2.100
  libavfilter     9.  8.102 /  9.  8.102
  libswscale      7.  3.100 /  7.  3.100
  libswresample   4. 11.100 /  4. 11.100
  libpostproc    57.  2.100 / 57.  2.100
[in#0 @ 000001d2f05f1b00] Error opening input: Invalid argument
Concatenation complete. Output file: C:\Users\HomePC\hswlab\Desktop\videos\eyeblink\022223\2023_04_24\16_15_23\My_WebCam\concatenated.avi


    


    But this script, which ostensibly does the same thing to the same files, works fine :

    


    $file1 = "C:\Users\HomePC\hswlab\Desktop\videos\eyeblink\022223\2023_04_24\16_15_23\My_WebCam\webcam0.avi"       # Path to the first video file
$file2 = "C:\Users\HomePC\hswlab\Desktop\videos\eyeblink\022223\2023_04_24\16_15_23\My_WebCam\webcam1.avi"       # Path to the second video file
$outputFile = "C:\Users\HomePC\hswlab\Desktop\videos\eyeblink\022223\2023_04_24\16_15_23\My_WebCam\concat.avi"  # Path to the output concatenated video file

# Create a temporary batch script
$batchScriptPath = [System.IO.Path]::GetTempFileName() + ".bat"
@'
@echo off
ffmpeg -i "%~1" -i "%~2" -filter_complex "[0:v][1:v]concat=n=2:v=1[outv]" -map "[outv]" "%~3"
'@ | Set-Content -Path $batchScriptPath

# Execute the temporary batch script
try {
    & $batchScriptPath $file1 $file2 $outputFile
    Write-Host "Concatenation complete. Output file: $outputFile"
} catch {
    Write-Host "Error occurred while executing FFmpeg command:"
    Write-Host $_.Exception.Message
}

# Remove the temporary batch script
Remove-Item -Path $batchScriptPath -Force



    


    I can't figure out what is wrong with the first script. Any help ?? Thank you !!

    


    Tried many variations on the first script but cannot get it to work.

    


  • Have an error running one PowerShell script to concatenate avi files, when a very similar script works fine

    1er juillet 2023, par hw22s

    When I run the following PowerShell script, to concatenate the .avi files in a folder, I get an error.

    


    Script :

    


    # Set the folder path where the AVI files are located
$folderPath = "C:\Users\HomePC\hswlab\Desktop\videos\eyeblink\022223\2023_04_24\16_15_23\My_WebCam"

# Get all AVI files in the folder
$aviFiles = Get-ChildItem -Path $folderPath -Filter "*.avi" | Sort-Object Name

# Check if there are at least 2 AVI files for concatenation
if ($aviFiles.Count -ge 2) {
    $videoFiles = $aviFiles.FullName

    Write-Host "Input Files for Concatenation:"
    foreach ($file in $aviFiles) {
        Write-Host $file.Name
    }

    $outputFile = Join-Path -Path $folderPath -ChildPath "concatenated.avi"

    # Create the FFmpeg command for concatenation
    $concatArguments = "-f", "concat", "-i", "`"concat:$videoFiles`"", "-c", "copy", "`"$outputFile`""

    $command = "ffmpeg $concatArguments"
    Write-Host "FFmpeg Command: $command"

    try {
        $process = Start-Process -FilePath "ffmpeg" -ArgumentList $concatArguments -NoNewWindow -PassThru -Wait -ErrorAction Stop
        Write-Host "Concatenation complete. Output file: $outputFile"
    } catch {
        Write-Host "Error occurred while executing FFmpeg command:"
        Write-Host "Error message: $($_.Exception.Message)"
    }
} else {
    Write-Host "Not enough AVI files found in the folder for concatenation."
}


    


    Output with error, (and no concatenated file is actually produced, needless to say) :

    


    Input Files for Concatenation:
webcam0.avi
webcam1.avi
FFmpeg Command: ffmpeg -f concat -i "concat:C:\Users\HomePC\hswlab\Desktop\videos\eyeblink\022223\2023_04_24\16_15_23\My_WebCam\webcam0.avi C:\Users\HomePC\hswlab\Desktop\videos\eyeblink\022223\2023_04_24\16_15_23\My_WebCam\webcam1.avi" -c copy "C:\Users\HomePC\hswlab\Desktop\videos\eyeblink\022223\2023_04_24\16_15_23\My_WebCam\concatenated.avi"
ffmpeg version 2023-06-27-git-9b6d191a66-essentials_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      58. 13.101 / 58. 13.101
  libavcodec     60. 21.100 / 60. 21.100
  libavformat    60.  9.100 / 60.  9.100
  libavdevice    60.  2.100 / 60.  2.100
  libavfilter     9.  8.102 /  9.  8.102
  libswscale      7.  3.100 /  7.  3.100
  libswresample   4. 11.100 /  4. 11.100
  libpostproc    57.  2.100 / 57.  2.100
[in#0 @ 000001d2f05f1b00] Error opening input: Invalid argument
Concatenation complete. Output file: C:\Users\HomePC\hswlab\Desktop\videos\eyeblink\022223\2023_04_24\16_15_23\My_WebCam\concatenated.avi


    


    But this script, which ostensibly does the same thing to the same files, works fine :

    


    $file1 = "C:\Users\HomePC\hswlab\Desktop\videos\eyeblink\022223\2023_04_24\16_15_23\My_WebCam\webcam0.avi"       # Path to the first video file
$file2 = "C:\Users\HomePC\hswlab\Desktop\videos\eyeblink\022223\2023_04_24\16_15_23\My_WebCam\webcam1.avi"       # Path to the second video file
$outputFile = "C:\Users\HomePC\hswlab\Desktop\videos\eyeblink\022223\2023_04_24\16_15_23\My_WebCam\concat.avi"  # Path to the output concatenated video file

# Create a temporary batch script
$batchScriptPath = [System.IO.Path]::GetTempFileName() + ".bat"
@'
@echo off
ffmpeg -i "%~1" -i "%~2" -filter_complex "[0:v][1:v]concat=n=2:v=1[outv]" -map "[outv]" "%~3"
'@ | Set-Content -Path $batchScriptPath

# Execute the temporary batch script
try {
    & $batchScriptPath $file1 $file2 $outputFile
    Write-Host "Concatenation complete. Output file: $outputFile"
} catch {
    Write-Host "Error occurred while executing FFmpeg command:"
    Write-Host $_.Exception.Message
}

# Remove the temporary batch script
Remove-Item -Path $batchScriptPath -Force


    


    I can't figure out what is wrong with the first script. I tried many variations of the first script but cannot get it to work.

    


    Any help ?