Recherche avancée

Médias (91)

Autres articles (82)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

Sur d’autres sites (11946)

  • unable to play AES-CBC encrypted mpeg-ts stream on ffplay/ffmpeg

    22 mai 2022, par AquilaCoder

    how to play a encrypted camera/live stream using ffplay/ffmpeg.

    


    the original stream was encrypted with tsduck scrambler plugin with aes-cbc option, we have tried with many players nothing works.

    


      

    • iv : 627CBD824E93CDC9DA754BAC72DB2205
    • 


    • cw : 6CC47461F65084AB5C5F90EDA1C2F9F0
    • 


    


    stream info

    


    enter image description here

    


    sample stream

    


  • Play video using ffmpeg subprocess

    17 juin 2023, par MCD

    The following code stuck in the middle of the video. I want to play the video start at start_seconds and end at end_seconds.

    


    import subprocess
import cv2
import numpy as np
import subprocess

def play_video_with_ffmpeg(video_path, start_seconds, end_seconds):
print(start_seconds)

    # Set the desired frame size
    width = 920
    height = 600
    
    # Set the window position
    print("here")
    window_x = 600  # X position
    window_y = 10  # Y position
    cv2.namedWindow('Video Player', cv2.WINDOW_NORMAL)
    cv2.moveWindow('Video Player', window_x, window_y)
    
    # Build the ffmpeg command to skip to the desired start time and end time
    command = [
        'ffmpeg',
        '-ss', str(start_seconds),
        '-i', video_path,
        '-t', str((end_seconds - start_seconds)),
        '-vf', f'scale={width}:{height}',
        '-r', '30',
        '-f', 'image2pipe',
        '-pix_fmt', 'bgr24',
        '-vcodec', 'rawvideo',
        '-'
    ]
    
    # Open a subprocess to execute the ffmpeg command
    process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    
    # Create a buffer to hold the frame data
    buffer_size = width * height * 3
    frame_buffer = bytearray(buffer_size)
    
    while process.poll() is None:
        # Read the frame from the subprocess stdout into the buffer
        bytes_read = process.stdout.readinto(frame_buffer)
    
        if bytes_read == buffer_size:
            # Convert the frame buffer to a numpy array
            frame = np.frombuffer(frame_buffer, dtype='uint8').reshape((height, width, 3))
    
            # Resize the frame
            frame_resized = cv2.resize(frame, (width, height), interpolation=cv2.INTER_AREA)
    
            # Display the frame
            cv2.imshow('Video Player', frame_resized)
    
            if cv2.waitKey(1) & 0xFF == ord('q'):
                break
    
    process.stdout.close()
    process.stderr.close()
    cv2.destroyAllWindows()


    


    I expect to play the video start from start_second and end at end_second. I used cv2.set but it took long time to play from start_second.

    


  • Could you please guide me on how to play a single sample of an audio file in C# using FFmpeg ?

    11 juillet 2023, par hello world

    What is the recommended approach for playing a single sample of an audio file in C# using FFmpeg ? I would like to incorporate FFmpeg into my C# application to play a specific sample from an audio file. Could someone provide an example or guide me on how to achieve this ? Any help would be appreciated.

    


    using System;
using System.Diagnostics;

public class AudioPlayer
{
    private string ffmpegPath;

    public AudioPlayer(string ffmpegPath)
    {
        this.ffmpegPath = ffmpegPath;
    }

    public void PlayAudioSample(string audioFilePath, TimeSpan samplePosition)
    {
        // Prepare FFmpeg process
        Process ffmpegProcess = new Process();
        ffmpegProcess.StartInfo.FileName = ffmpegPath;
        ffmpegProcess.StartInfo.Arguments = $"-ss {samplePosition} -i \"{audioFilePath}\" -t 1 -acodec pcm_s16le -f wav -";
        ffmpegProcess.StartInfo.RedirectStandardOutput = true;
        ffmpegProcess.StartInfo.RedirectStandardError = true;
        ffmpegProcess.StartInfo.UseShellExecute = false;
        ffmpegProcess.StartInfo.CreateNoWindow = true;

        // Start FFmpeg process
        ffmpegProcess.Start();

        // Play audio sample
        using (var audioOutput = new NAudio.Wave.WaveOutEvent())
        {
            using (var audioStream = new NAudio.Wave.RawSourceWaveStream(ffmpegProcess.StandardOutput.BaseStream, new NAudio.Wave.WaveFormat(44100, 16, 2)))
            {
                audioOutput.Init(audioStream);
                audioOutput.Play();
                while (audioOutput.PlaybackState == NAudio.Wave.PlaybackState.Playing)
                {
                    System.Threading.Thread.Sleep(100);
                }
            }
        }

        // Wait for FFmpeg process to exit
        ffmpegProcess.WaitForExit();
    }
}