Recherche avancée

Médias (91)

Autres articles (63)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • Sélection de projets utilisant MediaSPIP

    29 avril 2011, par

    Les exemples cités ci-dessous sont des éléments représentatifs d’usages spécifiques de MediaSPIP pour certains projets.
    Vous pensez avoir un site "remarquable" réalisé avec MediaSPIP ? Faites le nous savoir ici.
    Ferme MediaSPIP @ Infini
    L’Association Infini développe des activités d’accueil, de point d’accès internet, de formation, de conduite de projets innovants dans le domaine des Technologies de l’Information et de la Communication, et l’hébergement de sites. Elle joue en la matière un rôle unique (...)

Sur d’autres sites (5846)

  • Continously read file in Ruby and save into pipe

    7 juillet 2016, par stiller_leser

    I am trying to continously read a file and save the output into a IO.pipe. The motivation being that ffmpeg which has been spawned before and given the r-end of the pipe as STDIN will then convert the video.
    This is what I have so far :

       r,w = IO.pipe
       ffmpeg_args = ' -i pipe:0 "test.mp4"'
       pid = Process.spawn('ffmpeg'+ffmpeg_args, {STDIN => r, STDERR => STDOUT})
       Process.detach pid
       File.open(@options['filename'], 'rb') do |file|
         while line = file.gets
           w.write line.read
         end
       end

    I had success with declaring the input file directly as STDIN for the process, but this lead to an early termination of ffmpeg since it had reached the end of the file. With the code above ffmpeg complains about invalid data.

    Is there any way this could be achieved ?

  • Read the audio file while it's being written in NodeJS

    21 novembre 2017, par user3170450

    I am capturing audio through alsa using ffmpeg and writing it to a wav file. But as it’s being written I need to send the captured audio to some 3rd party. I have tried few methods including node-growing-file but not able to succeed.

    Is there a way I can read the file as a stream as long as it’s being written and process it as required.

  • Can I know which byte range to read from a remote mp4 file for FFMpeg to decode a keyframe ?

    12 octobre 2023, par db9117

    I need to decode a of keyframe of a video file (mp4, h264 encoded). I know the timestamp of the keyframe I want to extract/decode. I want to minimize amount of data being read in memory. For this, I need to know beforehand exactly the minimal byte range I would require that encompasses this keyframe. How do I know what is the minimal byte range in the whole mp4 byte stream I need to read in order to be able to decode the keyframe ?

    


    I currently find the appropriate keyframe in the index_entries contained in the header. I get its byte position (pos attribute) and timestamp (timestamp attribute). I calculate the range as follows :

    


    startBytes : minimum of :

    


      

    1. the pos of the keyframe
    2. 


    3. the pos of the nearest index entry in the audio stream happening at or before the keyframe's timestamp.
    4. 


    


    This way when it's decoding the frame, if it also needs the audio content for demuxing, it would have it.

    


    endBytes : maximum of :

    


      

    1. the pos of the next frame in the video stream's index, after the keyframe
    2. 


    3. the pos of the next frame in the audio stream's index after the timestamp of the wished keyframe.
    4. 


    


    This way I know that I have everything up until the next frame in the index, which theoretically should be enough to decode the keyframe only.

    


    I then read the appropriate byte range.

    


    When I try to decode the frame, I run in a loop until I succeed :

    


      

    • avcodec_read_frame
    • 


    • avcodec_send_packet
    • 


    • avcodec_receive_frame
    • 


    


    I ignore AVERROR(EAGAIN) errors.

    


    avcodec_receive_frame fails multiple times with error AVERROR(EAGAIN) which I ignore, until it fails saying that the memory it wants to read isn't available (wants to read after endBytes). I explicitly tell it to fail if it wants to read more than it has already read.

    


    Note : for other keyframes at other positions in other videos, it sometimes succeeds (probably because the range is big enough by chance), but it fails more often than not.

    


    My question is : Why is the end of the range not enough to be able to decode only the one keyframe ? Is there any way to more precisely calculate the exact range in bytes I would need in order to decode a particular keyframe ?