Recherche avancée

Médias (0)

Mot : - Tags -/gis

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (56)

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

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

  • 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 ;

Sur d’autres sites (8141)

  • I'm having an issue with my discord bot playing audio from a youtube url

    19 avril 2022, par Alex Graeca
    sync def hog():
channel = bot.get_channel(964971002289356893)
url = 'https://www.youtube.com/watch?v=GyRmkAfpCOM'
await asyncio.sleep(1)
voice_channel = bot.get_channel(int(964971002289356893))
vc = await voice_channel.connect()
#vc.play(discord.FFmpegPCMAudio('C:/Users/alexa/Downloads/hogrider.mp3'))
vc.play(discord.FFmpegPCMAudio(source='https://www.youtube.com/watch?v=GyRmkAfpCOM', executable='ffmpeg.exe'))
while vc.is_playing():
    await asyncio.sleep(5)
await vc.disconnect()


    


    It works fine with the audio file from my laptop, but I want to play it from a youtube link.
It gives me an error :
https://www.youtube.com/watch?v=GyRmkAfpCOM : Invalid data found when processing input

    


    Thank you in advance

    


  • Discord v13 audioPlayer playing state changed to idle for unknown reason

    14 septembre 2021, par zS1L3NT

    When I play a song, the audioPlayer's state goes from buffering to playing to idle for no reason, without throwing any errors too. The weird thing is that the code I made runs perfectly fine on my Windows 11 Laptop. The error only occurs when I run the exact same code on my Ubuntu VPS. Here is the dependency report when run on the Ubuntu VPS

    


    --------------------------------------------------
Core Dependencies
- @discordjs/voice: 0.6.0
- prism-media: 1.3.2

Opus Libraries
- @discordjs/opus: 0.6.0
- opusscript: not found

Encryption Libraries
- sodium: not found
- libsodium-wrappers: 0.7.9
- tweetnacl: not found

FFmpeg
- version: 4.4-static https://johnvansickle.com/ffmpeg/
- libopus: yes
--------------------------------------------------


    


    What should I do to fix this ?

    


  • Broken pipe error when using FFmpeg stream camera video

    14 septembre 2021, par Xiuyi Yang

    I try to write frames captured from a my laptop camera and then stream these images with FFmpeg. This is my code :

    


    import subprocess
import cv2
rstp_url = "rtsp://localhost:31415/stream"

# In my mac webcamera is 0, also you can set a video file name instead, for example "/home/user/demo.mp4"
path = 0
cap = cv2.VideoCapture(path)

# gather video info to ffmpeg
fps = int(cap.get(cv2.CAP_PROP_FPS))
width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))

# command and params for ffmpeg
command = ['ffmpeg',
           '-y',
           '-f', 'rawvideo',
           '-vcodec', 'rawvideo',
           '-pix_fmt', 'bgr24',
           '-s', "{}x{}".format(width, height),
           '-r', str(fps),
           '-i', '-',
           '-c:v', 'libx264',
           '-pix_fmt', 'yuv420p',
           '-preset', 'ultrafast',
           '-f', 'flv',
           rstp_url]

# using subprocess and pipe to fetch frame data
p = subprocess.Popen(command, stdin=subprocess.PIPE)


while cap.isOpened():
    ret, frame = cap.read()
    if not ret:
        print("frame read failed")
        break

    # YOUR CODE FOR PROCESSING FRAME HERE

    # write to pipe
    p.stdin.write(frame.tobytes())


    


    After run this code, the following error occurs :

    


    


    Input #0, rawvideo, from 'pipe :' :
Duration : N/A, start : 0.000000, bitrate : 221184 kb/s
Stream #0:0 : Video : rawvideo (BGR[24] / 0x18524742), bgr24, 640x480, 221184 kb/s, 30 > tbr, 30 tbn, 30 tbc
rtsp ://localhost:31415/stream : Protocol not found
Traceback (most recent call last) :
File "rtsp.py", line 42, in 
p.stdin.write(frame.tobytes())
BrokenPipeError : [Errno 32] Broken pipe

    


    


    Please help me fix this bug.

    



    


    After reply by Rotem, I modidied code as below :

    


    import subprocess
import cv2
import pdb 

rstp_url = "rtsp://localhost:31415/stream"

# In my mac webcamera is 0, also you can set a video file name instead, for example "/home/user/demo.mp4"
path = 0
cap = cv2.VideoCapture(path)

# gather video info to ffmpeg
fps = int(cap.get(cv2.CAP_PROP_FPS))
width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))

# command and params for ffmpeg
command = ['ffmpeg',
           '-re',
           '-f', 'rawvideo',  # Apply raw video as input - it's more efficient than encoding each frame to PNG
           '-s', f'{width}x{height}',
           '-pixel_format', 'bgr24',
           '-r', f'{fps}',
           '-i', '-',
           '-pix_fmt', 'yuv420p',
           '-c:v', 'libx264',
           '-bufsize', '64M',
           '-maxrate', '4M',
           '-rtsp_transport', 'udp',
           '-f', 'rtsp',
           #'-muxdelay', '0.1',
           rstp_url ]


# using subprocess and pipe to fetch frame data
p = subprocess.Popen(command, stdin=subprocess.PIPE)


while cap.isOpened():
    ret, frame = cap.read()
    if not ret:
        print("frame read failed")
        break

    pdb.set_trace()
    # YOUR CODE FOR PROCESSING FRAME HERE

    # write to pipe
    p.stdin.write(frame.tobytes())

    cv2.imshow('current_img', frame)  # Show image for testing

    # time.sleep(1/FPS)
    key = cv2.waitKey(int(round(1000/fps)))  # We need to call cv2.waitKey after cv2.imshow

    if key == 27:  # Press Esc for exit
        break

p.stdin.close()  # Close stdin pipe
p.wait()  # Wait for FFmpeg sub-process to finish
cv2.destroyAllWindows()  # Close OpenCV window


    


    The error ocurs as below :

    


    


    Connection to tcp ://localhost:31415 ?timeout=0 failed : Connection >refused
Could not write header for output file #0 (incorrect codec >parameters ?) : Connection refused
Error initializing output stream 0:0 —
Conversion failed !
c
Qt : Session management error : None of the authentication protocols >specified are supported.