Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (95)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • 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 (...)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

Sur d’autres sites (8196)

  • Encoding from FFMPEG to MPEG-DASH, WebM with Keyframe Clusters to work with MediaSource API

    1er mai 2016, par Chris Nolet

    I’m currently sending a video stream to Chrome, to play via the MediaSource API.

    As I understand it, MediaSource only supports MP4 files encoded with MPEG-DASH, or WebM files that have clusters beginning with keyframes (otherwise it raises the error : Media segment did not begin with keyframe).

    Is there any way to encode in MPEG-DASH or keyframed WebM formats with FFMPEG in real-time ?

    EDIT :

    I just tried it with ffmpeg ... -f webm -vcodec vp8 -g 1 ... so that every frame is a keyframe. Not the ideal solution. It does work with MediaStream now though. Any way to sync up the segments with the keyframes in WebM so not every frame needs to be a keyframe ?


    Reference Questions on WebM / MP4 and MediaSource :

    Media Source Api not working for a custom webm file (Chrome Version 23.0.1271.97 m)

    MediaSource API and mp4

  • 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.
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.
To achieve this, I looked for several solutions and finally decided to use FFMPEG and two Powershell scripts.

    


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

    


    StartRec.ps1

    


    #Paramètres de la caméra IP
$cameraIP = $args[0]
$port = $args[1]
$username = $args[2]
$password = $args[3]

$ipfile = ${cameraIP} -replace "\.", ""
$namefile = "video_"+$ipfile+"_"+(Get-Date -Format "ddMMyyyy_HHmmss") + ".mp4"
$namepidfile = "PID_"+$ipfile+".txt"

# URL du flux vidéo de la caméra (exemple générique, adaptez-le à votre caméra)
$videoStreamUrl = "rtsp://${username}:${password}@${cameraIP}:${port}/videoMain"

# Répertoire de sortie pour la vidéo enregistrée
$outputDirectory = "C:\OutputDirectory"

# Chemin complet du fichier de sortie (nom de fichier avec horodatage actuel)
$outputFile = Join-Path $outputDirectory (${namefile})

# Commande FFmpeg pour enregistrer le flux vidéo en arrière-plan
$ffmpegCommand = "ffmpeg -rtsp_transport tcp -i `"$videoStreamUrl`" -c:v copy `"$outputFile`"" 

# Démarrer FFmpeg en arrière-plan
$process = Start-Process -FilePath "cmd.exe" -ArgumentList "/c $ffmpegCommand" -PassThru

$cheminFichier = Join-Path $outputDirectory $namepidfile

if (-not (Test-Path $cheminFichier)) {
    # Le fichier n'existe pas, créer le fichier
    New-Item -ItemType File -Path $cheminFichier -Force
    Write-Host "Fichier créé : $cheminFichier"
} else {
    Write-Host "Le fichier existe déjà : $cheminFichier"
}

Start-Sleep -Seconds 5

$processId = Get-WmiObject Win32_Process -Filter "Name='ffmpeg.exe'" | Select-Object -ExpandProperty ProcessId

# Enregistrez le PID dans un fichier
$process.Id | Out-File $cheminFichier

Write-Host "Enregistrement démarré. PID du processus : $($processId)"


    


    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).

    


    StoptRec.ps1

    


    $cameraIP = $args[0]
$ipfile = ${cameraIP} -replace "\.", ""
$namepidfile = "PID_"+$ipfile+".txt"
$outputDirectory = "C:\OutputDirectory"
$cheminFichier = Join-Path $outputDirectory $namepidfile

$pidcontent = Get-Content $cheminFichier -Raw 
if (-not $pidContent) {
    Write-Host "Erreur : Le fichier PID est vide. Assurez-vous que l'enregistrement est démarré."
    exit
}

$processId  = $pidContent.Trim() -as [int]

if (-not $processId) {
    Write-Host "Erreur : Impossible de convertir le contenu du fichier PID en entier."
    exit
}

Get-Process -Id $processId

Stop-Process -Id $processId -PassThru | Foreach-Object { $_.CloseMainWindow() }

Write-Host "Enregistrement arrêté pour le processus PID $processId"
Start-Sleep -Seconds 15


    


    The problem is that they work, except in one case that I'll explain :
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.
I then performed C# actions in my Controller, which calls and executes these scripts :

    


    The action that calls StartRec.ps1

    


            public void startRecordingCam1(string ipAddress)
        {
            string ps1File = @"C:\OutputDirectory\StartRec.ps1";
            string cameraIP = "Camera IP Adress";
            string port = "88";
            string username = "Username";
            string password = "Password";

            Process process = Process.Start(new ProcessStartInfo
            {
                FileName = "powershell.exe",
                Arguments = $"-NoProfile -ExecutionPolicy Bypass -File \"{ps1File}\" \"{cameraIP}\" \"{port}\" \"{username}\" \"{password}\"",
                UseShellExecute = false,
                RedirectStandardInput = true
                //CreateNoWindow = true
            });
        }


    


    The action that calls StopRec.ps1

    


           public void stopRecording(string ipAddress)
        {
            string ps1File = @"C:\Projet Valentin\CameraTest\StopRec_Csharp.ps1";
            string cameraIP = "10.0.1.10";

            ProcessStartInfo startInfo = new ProcessStartInfo()
            {
                FileName = "powershell.exe",
                Arguments = $"-NoProfile -ExecutionPolicy ByPass -File \"{ps1File}\" \"{cameraIP}\" ",
                UseShellExecute = true
            };
            Process.Start(startInfo);
        }


    


    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).
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#".

    


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

    


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

    


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

    


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

    


  • How does subtitle hardcoding work in ffmpeg ?

    1er avril 2016, par Ketan Kulkarni

    The manual for the same is available on :
    http://superuser.com/questions/838072/ffmpeg-hardcoding-burning-filename-in-video
    https://trac.ffmpeg.org/wiki/HowToBurnSubtitlesIntoVideo

    Sample command is :
    ffmpeg -i video.avi -vf subtitles=subtitle.srt out.avi