Recherche avancée

Médias (0)

Mot : - Tags -/inscription3

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

Autres articles (46)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (4415)

  • avcodec/libjxl.h : include version.h

    23 janvier 2024, par Leo Izen
    avcodec/libjxl.h : include version.h
    

    This file has been exported since our minimum required version (0.7.0),
    but it wasn't documented. Instead it was transitively included by
    <jxl/decode.h> (but not jxl/encode.h), which ffmpeg relied on.

    libjxl broke its API in libjxl/libjxl@66b959239355aef5255 by removing
    the transitive include of version.h, and they do not plan on adding
    it back. Instead they are choosing to leave the API backwards-
    incompatible with downstream callers written for some fairly recent
    versions of their API.

    As a result, we include <jxl/version.h> to continue to build against
    more recent versions of libjxl. The version macros removed are also
    present in that file, so we no longer need to redefine them.

    Signed-off-by : Leo Izen <leo.izen@gmail.com>

    • [DH] libavcodec/libjxl.h
  • Execute my PowerShell script does not work via my C# application

    15 février 2024, par Nixir

    I'm currently working on IP cameras for my job, but I'm just starting out because I've never done anything like this before.&#xA;The aim is very simple, to start recording a specific camera via a user action, and to stop the same camera via another user action.&#xA;To achieve this, I looked for several solutions and finally decided to use FFMPEG and two Powershell scripts.

    &#xA;

    The first starts recording using FFMPEG and stores the process PID in a .txt file.

    &#xA;

    StartRec.ps1

    &#xA;

    #Param&#xE8;tres de la cam&#xE9;ra IP&#xA;$cameraIP = $args[0]&#xA;$port = $args[1]&#xA;$username = $args[2]&#xA;$password = $args[3]&#xA;&#xA;$ipfile = ${cameraIP} -replace "\.", ""&#xA;$namefile = "video_"&#x2B;$ipfile&#x2B;"_"&#x2B;(Get-Date -Format "ddMMyyyy_HHmmss") &#x2B; ".mp4"&#xA;$namepidfile = "PID_"&#x2B;$ipfile&#x2B;".txt"&#xA;&#xA;# URL du flux vid&#xE9;o de la cam&#xE9;ra (exemple g&#xE9;n&#xE9;rique, adaptez-le &#xE0; votre cam&#xE9;ra)&#xA;$videoStreamUrl = "rtsp://${username}:${password}@${cameraIP}:${port}/videoMain"&#xA;&#xA;# R&#xE9;pertoire de sortie pour la vid&#xE9;o enregistr&#xE9;e&#xA;$outputDirectory = "C:\OutputDirectory"&#xA;&#xA;# Chemin complet du fichier de sortie (nom de fichier avec horodatage actuel)&#xA;$outputFile = Join-Path $outputDirectory (${namefile})&#xA;&#xA;# Commande FFmpeg pour enregistrer le flux vid&#xE9;o en arri&#xE8;re-plan&#xA;$ffmpegCommand = "ffmpeg -rtsp_transport tcp -i `"$videoStreamUrl`" -c:v copy `"$outputFile`"" &#xA;&#xA;# D&#xE9;marrer FFmpeg en arri&#xE8;re-plan&#xA;$process = Start-Process -FilePath "cmd.exe" -ArgumentList "/c $ffmpegCommand" -PassThru&#xA;&#xA;$cheminFichier = Join-Path $outputDirectory $namepidfile&#xA;&#xA;if (-not (Test-Path $cheminFichier)) {&#xA;    # Le fichier n&#x27;existe pas, cr&#xE9;er le fichier&#xA;    New-Item -ItemType File -Path $cheminFichier -Force&#xA;    Write-Host "Fichier cr&#xE9;&#xE9; : $cheminFichier"&#xA;} else {&#xA;    Write-Host "Le fichier existe d&#xE9;j&#xE0; : $cheminFichier"&#xA;}&#xA;&#xA;Start-Sleep -Seconds 5&#xA;&#xA;$processId = Get-WmiObject Win32_Process -Filter "Name=&#x27;ffmpeg.exe&#x27;" | Select-Object -ExpandProperty ProcessId&#xA;&#xA;# Enregistrez le PID dans un fichier&#xA;$process.Id | Out-File $cheminFichier&#xA;&#xA;Write-Host "Enregistrement d&#xE9;marr&#xE9;. PID du processus : $($processId)"&#xA;

    &#xA;

    The second reads the contents of this .txt file, stores it in a variable as a PID and stops the process via its Id, then closes the command window associated with this process (which tells the camera that the recording is finished).

    &#xA;

    StoptRec.ps1

    &#xA;

    $cameraIP = $args[0]&#xA;$ipfile = ${cameraIP} -replace "\.", ""&#xA;$namepidfile = "PID_"&#x2B;$ipfile&#x2B;".txt"&#xA;$outputDirectory = "C:\OutputDirectory"&#xA;$cheminFichier = Join-Path $outputDirectory $namepidfile&#xA;&#xA;$pidcontent = Get-Content $cheminFichier -Raw &#xA;if (-not $pidContent) {&#xA;    Write-Host "Erreur : Le fichier PID est vide. Assurez-vous que l&#x27;enregistrement est d&#xE9;marr&#xE9;."&#xA;    exit&#xA;}&#xA;&#xA;$processId  = $pidContent.Trim() -as [int]&#xA;&#xA;if (-not $processId) {&#xA;    Write-Host "Erreur : Impossible de convertir le contenu du fichier PID en entier."&#xA;    exit&#xA;}&#xA;&#xA;Get-Process -Id $processId&#xA;&#xA;Stop-Process -Id $processId -PassThru | Foreach-Object { $_.CloseMainWindow() }&#xA;&#xA;Write-Host "Enregistrement arr&#xEA;t&#xE9; pour le processus PID $processId"&#xA;Start-Sleep -Seconds 15&#xA;

    &#xA;

    The problem is that they work, except in one case that I'll explain :&#xA;First, I tried to run them via PowerShell, the recording starts up and the script works as expected, as does the shutdown. My final file is usable.&#xA;I then performed C# actions in my Controller, which calls and executes these scripts :

    &#xA;

    The action that calls StartRec.ps1

    &#xA;

            public void startRecordingCam1(string ipAddress)&#xA;        {&#xA;            string ps1File = @"C:\OutputDirectory\StartRec.ps1";&#xA;            string cameraIP = "Camera IP Adress";&#xA;            string port = "88";&#xA;            string username = "Username";&#xA;            string password = "Password";&#xA;&#xA;            Process process = Process.Start(new ProcessStartInfo&#xA;            {&#xA;                FileName = "powershell.exe",&#xA;                Arguments = $"-NoProfile -ExecutionPolicy Bypass -File \"{ps1File}\" \"{cameraIP}\" \"{port}\" \"{username}\" \"{password}\"",&#xA;                UseShellExecute = false,&#xA;                RedirectStandardInput = true&#xA;                //CreateNoWindow = true&#xA;            });&#xA;        }&#xA;

    &#xA;

    The action that calls StopRec.ps1

    &#xA;

           public void stopRecording(string ipAddress)&#xA;        {&#xA;            string ps1File = @"C:\Projet Valentin\CameraTest\StopRec_Csharp.ps1";&#xA;            string cameraIP = "10.0.1.10";&#xA;&#xA;            ProcessStartInfo startInfo = new ProcessStartInfo()&#xA;            {&#xA;                FileName = "powershell.exe",&#xA;                Arguments = $"-NoProfile -ExecutionPolicy ByPass -File \"{ps1File}\" \"{cameraIP}\" ",&#xA;                UseShellExecute = true&#xA;            };&#xA;            Process.Start(startInfo);&#xA;        }&#xA;

    &#xA;

    When I run the two scripts via these actions, StartRec.ps1 works well, but StopRec.ps1 doesn't work completely : the process is stopped, but the command window isn't closed, so camera recording continues (despite the end of the process).&#xA;As both scripts worked perfectly when launched with Powershell, but not with the C# application, I tried several combinations of "Start-Stop" with "PowerShell/C#".

    &#xA;

    If I run StartRec.PS1 with the C# application and StopRec.PS1 with PowerShell, it works.&#xA;If I run StartRec.PS1 with PowerShell and StopRec.PS1 with the C# application, it works.&#xA;If I run StartRec.PS1 with PowerShell and StopRec.PS1 with PowerShell, it works.&#xA;The only case that doesn't work is when I run both via the C# application

    &#xA;

    One thing I can add that I discovered while debugging is that this :&#xA;Stop-Process -Id $processId -PassThru | Foreach-Object { $_.CloseMainWindow() }

    &#xA;

    Returns false in the only case where it doesn't work, and true in all other cases

    &#xA;

    That's all the details I can give you, thanks for your help !

    &#xA;

  • how to download portion of video which was uploaded into AWS s3 bucket, though Nodejs SDKs

    22 février 2024, par rama rangeswara reddy

    I have uploaded a 1GB .mp4 file to an AWS S3 bucket. Using the AWS-SDK provided by the npm package, I am able to download the entire video. However, I have a specific requirement to generate a thumbnail at the 6-second mark of the video. Currently, I download the entire 1GB video to my local machine and then generate the thumbnail at the desired duration.

    &#xA;

    To optimize server resources and reduce disk load, I plan to download only the first 10 seconds of the video, which should be approximately 10MB or less in size. By doing so, I can significantly reduce download time and server load while still fulfilling my requirement of generating the thumbnail at the 6-second mark. Therefore, instead of downloading the entire 1GB video, I aim to download only the 10MB segment corresponding to the first 10 seconds of the video.

    &#xA;

    I am using nodejs, expressJS, as backed Technologies.

    &#xA;

    `

    &#xA;

    `async function downloadS3FileToLocalDirAndReturnPath(videoKey) {&#xA;    return new Promise(async (resolve, reject) => {&#xA;        try {&#xA;            AWS.config.update({&#xA;                accessKeyId: config.AWS.KEYS.accessKeyId,&#xA;                secretAccessKey: config.AWS.KEYS.secretAccessKey,&#xA;                region: config.AWS.KEYS.region,&#xA;                httpOptions: config.AWS.KEYS.httpOptions&#xA;            });&#xA;            const s3 = new AWS.S3();&#xA;&#xA;            // Specify the local file path where you want to save the downloaded video&#xA;            const localFilePath = `${os.tmpdir()}/${Date.now()}_sre.mp4`;&#xA;&#xA;            // Configure the parameters for the S3 getObject operation&#xA;            const params = {&#xA;                Bucket: config.AWS.S3_BUCKET,&#xA;                Key: videoKey&#xA;            };&#xA;&#xA;            const result = await s3.getObject(params).promise();&#xA;            const fileContent = result.Body;&#xA;            fs.writeFileSync(localFilePath, fileContent);&#xA;            resolve(localFilePath);&#xA;        } catch (error) {&#xA;            reject(error);&#xA;        }&#xA;    });&#xA;}`&#xA;

    &#xA;

    this code was working fine to download the whole video , but i need to download only first 10 seconds duration

    &#xA;

    S3 : How to do a partial read / seek without downloading the complete file ?

    &#xA;

    I tried this ,before posting this question with above post, video was downloading , it was not playing , by throwing this error , the file contains no playable streams

    &#xA;

    async function generateThumbnails(videoKey) {&#xA;&#xA;const s3 = new AWS.S3();&#xA;&#xA;const params = {&#xA;    Bucket: KEYS.bucket,&#xA;    Key: videoKey, // Specify the key of the video file in S3&#xA;    Range: `bytes=0-${1024 * 800}`, // Specify the range of bytes you want to retrieve&#xA;};&#xA;&#xA;const file = fs.createWriteStream(`/tmp/${Date.now()}_rama.mp4`);&#xA;&#xA;const s3Stream = s3.getObject(params).createReadStream();&#xA;&#xA;s3Stream.pipe(file);&#xA;&#xA;s3Stream.on("error", (error) => {&#xA;    console.log("Error Occured while File downloading!! ");&#xA;});&#xA;&#xA;s3Stream.on("finish", () => {&#xA;    console.log("File downloaded Successfully ");&#xA;});&#xA;

    &#xA;

    }

    &#xA;