Recherche avancée

Médias (91)

Autres articles (21)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

Sur d’autres sites (5264)

  • avformat/utils : Use static mutexes instead of ff_lock_avformat()

    17 mai 2024, par Andreas Rheinhardt
    avformat/utils : Use static mutexes instead of ff_lock_avformat()
    

    Its existence is a remnant of (libavcodec's) lock-manager API
    which has been removed in a04c2c707de2ce850f79870e84ac9d7ec7aa9143.
    There is no need to use the same lock for avisynth, chromaprint
    or tls, so switch to ordinary static mutexes instead.

    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com>

    • [DH] libavformat/avisynth.c
    • [DH] libavformat/chromaprint.c
    • [DH] libavformat/internal.h
    • [DH] libavformat/tls_gnutls.c
    • [DH] libavformat/tls_openssl.c
    • [DH] libavformat/utils.c
  • lavc/qsv : fix the mfx allocator to support dynamic frame pool

    8 mai 2024, par Haihao Xiang
    lavc/qsv : fix the mfx allocator to support dynamic frame pool
    

    When the external allocator is used for dynamic frame allocation, only
    video memory is supported, the SDK doesn't lock/unlock the memory block
    via Lock()/Unlock() calls.

    Signed-off-by : Haihao Xiang <haihao.xiang@intel.com>

    • [DH] libavcodec/qsv.c
  • ffprobe different results video duration using pipe and reading a file from the file system

    5 février 2024, par alex

    I have a method to convert a video file, after processing the file I use pipe to pass bytes to a method to get meta information about the file using pipe. But in this case I get wrong duration of video file, 8.22, but if I save the file on file system and read it to get meta information I get result 15.85. Why is this happening ?

    &#xA;

    Video Convert method :

    &#xA;

    // ConvertVideoWithPath converts a video file specified by its path using FFmpeg.&#xA;// It returns the converted video data and any error that occurred during conversion.&#xA;func (f *FFmpeg) ConvertVideoWithPath(filePath string) (bytes []byte, err error) {&#xA;    if filePath == "" {&#xA;        return nil, ErrEmptyPath&#xA;    }&#xA;&#xA;    // Create a CmdRunner instance for executing FFmpeg.&#xA;    commander := &amp;CmdRunner{}&#xA;    commander.Command = "ffmpeg"&#xA;    args := []string{&#xA;        "-loglevel", "fatal",&#xA;        "-i", filePath,&#xA;        "-y",&#xA;        "-filter:v", "crop=trunc(iw/2)*2:trunc(ih/2)*2",&#xA;        "-c:v", f.videoCodec, // libx264&#xA;        "-c:a", f.audioCodec, // aac&#xA;        "-pix_fmt", "yuv420p",&#xA;        "-movflags", "frag_keyframe&#x2B;faststart",&#xA;        "-map_metadata", "-1",&#xA;        "-crf", "5",&#xA;        "-vsync", "2",&#xA;        "-bufsize", "15000000",&#xA;        "-maxrate", "5000000",&#xA;        "-preset", "medium",&#xA;        "-f", "mp4",&#xA;        "pipe:1",&#xA;    }&#xA;    commander.Args = args&#xA;&#xA;    // Initialize output pipe.&#xA;    reader := commander.InitStdOutPipe()&#xA;&#xA;    // Use WaitGroup to synchronize goroutines.&#xA;    wg := &amp;sync.WaitGroup{}&#xA;    wg.Add(1)&#xA;&#xA;    // Goroutine for reading data from the output pipe.&#xA;    go func() {&#xA;        defer reader.Close()&#xA;        defer wg.Done()&#xA;&#xA;        // Read data from the output pipe.&#xA;        data, _ := io.ReadAll(reader)&#xA;        // Safely update the &#x27;bytes&#x27; variable.&#xA;        f.mutex.Lock()&#xA;        bytes = data&#xA;        f.mutex.Unlock()&#xA;    }()&#xA;&#xA;    // Run the FFmpeg command with pipes and wait for completion.&#xA;    err = &lt;-commander.RunWithPipe()&#xA;    wg.Wait()&#xA;&#xA;    return&#xA;}&#xA;

    &#xA;

    // MetadataWithReader retrieves metadata from media data provided by an io.Reader using FFprobe.&#xA;// It returns the metadata and any error that occurred during metadata retrieval.&#xA;func (f *FFmpeg) MetadataWithReader(fileBytes io.Reader) (*Metadata, error) {&#xA;    if fileBytes == nil {&#xA;        return nil, ErrInvalidArgument&#xA;    }&#xA;&#xA;    // Create a CmdRunner instance for executing FFprobe.&#xA;    commander := &amp;CmdRunner{}&#xA;    commander.Command = "ffprobe"&#xA;    args := []string{&#xA;        "-loglevel", "fatal",&#xA;        "-i", "pipe:0",&#xA;        "-print_format", "json",&#xA;        "-show_format", "-show_streams",&#xA;        "-show_error",&#xA;    }&#xA;    commander.Args = args&#xA;&#xA;    // Get output data from FFprobe with pipes.&#xA;    err := commander.GetOutputWithPipe(fileBytes)&#xA;    if err != nil {&#xA;        return nil, err&#xA;    }&#xA;&#xA;    // Unmarshal JSON output into a Metadata struct.&#xA;    output := &amp;Metadata{}&#xA;    err = json.Unmarshal(commander.GetOutput(), output)&#xA;    if err != nil {&#xA;        return nil, err&#xA;    }&#xA;&#xA;    return output, err&#xA;}&#xA;

    &#xA;

    // MetadataWithPath extracts metadata of a file using FFprobe.&#xA;// It returns a Metadata struct or an error if the operation fails.&#xA;func (f *FFmpeg) MetadataWithPath(filePath string) (*Metadata, error) {&#xA;    if filePath == "" {&#xA;        return nil, ErrEmptyPath&#xA;    }&#xA;&#xA;    // Create a CmdRunner instance for executing FFprobe.&#xA;    commander := &amp;CmdRunner{}&#xA;    commander.Command = "ffprobe"&#xA;    args := []string{&#xA;        "-loglevel", "fatal",&#xA;        "-i", filePath,&#xA;        "-loglevel",&#xA;        "fatal",&#xA;        "-print_format", "json",&#xA;        "-show_format", "-show_streams", "-show_error",&#xA;    }&#xA;    commander.Args = args&#xA;    buffer := bytes.NewBuffer([]byte{})&#xA;    commander.StdOutWriter = buffer&#xA;&#xA;    err := commander.Run()&#xA;    if err != nil {&#xA;        return nil, err&#xA;    }&#xA;&#xA;    // Unmarshal JSON output into a Metadata struct.&#xA;    output := &amp;Metadata{}&#xA;    err = json.Unmarshal(buffer.Bytes(), output)&#xA;    if err != nil {&#xA;        return nil, err&#xA;    }&#xA;&#xA;    return output, nil&#xA;}&#xA;

    &#xA;

    The source code of the CmdRunner biblio library can be found here link , so as not to overload the question with a large piece of code.

    &#xA;

    Unit test code

    &#xA;

    t.Run("convert video", func(t *testing.T) {&#xA;        ffmpeg := NewFFmpeg("aac", "libx264", "24M", "12M")&#xA;&#xA;        filePath := "../../test/testdata/input_video_ts.mp4"&#xA;        firstMeta, err := ffmpeg.MetadataWithPath(filePath)&#xA;        assert.NoError(t, err)&#xA;        fmt.Print("first meta duration: ", firstMeta.Format.DurationSeconds) // 15.75&#xA;&#xA;        outFile := "../../test/testdata/output_mp4.mp4"&#xA;        newVideoOut, err := ffmpeg.ConvertVideoWithPath(filePath)&#xA;        assert.NoError(t, err)&#xA;        assert.NotEmpty(t, newVideoOut)&#xA;&#xA;        meta, err := ffmpeg.MetadataWithReader(bytes.NewBuffer(newVideoOut))&#xA;        assert.NoError(t, err)&#xA;        assert.NotEmpty(t, meta)&#xA;&#xA;        err = os.WriteFile(outFile, newVideoOut, 0644)&#xA;        assert.NoError(t, err)&#xA;        assert.FileExists(t, outFile)&#xA;&#xA;        fmt.Print("meta duration: ", meta.Format.DurationSeconds) // 8.22&#xA;&#xA;        secondMeta, err := ffmpeg.MetadataWithPath(outFile)&#xA;        assert.NoError(t, err)&#xA;        fmt.Print("second meta duration: ", secondMeta.Format.DurationSeconds) //15.85&#xA;&#xA;        err = os.Remove(outFile)&#xA;        assert.NoError(t, err)&#xA;    })&#xA;

    &#xA;