Recherche avancée

Médias (1)

Mot : - Tags -/école

Autres articles (111)

  • Gestion générale des documents

    13 mai 2011, par

    MédiaSPIP ne modifie jamais le document original mis en ligne.
    Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
    Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (11931)

  • Switching YouTube Live Stream Source FFMPEG

    26 juillet 2023, par AsadSMalik

    I'm experimenting with a live stream on YouTube where I can switch the source of it based on some external inputs. So for example, I have two webcams and by default the live stream shows the stream from webcam 1. Then based on some input, it needs to switch to broadcasting the stream from webcam 2. This is what I have so far but it disrupts the stream with the buffering loading circle before it switches to the second one instead of being like an instant switch.

    


    This is the code I'm using to create the ffmpeg command which runs to stream to YouTube.

    


    def create_ffmpeg_cmd(cam_uri):
    return ['ffmpeg',
            '-i', cam_uri,
            '-c:v', 'libx264',
            '-f', 'flv',
            f"{YOUTUBE_STREAM_URI}/{YOUTUBE_STREAM_KEY}"
            ]


    


    This is the code block which runs to switch streams when next_stream_uri is updated.

    


        def run(self, *args, **kwargs):
        command = create_ffmpeg_cmd(DEFAULT_CAM_URI)
        p = sp.Popen(command, stdin=sp.PIPE)
        stream_uri = self.next_stream_uri
        while True:
            if self.next_stream_uri != stream_uri:
                print(f"Changing stream from {stream_uri} to {self.next_stream_uri} ...")
                stream_uri = self.next_stream_uri
                cmd = create_ffmpeg_cmd(stream_uri)
                new_p = sp.Popen(cmd, stdin=sp.PIPE)
                time.sleep(1)
                p.terminate()
                p = new_p


    


    I put in the time.sleep(1) before terminating the first one to see if that works but I still see some buffering happening. Not sure if it's even possible to achieve a seamless switch but wanted to see if there are some better ways of doing it.

    


  • FFmpeg YouTube live streaming automatically stopped after some time (6- 9 min) RTMP node js

    30 juin 2020, par Avneesh Singh

    I am developing a feature where I am capturing the desktop screen and live streaming on YouTube by using the FFmpeg module. The streaming is working fine but the problem is it stopped automatically after some time like 6-9 min and YouTube is showing "no data" receiving.
Below I attached the code.
const process = spawn(pathToFfmpeg,["-probesize", "10M", "-f", "gdigrab", "-i", "desktop", "-framerate", "30", "-f", "dshow", "-i", "audio= Microphone (2 - USB audio device)", "-filter_complex", "amix=inputs=1", "-preset", "fast", "-g", "60", "-tune", "zerolatency", "-c:v", "libx264", "-crf", "10", "-pix_fmt", "yuv420p", "-map", "0", "-maxrate", "1M", "-bufsize", "2M", "-vsync", "vfr", "-acodec", "pcm_s16le", "-b:v", "4500k", "-b:a", "128k", "-f", "flv", "-", ], 
stdio : "pipe"

) ;

    


    after that, I am encoding it by using FFmpeg path.
let proc = ffmpeg(stream).size('1920x1080').videoBitrate('4500k').videoCodec('libx264').fps(30).audioBitrate('128k').audioCodec('aac').audioFrequency(22050).audioChannels(2).toFormat('flv').on('end', () => console.log('file has been converted succesfully') ;).on('error', (err) => console.log('an error happened : ' + err) ;).save(publish) ;

    


  • Piping output of youtube-dl to a script using ffmpeg looks ok using echo but returns an error when executing

    22 février 2016, par user556068

    I am trying to use youtube-dl to get the urls of some videos and then pipe the resulting urls into the input of my script. So in my terminal I do

    youtube-dl --ignore-config -iga ~/Desktop/youtube/videolist.txt | myscript.sh

    In my script I define things as

    command='ffmpeg'        
    inputArgs='-i'              
    outputArgs='-c:v libx264 -preset ultrafast -qp 0'      
    directory="${HOME}/Desktop/Videos/"
    output="video${count}"      
    extension='mp4'        

    I test it with echo to make sure everything appears in the correct order.

    echo "${command}" "${inputArgs}" "${input}" "${outputArgs}" \
    "${directory}""${output}${count}"."${extension}"

    And the output from that looks correct. But when I try to run the same thing without the preceding echo command, i.e.,

    "${command}" "${inputArgs}" "${input}" "${outputArgs}" \
    "${directory}""${output}${count}"."${extension}"

    I get an error message that says

    At least one output file must be specified.

    So it seems pretty obvious to me that I’m doing something wrong when attempting to execute it.

    I have tried :

    • quoting the entire line as a whole
    • quoting different sections together
    • using the exec command in front of everything

    No matter what I do, an error occurs at some point in the process. I know it’s something simple I’m doing wrong. Would someone please enlighten me as to what that might be ?

    I feel very strongly that the . shouldn’t just be in the middle of everything like that, but I really don’t know.

    Again, everything looks as it should when I run echo before the string of shell parameters.

    If more of the script I’m using is needed to understand what I’m talking about, that is not a problem.