
Recherche avancée
Autres articles (44)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains 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, parPré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 ) (...)
Sur d’autres sites (6513)
-
Streaming opencv to youtube with ffmpeg
29 juin 2020, par Tim TreurnietI am trying to live stream to youtube from a c++ opencv project. Currently, my program outputs a RTMP stream which nginx should push to youtube. A problem I'm having is youtube's requirement for an audio stream.


I'm trying a workaround by restreaming using ffmpeg. It adds an empty audio stream (not efficient). Another issue is the output speed of my program which is around 10 fps. When playing in vlc or youtube, the stream buffers for a while and plays a few seconds of smooth video. How should I set this up in c++ to play a constant stream with lower fps, including an empty audio stream ?
Example I used : https://github.com/andreanobile/opencv_ffmpeg_streaming


FFMPEG for adding audio :
ffmpeg -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -hwaccel cuvid -i rtmp ://localhost/live -vf scale=3840:2160 -c:v h264_nvenc -preset fast -maxrate 6000k -pix_fmt yuv420p -g 50 -b:a 160k -ac 2 -c:a aac -f flv rtmp ://a.rtmp.youtube.com/live2/


-
discord.py music bot can't play next song
6 décembre 2020, par borkI'm making a discord music bot using ffmpeg and youtube-dl. I have a premade playlist of urls that would play the list of songs once a user chooses it.

this is my code for playing the audio

ydl_opts = {
 'format': 'bestaudio', 
 'noplaylist':'True',
 'youtube_include_dash_manifest': False
 }
FFMPEG_OPTIONS = {
 'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5',
 'options': '-vn'
 }

songs = url[playlist]
dur_min = 0
pre_dur_sec = 0
with YoutubeDL(ydl_opts) as ydl:
 for i in songs:
 info = ydl.extract_info(i, download = False)
 dur = info['duration']
 playlist_songs.append(info)

playlist_songs_copy = playlist_songs.copy()
for i in playlist_songs_copy:
 info = playlist_songs.pop(0)
 URL = info['formats'][0]['url']
 player = FFmpegPCMAudio(URL, **FFMPEG_OPTIONS)
 q.append(player)
 q_playlist.append(playlist)

if not voice.is_playing():
 source = q.pop(0) 
 playlist = q_playlist.pop(0)
 dur_min = duration_min.pop(0)
 dur_sec = duration_sec.pop(0) 
 voice.play(source, after = lambda e: play_next(ctx, source)) 
 voice.is_playing()
 await ctx.send(f'```nim\n*Now Playing:*\nplaylist {playlist}: {name[playlist]}\n\n{content[playlist]}\n\ntotal duration: {dur_min}:{dur_sec}```')



and this is my code for playing the next song


def play_next(ctx, source):
 voice = get(client.voice_clients, guild = ctx.guild)
 if len(q) >= 1:
 try:
 del combine_q[0]
 source = q.pop(0)
 playlist = q_playlist.pop(0)
 dur_min = duration_min.pop(0)
 dur_sec = duration_sec.pop(0)

 except:
 pass

 voice.play(source, after = lambda e: play_next(ctx, source))
 try:
 asyncio.run_coroutine_threadsafe(ctx.send(f'```nim\n*Now Playing:*\nplaylist {playlist}: {name[playlist]}\n\n{content[playlist]}\n\ntotal duration: {dur_min}:{dur_sec}```'), client.loop)
 
 except:
 asyncio.run_coroutine_threadsafe(ctx.send('```nim\nPlaying the next song...```'), client.loop)
 
 else:
 time.sleep(30) 
 if not voice.is_playing():
 asyncio.run_coroutine_threadsafe(voice.disconnect(), client.loop)
 asyncio.run_coroutine_threadsafe(ctx.send("```nim\nNo more songs in queue.```"),client.loop)
 voice.is_paused()



Up till today, it's been working fine. But I was using the bot just now and instead of playing the song and sending the message "Playing the next song..." as usual, it just stopped and spammed the message for about 30 times before it disconnected. When I checked the logs, it showed

socket.send() raised exception

, which was also spammed in the terminal. When I tried making the bot reconnect, it joined my voice channel but didn't respond to any commands and would keep making the discord "connecting" noise. It wouldn't even leave with my .leave command unless I completely turned it off via the script.

The same connecting problem would continue even after I reran the script and would only stop after I restarted my VS Code which is really odd...


After some testing I found out that as of now, the bot is only able to play two songs before breaking. I really need help as this just happened randomly and I'm unable to find anything online about the problem.


-
Youtube-dl cannot read various set on batch script
18 novembre 2019, par Al UrbaseR BlongtousI created an batch-script that positioned with youtube-dl and ffmpeg. I set several set to put URL and Video/Audio ID. Here my script that I simplified
@echo off
cd /d %root%\YT
color 0a
title Youtube Downloader
setlocal enableDelayedExpansion
set q=^"
color 0a
:submenu
echo Please enter URL.
set /p f1="URL: "
echo Checking ID...
youtube-dl -F %f1%
ping localhost -n 2 >nul
goto menu
:menu
echo.
echo Script created by UrbaseR
echo ___________________________________________________________
echo.
echo MENU
echo ___________________________________________________________
echo OS Windows - %ComputerName%
echo.
echo M E N U
echo Press 1 to Download Best version
echo Press 2 to Download Custom version + convert
echo Press 3 to Exit
set /p you=">"
if %you%==1 goto 1
if %you%==2 goto 2
if %you%==3 goto 3
cls
echo *********************************
echo Sorry invalid number!
echo *********************************
ping localhost -n 2 >nul
goto menu
:1
echo Downloading...
youtube-dl -f best %f1%
echo.
echo Done
ping localhost -n 2 >nul
cls
goto submenu
:2
set /p id1="Insert Video ID: "
set /p id2="Insert Audio ID: "
echo Downloading Video..
youtube-dl -f %id1% -ciw -o "vid.%(ext)s" -v --write-sub %f1%
echo.
echo Video Done
ping localhost -n 2 >nul
echo Downloading Audio..
youtube-dl -f %id2% -ciw -o "aud.%(ext)s" -v %f1%
echo.
echo Audio Done
ping localhost -n 2 >nul
echo Converting Video
ffmpeg -i "vid.%(ext)s" -i "aud.%(ext)s" -c:v copy -c:a aac -strict experimental "input.mkv"
echo Converting Done
ping localhost -n 4 >nul
cls
goto submenu
:3
exitFirst and third option execute successfully. Second option will appear the message like this :
Usage : youtube-dl [OPTIONS] URL [URL...]
youtube-dl : error : You must provide at least one URL.Type youtube-dl —help to see a list of all options.
Note : Since I stuck on first and second stage of youtube-dl, ffmpeg may not work (I have not tested it yet).
Can you help me ?