Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP

Autres articles (58)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

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

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (11937)

  • Book Author not added to metadata

    1er décembre 2013, par Grandt
    Book Author not added to metadata
  • Why does ffmpeg parses an entire file beforehand

    10 juillet 2023, par Dmitrii Dunaev

    When calling avformat_open_input with AVIOContext set it seems that the library parses an entire file. I set both read and seek functions on the context. The video file is a fragmented mp4 with a lot of moof boxes. The file is located on a remote server. Each seek call is transformed into an http request. The library issues one seek for each moof. Is there any way to prevent avformat_open_input from parsing the entire file beforehand ? I would like to open the file and decode one frame at a specific time offset. Any suggestions ?

    


    Here is the snippet of GO code

    


    func (d *videoDecoder) init() error {
    avio_ctx_buffer := (*Cuint8_t)(lib.av_mallocz(avio_buffer_size))

    d.format_ctx = lib.avformat_alloc_context()
    d.avio_ctx = lib.avio_alloc_context(avio_ctx_buffer, Cint(avio_buffer_size), 0, uintptr(unsafe.Pointer(&d.ReadSeeker)), (Crw_packet_callback)(C.read_packet), nil, (Cseek_packet_callback)(C.seek_packet))
    d.format_ctx.pb = d.avio_ctx

    if ret := lib.avformat_open_input(&d.format_ctx, nil, nil, &d.options); ret < 0 {
        return fmt.Errorf("avformat open input: %w", convertRetCode(ret))
    }

    return nil
}

func read_packet(opaque unsafe.Pointer, buffer *Cuint8_t, size Cint) Cint {
    r := *(*io.ReadSeeker)(opaque)

    gobuf := (*[1 << 30]byte)(unsafe.Pointer(buffer))[:size:size]
    fmt.Printf("REQUESTED TO READ: %v\n", size)

    n, err := r.Read(gobuf)
    if err != nil {
        if errors.Is(err, io.EOF) {
            return CAVERROR_EOF
        }
        fmt.Printf("error reading from reader: %v\n", err)
    }

    return Cint(n)
}

//export seek_packet
func seek_packet(opaque unsafe.Pointer, offset Cint64_t, whence Cint) Cint64_t {
    r := *(*io.ReadSeeker)(opaque)

    fmt.Printf("REQUESTED TO SEEK: whence: %v offset: %v\n", int(whence), int64(offset))

    if whence == CAVSEEK_SIZE || whence == CAVSEEK_FORCE{
        return -1
    }

    n, err := r.Seek(int64(offset), int(whence))
    if err != nil {
        if errors.Is(err, io.EOF) {
            return -1
        }
        fmt.Printf("error seeking: %v\n", err)
    }

    return Cint64_t(n)
}


    


    And here is the output (truncated). It seeks to every single moof box.

    


    REQUESTED TO READ: 4196
REQUESTED TO SEEK: whence: 65536 offset: 0
REQUESTED TO SEEK: whence: 2 offset: -1
REQUESTED TO SEEK: whence: 0 offset: 4196
REQUESTED TO SEEK: whence: 65536 offset: 0
REQUESTED TO SEEK: whence: 2 offset: -1
REQUESTED TO SEEK: whence: 0 offset: 4196
REQUESTED TO SEEK: whence: 0 offset: 615080
REQUESTED TO READ: 4196
REQUESTED TO SEEK: whence: 65536 offset: 0
REQUESTED TO SEEK: whence: 2 offset: -1
REQUESTED TO SEEK: whence: 0 offset: 619276
REQUESTED TO SEEK: whence: 65536 offset: 0
REQUESTED TO SEEK: whence: 2 offset: -1
REQUESTED TO SEEK: whence: 0 offset: 619276
REQUESTED TO SEEK: whence: 65536 offset: 0
REQUESTED TO SEEK: whence: 2 offset: -1
REQUESTED TO SEEK: whence: 0 offset: 619276
REQUESTED TO SEEK: whence: 65536 offset: 0
REQUESTED TO SEEK: whence: 2 offset: -1
REQUESTED TO SEEK: whence: 0 offset: 619276
REQUESTED TO SEEK: whence: 65536 offset: 0
REQUESTED TO SEEK: whence: 2 offset: -1
REQUESTED TO SEEK: whence: 0 offset: 619276
REQUESTED TO SEEK: whence: 65536 offset: 0
REQUESTED TO SEEK: whence: 2 offset: -1
REQUESTED TO SEEK: whence: 0 offset: 619276
REQUESTED TO SEEK: whence: 65536 offset: 0
REQUESTED TO SEEK: whence: 2 offset: -1
REQUESTED TO SEEK: whence: 0 offset: 619276
REQUESTED TO SEEK: whence: 65536 offset: 0
REQUESTED TO SEEK: whence: 2 offset: -1
REQUESTED TO SEEK: whence: 0 offset: 619276
REQUESTED TO SEEK: whence: 65536 offset: 0
REQUESTED TO SEEK: whence: 2 offset: -1
REQUESTED TO SEEK: whence: 0 offset: 619276
REQUESTED TO SEEK: whence: 65536 offset: 0
REQUESTED TO SEEK: whence: 2 offset: -1
REQUESTED TO SEEK: whence: 0 offset: 619276
REQUESTED TO SEEK: whence: 0 offset: 1232664
REQUESTED TO READ: 4196
REQUESTED TO SEEK: whence: 65536 offset: 0
REQUESTED TO SEEK: whence: 2 offset: -1
REQUESTED TO SEEK: whence: 0 offset: 1236860
REQUESTED TO SEEK: whence: 65536 offset: 0
REQUESTED TO SEEK: whence: 2 offset: -1
REQUESTED TO SEEK: whence: 0 offset: 1236860
REQUESTED TO SEEK: whence: 65536 offset: 0
REQUESTED TO SEEK: whence: 2 offset: -1
REQUESTED TO SEEK: whence: 0 offset: 1236860
REQUESTED TO SEEK: whence: 65536 offset: 0
REQUESTED TO SEEK: whence: 2 offset: -1
REQUESTED TO SEEK: whence: 0 offset: 1236860
REQUESTED TO SEEK: whence: 65536 offset: 0
REQUESTED TO SEEK: whence: 2 offset: -1
REQUESTED TO SEEK: whence: 0 offset: 1236860
REQUESTED TO SEEK: whence: 65536 offset: 0
REQUESTED TO SEEK: whence: 2 offset: -1
REQUESTED TO SEEK: whence: 0 offset: 1236860
REQUESTED TO SEEK: whence: 65536 offset: 0
REQUESTED TO SEEK: whence: 2 offset: -1
REQUESTED TO SEEK: whence: 0 offset: 1236860
REQUESTED TO SEEK: whence: 65536 offset: 0
REQUESTED TO SEEK: whence: 2 offset: -1
REQUESTED TO SEEK: whence: 0 offset: 1236860
REQUESTED TO SEEK: whence: 65536 offset: 0
REQUESTED TO SEEK: whence: 2 offset: -1
REQUESTED TO SEEK: whence: 0 offset: 1236860
REQUESTED TO SEEK: whence: 65536 offset: 0
REQUESTED TO SEEK: whence: 2 offset: -1
REQUESTED TO SEEK: whence: 0 offset: 1236860
REQUESTED TO SEEK: whence: 0 offset: 1845238
REQUESTED TO READ: 4196
...


    


  • dnn : put DNNModel.set_input and DNNModule.execute_model together

    10 septembre 2020, par Guo, Yejun
    dnn : put DNNModel.set_input and DNNModule.execute_model together
    

    suppose we have a detect and classify filter in the future, the
    detect filter generates some bounding boxes (BBox) as AVFrame sidedata,
    and the classify filter executes DNN model for each BBox. For each
    BBox, we need to crop the AVFrame, copy data to DNN model input and do
    the model execution. So we have to save the in_frame at DNNModel.set_input
    and use it at DNNModule.execute_model, such saving is not feasible
    when we support async execute_model.

    This patch sets the in_frame as execution_model parameter, and so
    all the information are put together within the same function for
    each inference. It also makes easy to support BBox async inference.

    • [DH] libavfilter/dnn/dnn_backend_native.c
    • [DH] libavfilter/dnn/dnn_backend_native.h
    • [DH] libavfilter/dnn/dnn_backend_openvino.c
    • [DH] libavfilter/dnn/dnn_backend_openvino.h
    • [DH] libavfilter/dnn/dnn_backend_tf.c
    • [DH] libavfilter/dnn/dnn_backend_tf.h
    • [DH] libavfilter/dnn_interface.h
    • [DH] libavfilter/vf_derain.c
    • [DH] libavfilter/vf_dnn_processing.c
    • [DH] libavfilter/vf_sr.c