Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (52)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (8161)

  • Discord FFMPEG audio wont play from yt-dlp

    19 mars 2023, par user21236822

    My question is this : Why isn't my bot playing audio ?

    


    I want the bot to join, play audio from queue, then disconnect without downloading an mp3 file.

    


    I tried using youtube-dl, but I switched to the yt-dlp library after getting errors I couldn't fix.
I am running on Windows 10 locally. All my libraries are up to date.

    


    Here are my ydl_opts and FFMPEG_OPTS :

    


    ydl_opts = {
    'format': 'bestaudio/best',
    'postprocessors': [{
        'key': 'FFmpegExtractAudio',
        'preferredcodec': 'mp3',
        'preferredquality': '192',
    }],
}

FFMPEG_OPTIONS = {
    'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5',
    'options': '-vn'
} 


    


    Here is where I believe the problem is.

    


    async def play():
    print("Play Called")
    musicPlay()
    # Get message object from initial request
    message = ytLinkQue.get()
    print(f"Message object recieved: {message}")
    voiceChannel = message.author.voice.channel
    vc = await voiceChannel.connect()
    songsPlayed = 0
    
    while not ytLinkQue.empty():
        # Get current song
        currentSong = ytLinkQue.get()[0]
        print(f"Current song: {currentSong}")

        # Get song from Youtube
        with yt_dlp.YoutubeDL(ydl_opts) as ydl:
            # song = ydl.download(currentSong)
            info = ydl.extract_info(currentSong, download=False)
            song = info['formats'][0]['url']

        # Play Song
        vc.play(discord.FFmpegPCMAudio(song, **FFMPEG_OPTIONS), after=lambda e: print('Song done'))

        # Wait until the song has finished playing
        while vc.is_playing():
            print("playing rn")
            await asyncio.sleep(1)
    
    await vc.disconnect()
    musicStop()


    


    When play() is called, here is the output in terminal with my annotations as **** text **** :

    


    >python main.py&#xA;2023-02-17 15:21:09 INFO     discord.client logging in using static token&#xA;2023-02-17 15:21:10 INFO     discord.gateway Shard ID None has connected to Gateway (Session ID: 60b9fce14faa5daa4aed9eb6db01a74d).&#xA;Max que: 50&#xA;Text Channel: 828698708123451434&#xA;Testing Bot#4591 is ready.&#xA;Passing message object&#xA;**** play() funciton is called ****&#xA;Play Called&#xA;Message object recieved: <message channel="<TextChannel" position="7" nsfw="False" news="False"> type= author=<member discriminator="&#x27;0199&#x27;" bot="False" nick="&#x27;Fragnk7?&#x27;" guild="<Guild" chunked="True">> flags=<messageflags value="0">>&#xA;2023-02-17 15:21:16 INFO     discord.voice_client Connecting to voice...&#xA;2023-02-17 15:21:16 INFO     discord.voice_client Starting voice handshake... (connection attempt 1)&#xA;2023-02-17 15:21:17 INFO     discord.voice_client Voice handshake complete. Endpoint found seattle2004.discord.media&#xA;Current song: https://www.youtube.com/watch?v=vcAp4nmTZCA&#xA;[youtube] Extracting URL: https://www.youtube.com/watch?v=vcAp4nmTZCA &#xA;[youtube] vcAp4nmTZCA: Downloading webpage &#xA;[youtube] vcAp4nmTZCA: Downloading android player API JSON &#xA;**** Does not play any audio ****&#xA;Playing rn&#xA;Song done&#xA;2023-02-17 15:21:18 INFO     discord.player ffmpeg process 20700 successfully terminated with return code of 1.&#xA;2023-02-17 15:21:19 INFO     discord.voice_client The voice handshake is being terminated for Channel ID 400178308467392513 (Guild ID 261601676941721602)&#xA;2023-02-17 15:21:19 INFO     discord.voice_client Disconnecting from voice normally, close code 1000.&#xA;</messageflags></member></message>

    &#xA;

    On Discord's end, the bot successfully connects then disconnects after 2 second.

    &#xA;

    Note : I've only included code I think is relevant. Please let me know if I should add anything else to the post, otherwise, here is the github for the project. Code is in main.py.&#xA;https://github.com/LukeLeimbach/wallMomentMusic

    &#xA;

    Thank you in advance !

    &#xA;

    I've applied the advice from these posts but it still will not play audio :

    &#xA;

    -https://stackoverflow.com/questions/45770016/how-do-i-make-my-discord-bot-play-audio-from-youtube

    &#xA;

    -https://stackoverflow.com/questions/66070749/how-to-fix-discord-music-bot-that-stops-playing-before-the-song-is-actually-over?newreg=c70dd786cf5844e490045494223c0381

    &#xA;

    -https://stackoverflow.com/questions/57688808/playing-music-with-a-bot-from-youtube-without-downloading-the-file

    &#xA;

  • Rotating gyro data in gopro footage with ffpmeg

    2 juillet 2023, par FPV Shenanigans

    I believe orientation of gyro data in some of my gopro clips is wrong. Reelsteady runs stabilization ok but it results in even worse than initial video shaky effect. I have filmed with gopro in 90 degree with orientation locked .

    &#xA;

    Is it possible to amend metadata if ffmpeg to fix this ?

    &#xA;

    the below is an example clip

    &#xA;

    Metadata :&#xA;major_brand : isom&#xA;minor_version : 512&#xA;compatible_brands : isomiso2mp41&#xA;encoder : Lavf60.10.100&#xA;Duration : 00:04:30.22, start : 0.000000, bitrate : 119132 kb/s&#xA;Stream #0:00x1 : Video : hevc (Main 10) (hvc1 / 0x31637668), yuv420p10le(pc, bt709), 3840x3360 [SAR 1:1 DAR 8:7], 118934 kb/s, 59.94 fps, 59.94 tbr, 60k tbn (default)&#xA;Metadata :&#xA;handler_name : GoPro H.265&#xA;vendor_id : [0][0][0][0]&#xA;encoder : GoPro H.265 encoder&#xA;timecode : 13:27:43:05&#xA;Side data :&#xA;displaymatrix : rotation of -90.00 degrees&#xA;Stream #0:10x2 : Audio : aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)&#xA;Metadata :&#xA;handler_name : GoPro AAC&#xA;vendor_id : [0][0][0][0]&#xA;Stream #0:20x3 : Data : none (tmcd / 0x64636D74)&#xA;Metadata :&#xA;handler_name : GoPro H.265&#xA;timecode : 13:27:43:05

    &#xA;

    tried this

    &#xA;

    ffmpeg.exe -i "F :\2023 THE ONLY COPY\Chasing surfers\GX010223.MP4" -c copy -metadata:s:v rotate=90 "F :\2023 THE ONLY COPY\Chasing surfers\GX010223_test.mp4"

    &#xA;

    but reelsteady can't read metadata from a new video

    &#xA;

  • Using aler9/rtsp-simple-server, able to stream HLS from file but not from ffmpeg's stdin

    11 avril 2023, par Powercoder

    UPD : hehe, it actially works, but in chrome, not mozilla

    &#xA;

    I want to display programmatically generated stream on a webpage in real time. For this I have rtsp-simple-server with RTSP and HLS enabled. I managed to publish a stream from file with command ffmpeg -re -stream_loop -1 -i file.mp4 -vcodec libx264 -f rtsp -rtsp_transport tcp rtsp://localhost:8554/mystream and see it at http://localhost:8888/mystream.

    &#xA;

    But when I'm trying to do the same with python from the ffmpeg's stdin, I'm getting infinitely loading video instead of stream and browser console says "Uncaught (in promise) DOMException : The fetching process for the media resource was aborted by the user agent at the user's request". Here is my code :

    &#xA;

    import random&#xA;import shlex&#xA;import subprocess&#xA;import time&#xA;&#xA;import numpy as np&#xA;&#xA;&#xA;def main():&#xA;    width = 1024&#xA;    height = 720&#xA;    framerate = 1&#xA;    frame_duration = 1 / framerate&#xA;    cmd = shlex.split(&#xA;        f&#x27;ffmpeg&#x27;&#xA;        f&#x27; -y&#x27;&#xA;        f&#x27; -f rawvideo&#x27;&#xA;        f&#x27; -vcodec rawvideo&#x27;&#xA;        f&#x27; -s {width}x{height}&#x27;&#xA;        f&#x27; -pix_fmt bgr24&#x27;&#xA;        f&#x27; -r {framerate}&#x27;&#xA;        f&#x27; -i -&#x27;&#xA;        f&#x27; -r {framerate}&#x27;&#xA;        f&#x27; -force_key_frames expr:eq(mod(n,3),0)&#x27;&#xA;        f&#x27; -vcodec libx264&#x27;&#xA;        f&#x27; -crf 18&#x27;&#xA;        f&#x27; -preset ultrafast&#x27;&#xA;        f&#x27; -tune zerolatency&#x27;&#xA;        f&#x27; -f rtsp&#x27;&#xA;        f&#x27; -rtsp_transport tcp&#x27;&#xA;        f&#x27; rtsp://localhost:8554/mystream&#x27;&#xA;    )&#xA;    ffmpeg_process = subprocess.Popen(cmd, stdin=subprocess.PIPE)&#xA;    try:&#xA;        while True:&#xA;            image = np.full(&#xA;                (height, width, 3),&#xA;                (&#xA;                    random.randint(0, 255),&#xA;                    random.randint(0, 255),&#xA;                    random.randint(0, 255),&#xA;                ),&#xA;                dtype=np.uint8,&#xA;            )&#xA;            ffmpeg_process.stdin.write(image.tobytes())&#xA;            time.sleep(frame_duration)&#xA;    finally:&#xA;        ffmpeg_process.stdin.close()&#xA;        ffmpeg_process.wait()&#xA;&#xA;&#xA;if __name__ == &#x27;__main__&#x27;:&#xA;    main()&#xA;&#xA;

    &#xA;

    In the server's logs seems like no bad messages instead of single 404 status (is it just about favicon, right ?)

    &#xA;

    2023/03/25 13:50:32 DEB [HLS] [conn 172.18.0.1] GET /mystream/&#xA;2023/03/25 13:50:32 DEB [HLS] [conn 172.18.0.1] [c->s] GET /mystream/ HTTP/1.1&#xA;Host: localhost:8888&#xA;Accept: text/html,application/xhtml&#x2B;xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8&#xA;Accept-Encoding: gzip, deflate, br&#xA;Accept-Language: ru,en-US;q=0.7,en;q=0.3&#xA;Connection: keep-alive&#xA;Cookie: csrftoken=iRZDO5rsJzhh5peyyKhViN9yRslNQbuZ; Webstorm-713207de=ca4f5f1e-40e8-4bfd-97da-1be2f15f6e9e&#xA;Sec-Fetch-Dest: document&#xA;Sec-Fetch-Mode: navigate&#xA;Sec-Fetch-Site: cross-site&#xA;Upgrade-Insecure-Requests: 1&#xA;User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/111.0&#xA;&#xA;&#xA;2023/03/25 13:50:32 INF [HLS] [muxer mystream] created (requested by 172.18.0.1)&#xA;2023/03/25 13:50:32 INF [HLS] [muxer mystream] is converting into HLS, 1 track (H264)&#xA;2023/03/25 13:50:32 DEB [HLS] [conn 172.18.0.1] [s->c] HTTP/1.1 200 OK&#xA;Access-Control-Allow-Credentials: true&#xA;Access-Control-Allow-Origin: *&#xA;Content-Type: text/html&#xA;Server: rtsp-simple-server&#xA;&#xA;(body of 1240 bytes)&#xA;2023/03/25 13:50:32 DEB [HLS] [conn 172.18.0.1] GET /favicon.ico&#xA;2023/03/25 13:50:32 DEB [HLS] [conn 172.18.0.1] [c->s] GET /favicon.ico HTTP/1.1&#xA;Host: localhost:8888&#xA;Accept: image/avif,image/webp,*/*&#xA;Accept-Encoding: gzip, deflate, br&#xA;Accept-Language: ru,en-US;q=0.7,en;q=0.3&#xA;Connection: keep-alive&#xA;Cookie: csrftoken=iRZDO5rsJzhh5peyyKhViN9yRslNQbuZ; Webstorm-713207de=ca4f5f1e-40e8-4bfd-97da-1be2f15f6e9e&#xA;Referer: http://localhost:8888/mystream/&#xA;Sec-Fetch-Dest: image&#xA;Sec-Fetch-Mode: no-cors&#xA;Sec-Fetch-Site: same-origin&#xA;User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/111.0&#xA;&#xA;&#xA;2023/03/25 13:50:32 DEB [HLS] [conn 172.18.0.1] [s->c] HTTP/1.1 404 Not Found&#xA;Access-Control-Allow-Credentials: true&#xA;Access-Control-Allow-Origin: *&#xA;Server: rtsp-simple-server&#xA;&#xA;&#xA;2023/03/25 13:50:32 DEB [HLS] [conn 172.18.0.1] GET /mystream/index.m3u8&#xA;2023/03/25 13:50:32 DEB [HLS] [conn 172.18.0.1] [c->s] GET /mystream/index.m3u8 HTTP/1.1&#xA;Host: localhost:8888&#xA;Accept: */*&#xA;Accept-Encoding: gzip, deflate, br&#xA;Accept-Language: ru,en-US;q=0.7,en;q=0.3&#xA;Connection: keep-alive&#xA;Cookie: csrftoken=iRZDO5rsJzhh5peyyKhViN9yRslNQbuZ; Webstorm-713207de=ca4f5f1e-40e8-4bfd-97da-1be2f15f6e9e&#xA;Referer: http://localhost:8888/mystream/&#xA;Sec-Fetch-Dest: empty&#xA;Sec-Fetch-Mode: cors&#xA;Sec-Fetch-Site: same-origin&#xA;User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/111.0&#xA;&#xA;&#xA;2023/03/25 13:50:32 DEB [HLS] [conn 172.18.0.1] [s->c] HTTP/1.1 200 OK&#xA;Access-Control-Allow-Credentials: true&#xA;Access-Control-Allow-Origin: *&#xA;Content-Type: application/x-mpegURL&#xA;Server: rtsp-simple-server&#xA;&#xA;(body of 122 bytes)&#xA;2023/03/25 13:50:34 DEB [HLS] [conn 172.18.0.1] GET /mystream/index.m3u8&#xA;2023/03/25 13:50:34 DEB [HLS] [conn 172.18.0.1] [c->s] GET /mystream/index.m3u8 HTTP/1.1&#xA;Host: localhost:8888&#xA;Accept: */*&#xA;Accept-Encoding: gzip, deflate, br&#xA;Accept-Language: ru,en-US;q=0.7,en;q=0.3&#xA;Connection: keep-alive&#xA;Cookie: csrftoken=iRZDO5rsJzhh5peyyKhViN9yRslNQbuZ; Webstorm-713207de=ca4f5f1e-40e8-4bfd-97da-1be2f15f6e9e&#xA;Referer: http://localhost:8888/mystream/&#xA;Sec-Fetch-Dest: empty&#xA;Sec-Fetch-Mode: cors&#xA;Sec-Fetch-Site: same-origin&#xA;User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/111.0&#xA;&#xA;&#xA;2023/03/25 13:50:34 DEB [HLS] [conn 172.18.0.1] [s->c] HTTP/1.1 200 OK&#xA;Access-Control-Allow-Credentials: true&#xA;Access-Control-Allow-Origin: *&#xA;Content-Type: application/x-mpegURL&#xA;Server: rtsp-simple-server&#xA;&#xA;(body of 122 bytes)&#xA;2023/03/25 13:50:36 DEB [HLS] [conn 172.18.0.1] GET /mystream/index.m3u8&#xA;2023/03/25 13:50:36 DEB [HLS] [conn 172.18.0.1] [c->s] GET /mystream/index.m3u8 HTTP/1.1&#xA;Host: localhost:8888&#xA;Accept: */*&#xA;Accept-Encoding: gzip, deflate, br&#xA;Accept-Language: ru,en-US;q=0.7,en;q=0.3&#xA;Connection: keep-alive&#xA;Cookie: csrftoken=iRZDO5rsJzhh5peyyKhViN9yRslNQbuZ; Webstorm-713207de=ca4f5f1e-40e8-4bfd-97da-1be2f15f6e9e&#xA;Referer: http://localhost:8888/mystream/&#xA;Sec-Fetch-Dest: empty&#xA;Sec-Fetch-Mode: cors&#xA;Sec-Fetch-Site: same-origin&#xA;User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/111.0&#xA;&#xA;&#xA;2023/03/25 13:50:36 DEB [HLS] [conn 172.18.0.1] [s->c] HTTP/1.1 200 OK&#xA;Access-Control-Allow-Credentials: true&#xA;Access-Control-Allow-Origin: *&#xA;Content-Type: application/x-mpegURL&#xA;Server: rtsp-simple-server&#xA;&#xA;(body of 122 bytes)&#xA;&#xA;

    &#xA;

    How do I get my stream from python visible on a webpage ?

    &#xA;