
Recherche avancée
Médias (1)
-
The pirate bay depuis la Belgique
1er avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (12)
-
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ; -
Déploiements possibles
31 janvier 2010, parDeux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
Version mono serveur
La version mono serveur consiste à n’utiliser qu’une (...) -
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
Sur d’autres sites (3546)
-
Youtube-dl and Ffmpeg
25 juin 2022, par Joksyi have made a music bot with discord.py, but i get this info thing and it doesnt work anymore
error [youtube] QxYdBvB8sOY: Downloading webpage 985104597242773505 [2022-06-25 07:45:51] [INFO ] discord.player: Preparing to terminate ffmpeg process 37580. [2022-06-25 07:45:51] [INFO ] discord.player: ffmpeg process 37580 has not terminated. Waiting to terminate... [2022-06-25 07:45:51] [INFO ] discord.player: ffmpeg process 37580 should have terminated with a return code of 1.
this is my code

import discord
import os
import asyncio
import youtube_dl
from discord import *

token = "token is here"
prefix = "j!"
blocked_words = ["blocked words are here"]

voice_clients = {}

yt_dl_opts = {'format': 'bestaudio/best'}
ytdl = youtube_dl.YoutubeDL(yt_dl_opts)

ffmpeg_options = {'options': "-vn"}

intents = discord.Intents.default()
intents.message_content = True

client = discord.Client(intents=intents)


programmer_role = "987018590152699964"
 


@client.event
async def on_ready():
 print(f"Bot logged in as {client.user}")

@client.event
async def on_message(msg):
 if msg.author != client.user:
 if msg.content.lower().startswith(f"{prefix}info"):
 await msg.channel.send(f"Hi, Im JoksysBot Made By Joksy!")

 for text in blocked_words:
 if text in str(msg.content.lower()):
 await msg.delete()
 await msg.channel.send("Hey, Dont Say That!")
 return
 if msg.content.startswith(f"{prefix}play"):

 try:
 voice_client = await msg.author.voice.channel.connect()
 voice_clients[voice_client.guild.id] = voice_client
 except:
 print("error")

 try:
 url = msg.content.split()[1]

 loop = asyncio.get_event_loop()
 data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url, download=False))

 song = data['url']
 player = discord.FFmpegPCMAudio(song, **ffmpeg_options, executable="C:\\Users\\jonas\\Documents\\ffmpeg-2022-06-16-git-5242ede48d-full_build\\ffmpeg-2022-06-16-git-5242ede48d-full_build\\bin\\ffmpeg.exe")

 voice_clients[msg.guild.id].play(player)

 except Exception as err:
 print(err)

 if msg.content.startswith(f"{prefix}pause"):
 try:
 voice_clients[msg.guild.id].pause()
 except Exception as err:
 print(err)

 if msg.content.startswith(f"{prefix}resume"):
 try:
 voice_clients[msg.guild.id].resume()
 except Exception as err:
 print(err)

 if msg.content.startswith(f"{prefix}stop"):
 try:
 voice_clients[msg.guild.id].stop()
 await voice_clients[msg.guild.id].disconnect()
 except Exception as err:
 print(err)

client.run(token)




its weird since all the other code in my bot works fine like the
!info
command, so it must be an error with either youtube-dl or ffmpeg. But then again it doesnt join the voice call in the first place so that might be the error. i added ffmpeg to path but i still wrote the path to it hereplayer = discord.FFmpegPCMAudio(song, **ffmpeg_options, executable="C:\\Users\\jonas\\Documents\\ffmpeg-2022-06-16-git-5242ede48d-full_build\\ffmpeg-2022-06-16-git-5242ede48d-full_build\\bin\\ffmpeg.exe")
. i followed this tutorial for the bot https://www.youtube.com/watch?v=Q8wxin72h50&t=1040s i did everything he did but it didnt work. My discord.py version is2.0.0
my Python version is3.10.5
and my youtube_dl version is2021.12.17
my ffmpeg download isffmpeg-2022-06-16-git-5242ede48d-full_build
. I tested it ondiscord.py 1.73
and it worked fine. This was in intellij though whilst my main program is in Visual Studio Code but i couldnt see it making any big difference so it could be the intents that makes the program not work.I couldnt see any mistakes in the code but im new to discord.py, youtube_dl and ffmpeg stuff so unless visual studio code showed me what i did wrong, i wouldnt notice. But what did i do wrong and how can i fix it ?

-
ffmpeg command not interpreted correctly from cron
16 avril 2022, par Andre Lörchneron my raspberry pi I'm trying to run a script every 30 minutes that restarts a video stream. Reason is the stream is consistently running into hickups after roughly 35 minutes and stops a few minutes after.
I tried fixing the root problem without any success so far, so an easier and valid workaround is to just restart the stream.


I created a script
restart_stream.sh
that kills the previous stream and immediately starts it again.

#!/bin/bash

killall -r libcamera-vid ffmpeg
libcamera-vid -t 0 --framerate 30 --width 1280 --height 720 -b 2000000 -o - --nopreview | ffmpeg -f h264 -thread_queue_size 4096 -i - -f pulse -ar 44100 -ac 2 -acodec pcm_s16le -thread_queue_size 4096 -i default -vcodec copy -acodec aac -ab 128k -fflags genpts -fflags igndts -f fifo -fifo_format flv -map 0:v -map 1:a? -drop_pkts_on_overflow 1 -attempt_recovery 1 -recovery_wait_time 2 rtmp://a.rtmp.youtube.com/live2/<key>
</key>


cron job


*/30 7-19 * * * /bin/restart_stream.sh >/tmp/stream.log 2>&1



Running this script manually from the ssh console works perfectly fine but once I run it from cron it fails with the following error


[1:41:01.657471459] [2138] INFO RPI raspberrypi.cpp:1326 Registered camera /base/soc/i2c0mux/i2c@1/ov5647@36 to Unic>
[1:41:01.658232799] [2136] INFO Camera camera.cpp:1028 configuring streams: (0) 1280x720-YUV420
[1:41:01.659060988] [2138] INFO RPI raspberrypi.cpp:747 Sensor: /base/soc/i2c0mux/i2c@1/ov5647@36 - Selected sensor >
[1:41:01.698525343] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Saturation = 1.000000
[1:41:01.698798789] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Contrast = 1.000000
[1:41:01.698840990] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Brightness = 0.000000
[1:41:01.698877617] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: AwbMode = 0
[1:41:01.698910745] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Sharpness = 1.000000
[1:41:01.698947187] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: ExposureValue = 0.000000
[1:41:01.698983203] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeExposureMode = 0
[1:41:01.699014646] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: FrameDurationLimits = [ 33333, 33333 ]
[1:41:01.699050903] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeMeteringMode = 0
[1:41:01.699082938] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: NoiseReductionMode = 1
ffmpeg version 4.3.3-0+rpt2+deb11u1 Copyright (c) 2000-2021 the FFmpeg developers
 built with gcc 10 (Raspbian 10.2.1-6+rpi1)
 configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/arm-linux-gn>
 WARNING: library configuration mismatch
 avutil configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 avcodec configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 avformat configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 avdevice configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 avfilter configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 avresample configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 swscale configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 swresample configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 postproc configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 libavutil 56. 51.100 / 56. 51.100
 libavcodec 58. 91.100 / 58. 91.100
 libavformat 58. 45.100 / 58. 45.100
 libavdevice 58. 10.100 / 58. 10.100
 libavfilter 7. 85.100 / 7. 85.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 7.100 / 5. 7.100
 libswresample 3. 7.100 / 3. 7.100
 libpostproc 55. 7.100 / 55. 7.100
Input #0, h264, from 'pipe:':
 Duration: N/A, bitrate: N/A
 Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x720, 30 fps, 30 tbr, 1200k tbn, 60 tbc
default: No such process



It seems to interpret the command differently and not treat
default
within the ffmpeg call as a parameter.

-
ffmpeg command not interpreted correcly from cron
16 avril 2022, par Andre Lörchneron my raspberry pi I'm trying to run a script every 30 minutes that restarts a video stream. Reason is the stream is consistently running into hickups after roughly 35 minutes and stops a few minutes after.
I tried fixing the root problem without any success so far, so an easier and valid workaround is to just restart the stream.


I created a script
restart_stream.sh
that kills the previous stream and immediately starts it again.

#!/bin/bash

killall -r libcamera-vid ffmpeg
libcamera-vid -t 0 --framerate 30 --width 1280 --height 720 -b 2000000 -o - --nopreview | ffmpeg -f h264 -thread_queue_size 4096 -i - -f pulse -ar 44100 -ac 2 -acodec pcm_s16le -thread_queue_size 4096 -i default -vcodec copy -acodec aac -ab 128k -fflags genpts -fflags igndts -f fifo -fifo_format flv -map 0:v -map 1:a? -drop_pkts_on_overflow 1 -attempt_recovery 1 -recovery_wait_time 2 rtmp://a.rtmp.youtube.com/live2/<key>
</key>


cron job


*/30 7-19 * * * /bin/restart_stream.sh >/tmp/stream.log 2>&1



Running this script manually from the ssh console works perfectly fine but once I run it from cron it fails with the following error


[1:41:01.657471459] [2138] INFO RPI raspberrypi.cpp:1326 Registered camera /base/soc/i2c0mux/i2c@1/ov5647@36 to Unic>
[1:41:01.658232799] [2136] INFO Camera camera.cpp:1028 configuring streams: (0) 1280x720-YUV420
[1:41:01.659060988] [2138] INFO RPI raspberrypi.cpp:747 Sensor: /base/soc/i2c0mux/i2c@1/ov5647@36 - Selected sensor >
[1:41:01.698525343] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Saturation = 1.000000
[1:41:01.698798789] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Contrast = 1.000000
[1:41:01.698840990] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Brightness = 0.000000
[1:41:01.698877617] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: AwbMode = 0
[1:41:01.698910745] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: Sharpness = 1.000000
[1:41:01.698947187] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: ExposureValue = 0.000000
[1:41:01.698983203] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeExposureMode = 0
[1:41:01.699014646] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: FrameDurationLimits = [ 33333, 33333 ]
[1:41:01.699050903] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: AeMeteringMode = 0
[1:41:01.699082938] [2145] INFO IPARPI raspberrypi.cpp:626 Request ctrl: NoiseReductionMode = 1
ffmpeg version 4.3.3-0+rpt2+deb11u1 Copyright (c) 2000-2021 the FFmpeg developers
 built with gcc 10 (Raspbian 10.2.1-6+rpi1)
 configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/arm-linux-gn>
 WARNING: library configuration mismatch
 avutil configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 avcodec configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 avformat configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 avdevice configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 avfilter configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 avresample configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 swscale configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 swresample configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 postproc configuration: --prefix=/usr --extra-version=0+rpt2+deb11u1 --toolchain=hardened --incdir=/usr/include/>
 libavutil 56. 51.100 / 56. 51.100
 libavcodec 58. 91.100 / 58. 91.100
 libavformat 58. 45.100 / 58. 45.100
 libavdevice 58. 10.100 / 58. 10.100
 libavfilter 7. 85.100 / 7. 85.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 7.100 / 5. 7.100
 libswresample 3. 7.100 / 3. 7.100
 libpostproc 55. 7.100 / 55. 7.100
Input #0, h264, from 'pipe:':
 Duration: N/A, bitrate: N/A
 Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x720, 30 fps, 30 tbr, 1200k tbn, 60 tbc
default: No such process



It seems to interpret the command differently and not treat
default
within the ffmpeg call as a parameter.