Recherche avancée

Médias (1)

Mot : - Tags -/belgique

Autres articles (106)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Formulaire personnalisable

    21 juin 2013, par

    Cette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
    Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire. (...)

  • Qu’est ce qu’un masque de formulaire

    13 juin 2013, par

    Un masque de formulaire consiste en la personnalisation du formulaire de mise en ligne des médias, rubriques, actualités, éditoriaux et liens vers des sites.
    Chaque formulaire de publication d’objet peut donc être personnalisé.
    Pour accéder à la personnalisation des champs de formulaires, il est nécessaire d’aller dans l’administration de votre MediaSPIP puis de sélectionner "Configuration des masques de formulaires".
    Sélectionnez ensuite le formulaire à modifier en cliquant sur sont type d’objet. (...)

Sur d’autres sites (10053)

  • Why does the PyAV-encoded video have a different total time in seconds than the original file

    13 octobre 2023, par Diego Medeiros

    I'm taking a mp4 file, decoding it frame by frame and reencoding it. I'm using PyAV and the reencoding is running on h265.
When the code is running, it seems that all frames are passed from the decoder to the encoder, but at the end I have a file with 3 seconds less. For longer videos I'll have bigger differences.

    


    I have already checked the fps, it comes out with a very small variation, even if I use the Fraction type to avoid decimal differences.

    


    I'd like to know if it's some parametrization error, or if this is something to do with the encoder itself like keyframes and all those sort of things. Is there a way to fix it ?

    


    import av


container = av.open('input.mp4')

# create an output container to receive the transcoded video packets
output_container = av.open('output.mp4', 'w', format='mp4')
# add a stream to output container with same fps as input and h265 codec
output_stream = output_container.add_stream(
    'libx265', rate=container.streams.video[0].average_rate)
# set the output stream size
output_stream.width = 640
output_stream.height = 480

print('Starting transcoding...')

actual_frame = 0
container_total_frames = container.streams.video[0].frames

# start decoding packets and reading frames from the container
try:
    for packet_input in container.demux():
        if packet_input.dts is None:
            break
        for frame in packet_input.decode():

            try:
                actual_frame += 1
                # convert the frame to a numpy array
                img = frame.to_ndarray(format='bgr24')

                # prepare the ndarray frame and encode it
                frame_nd = av.VideoFrame.from_ndarray(img, format='bgr24')
                packet_output = output_stream.encode(frame_nd)
                output_container.mux(packet_output)
                print('Frame: {}/{}'.format(actual_frame, container_total_frames))
            except Exception as e:
                print("Error writing frame: ", e)
                break
except Exception as e:
    print('Finished transcoding')

output_container.close()

print('Finished transcoding')



    


  • ffmpeg makes video with no sound on video.js

    21 septembre 2023, par Laurent B

    I have this code that creates m3u8 file to stream a mkv file after transcoding.

    


    ffmpeg.setFfmpegPath(ffmpegPath);
childProcess = ffmpeg()
    .input(inputFilePath)
    // .native()
    .inputOptions(['-y', '-progress', 'pipe:1'])
    .outputOptions(['-b:v 1M', '-hls_time 2', '-hls_list_size 0', '-hls_segment_size 500000'])
    .output('public/output.m3u8')
    .on('end', () => {
        io.emit('conversionComplete', { percent: 100, time: totalDuration, totalDuration, timemark: millisecondsToTimeString(totalDuration) });
        childProcess = null
    })
    .on('error', (error) => {
        io.emit('conversionError', { error });
        childProcess = null
    })
    .on('progress', (progress) => {
        io.emit('conversionProgress', { ...progress, time: timeStringToMilliseconds(progress.timemark), totalDuration });
    });

childProcess.run();


    


    The m3u8 is readable by VLC Player and video.js and can be casted to Chrome Cast. For some others, 4Go files moreless, it works only when the video is transcoded without sound with option .inputOption('-an').

    


    Here's the content of m3u8

    


    #EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:4
#EXTINF:10.000000,
output4.ts
#EXTINF:10.000000,
output5.ts
#EXTINF:8.640000,
output6.ts
#EXTINF:10.000000,
output7.ts
#EXTINF:10.000000,
output8.ts


    


      

    • I tried with all possible audio codecs provided by ffmpeg
    • 


    • I tried with bigger/smaller parts for ts files
    • 


    • I tried with other bitrate
    • 


    


    Thanks in advance for your ideas

    


  • ffmpeg scale question.It succeed when the size is 2048,but when 4096 failed [closed]

    7 septembre 2023, par 徐谷歌

    if :

    


    ffmpeg -y -loop 1 -i ./rebirth/image4.png -loop 1 -t 1.4 -i temp.png -filter_complex "[0]scale=2048:2048[video0],[video0][1]xfade=transition=fade:duration=0.8:offset=0.1" -c:v libx264 -r 30 -pix_fmt yuv444p temp.mp4


    


    it goes right.but when temp.png is bigger,it goes wrong,like :

    


    ffmpeg -y -loop 1 -i ./rebirth/image4.png -loop 1 -t 1.4 -i temp.png -filter_complex "[0]scale=4096:4096[video0],[video0][1]xfade=transition=fade:duration=0.8:offset=0.1" -c:v libx264 -r 30 -pix_fmt yuv444p temp.mp4


    


    I have enlarge the temp.png in the 2nd example.the size of image4.png is 1152x1152.