Recherche avancée

Médias (1)

Mot : - Tags -/ogv

Autres articles (36)

  • Gestion générale des documents

    13 mai 2011, par

    MédiaSPIP ne modifie jamais le document original mis en ligne.
    Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
    Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)

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

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

  • How to improve Video Trimming & Merging Performance for Mobile App [closed]

    5 mai 2024, par Harpreet Singh.8052

    I am in the process of developing an app that will allow users to trim and merge recorded videos similar to Snapchat and Instagram stories. Currently, I am using FFmpeg for video processing, but it is taking too long to complete. I have come up with an idea to use ExoPlayer to minimize processing time. My plan is to store the trimmed duration of multiple videos and only play the trimmed part when the video is played. ExoPlayer allows playing multiple videos seamlessly, so it will appear as if the videos have been trimmed and merged. However, I am uncertain about how to handle video playback on the server-side when a user uploads all the videos and metadata about the video, such as the trimmed part from where to where they want to play. If I follow this approach, I will need to first get all the videos to the user's device before playback, but the videos can be long, ranging from 10 to 30 minutes, making this approach impractical. I would like to play them in a video stream manner. 

    


    I am also curious about how other video editing apps such as CapCut or Kinemaster handle video processing tasks like trimming, merging, and slow-mo. What video processing tools do they use ? When I tried merging ten one-minute videos, it took around 10 minutes on my Android phone, but these editing apps take less time. 

    


    I would appreciate any approach or idea to improve the processing time for video trimming and merging

    


  • How to change resolution without compromising video quality using ffmpeg ?

    20 mars 2024, par blake banker

    I'm trying to develop a simple video transcoding system.
When you upload a video,
After extracting the video and audio separately,
I want to encode them at 360, 720, and 1080p resolutions respectively and then merge them to create three final mp4 files.
At this time, I have two questions.

    


      

    1. Is there a big difference between encoding the video and audio separately in the original video file and encoding the original video file as is ? In a related book, it is said that a system is created by separating video and audio, and I am curious as to why.

      


    2. 


    3. I want to change the resolution without compromising the original image quality. At this time, the resolution of the uploaded file can be known at the time of upload. As a test, I created files according to each resolution, and found that the image quality was damaged. If I want to change only the resolution while keeping the original image quality, I would like to know how to adjust each ffmpeg option. We plan to change it to 360, 720, and 1080p.

      


    4. 


    


  • 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 !