Recherche avancée

Médias (91)

Autres articles (69)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

  • Les statuts des instances de mutualisation

    13 mars 2010, par

    Pour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
    Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...)

Sur d’autres sites (15103)

  • torchaudio.io.StreamReader doesn't throw error when seeking to time stamp more than the duration of audio file

    27 mars 2023, par lokesh

    I am trying to get the audio chunk of audio file between specific start time and end time

    


    Consider a audio of duration 10 seconds. Now i need to get chunk from 4 sec to 7 sec

    


    torchaudio.info doesn't give correct num_frames for io.BytesIO flac audio file. So there is no way to find the total number of frames in the given audio to check for out of bounds start offset
Ref : https://github.com/pytorch/audio/issues/2524

    


    What I did to get the chunk of audio with start and end offsets.

    


    def read_audio(audio_file, start, end):
    audio_file.seek(0)
    reader = StreamReader(audio_file)
    sample_rate = int(reader.get_src_stream_info(reader.default_audio_stream).sample_rate)

    reader.seek(start * sample_rate)
    reader.add_basic_audio_stream(frames_per_chunk=(end - start) * sample_rate)

    return list(reader.stream())[0].pop()


    


    This is working as intended for start time less than the duration of audio file. But when we give the start time more than the duration of audio file, It doesn't throw error or return empty tensor.
Is there any way to know the given offsets are out of bounds.

    


  • PHP-FFMpeg filters()->resize() throw Use of undefined constant RESIZEMODE_INSET

    27 février 2023, par Angus Simons

    I'm using PHP-FFMpeg to use FFMpeg with php, unfortunately I can't set resize filter.

    



    This is my code :

    



    $video = $ffmpeg->open('video.mov');

$dimension = new FFMpeg\Coordinate\Dimension(1920, 1080);
$video->filters()
      ->resize($dimension, RESIZEMODE_INSET, true, 1)
      ->synchronize();

$format = new FFMpeg\Format\Video\X264('aac', 'libx264');
$format->setAudioChannels(2)->setAudioKiloBitrate(256);
$video->save($format, 'video.mp4');


    



    But it throws this error :

    



    Use of undefined constant RESIZEMODE_INSET - assumed 'RESIZEMODE_INSET'

    



    I tried also :

    



    ->resize($dimension, 'RESIZEMODE_INSET', true, 1)

    



    and

    



    ->resize($dimension, 'inset', true, 1)

    



    But I can't get the video converted without stretching.

    



    Thanks in advance

    


  • How to make ffmpeg to throw exception on try/catch for working directory and for arguments ?

    30 juin 2022, par Sharo SA

    If for example i'm setting the FileName(outputDirectory) to null it will throw exception.

    


    The class when i'm using process of the ffmpeg.exe :

    


    public void Start()
        {
            process = new Process();
            process.StartInfo.FileName = outputDirectory; // Change the directory where ffmpeg.exe is.  
            process.EnableRaisingEvents = false;
            process.StartInfo.WorkingDirectory = workingDirectory; // The output directory  
            process.StartInfo.Arguments = arguments;
            process.StartInfo.UseShellExecute = false;
            process.StartInfo.RedirectStandardInput = true; //Redirect stdin
            process.StartInfo.CreateNoWindow = true;
            process.Start();

            errorMessage = false;
            startRecord = true;
        }


    


    but if i'm setting the WorkingDirectory to null or entering some not valid Arguments like "sadasdasd" it will not throw exception not on the WorkingDirectory and not on the Arguments.

    


    In Form1 :

    


    private void recordStripMenuItem_Click(object sender, EventArgs e)
        {
            recordToggle = !recordToggle;

            if (recordToggle)
            {
                try
                {
                    record.workingDirectory = settingsForm.workingDirectory;
                    record.outputDirectory = settingsForm.outputDirectory;
                    record.arguments = settingsForm.arguments;
                    record.Start();
                }
                catch(Exception ex)
                {
                    recordStripMenuItem.Text = "Record";
                    Icon = iconGreen;
                    TextInfo("Waiting");
                    recordToggle = false;
                    MessageBox.Show("Arguments are not valid : " + ex.Message);
                    
                }
                if (!FFmpeg_Capture.errorMessage)
                {
                    settingsForm.Close();
                    recordStripMenuItem.Text = "Stop";
                    Icon = iconRed;
                    TextInfo("Recording");
                }
            }
            else
            {
                recordStripMenuItem.Text = "Record";
                Icon = iconGreen;
                TextInfo("Waiting");
                record.Stop();
            }
        }


    


    The variable record is instance of the FFmpeg_Capture class with the process of the ffmpeg.
It's throwing exception only on the FileName(outputDirectory).