
Recherche avancée
Autres articles (46)
-
Contribute to a better visual interface
13 avril 2011MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community. -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette 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. -
Gestion générale des documents
13 mai 2011, parMé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 (...)
Sur d’autres sites (5133)
-
Why is my Youtube Video not downloading completely ? "Input buffer exhausted, packet corrupt"
15 septembre 2021, par user16909319Introduction :


I'm working on a Discord Music Bot for personal use only. Basically, when I play a 2min song with the bot, it plays the song for 1min 30secs, then skips it and plays the next one in the queue. The error is shown below :




Error in Pull Function

IO error : Error number -10054 occurred

[mov,mp4,m4a,3gp,3g2,mj2 @ 0000018f86a6f4c0] Packet corrupt (stream = 0, dts = 11154432).

Input buffer exhausted before END element found

Invalid Data found when processing Input

[mov,mp4,m4a,3gp,3g2,mj2 @ 0000018f86a6f4c0] stream 0, offset 0x3e805c : partial file



The code block which I think is causing the problem :


Search song method


async def search_song(self, amount, song, get_url=False):
 info = await self.bot.loop.run_in_executor(None, lambda: youtube_dl.YoutubeDL(ytdl_format_options).extract_info(
 f"ytsearch{amount}:{song}", download=False, ie_key="YoutubeSearch"))
 if len(info["entries"]) == 0: return None

 return [entry["webpage_url"] for entry in info["entries"]] if get_url else info



Play_song method


async def play_song(self, ctx, song):
 url = pafy.new(song).getbestaudio().url
 ctx.voice_client.play(discord.PCMVolumeTransformer(discord.FFmpegPCMAudio(url, executable="C:/ffmpeg/bin/ffmpeg.exe")),
 after=lambda error: self.bot.loop.create_task(self.check_queue(ctx)))
 ctx.voice_client.source.volume = 0.5



Formatting Options I provided :


ytdl_format_options = {
 'format': 'bestaudio/best',
 'outtmpl': '%(extractor)s-%(id)s-%(title)s.%(ext)s',
 'restrictfilenames': True,
 'noplaylist': True,
 'nocheckcertificate': True,
 'ignoreerrors': True,
 'logtostderr': False,
 'quiet': True,
 'no_warnings': True,
 'default_search': 'auto',
 'source_address': '0.0.0.0'
}



Solutions that I've tried :


- 

- Running it on both Replit and locally.
- Redownloading FFmpeg
- Ensuring FFmpeg, pafy, and youtube_dl are all up to date.








Things to Note :


- 

- Playing a 2mins song, it stops after 1min 30 seconds and displays the error above. (75% of the song)
- Playing a 1hr song, it still continues after 10 minutes.






I do not have much experience in this yet so I'm not entirely sure where in my code is actually causing this issue or other ways which I can use to test and fix the issue.


-
How to install ffmpeg to Heroku ?
11 mars 2020, par Gamer FardinI am trying to build a discord bot using discord.py rewrite version, now the problem is I recently updated it to run audio from link and it works fine when I manually run the codes but once I have uploaded it to heroku it doesnt work because(I assume) ffmpeg is not in the right folder and I get the error : ffprobe/avprobe and ffmpeg/avconv not found. please install one. So does anyone how to properly install it to heroku ? Because the usual pip command isnt working...
’’’
@client.command(aliases=["PlayMusic","playmusic","Playmusic","playMusic","PLAYMUSIC","playaudio"])
async def play(ctx, url):
song_there = os.path.isfile("song.mp3")
try:
if song_there:
os.remove("song.mp3")
except PermissionError:
await ctx.send("Wait for the current playing music end or use the 'stop' command")
return
voice = get(client.voice_clients, guild=ctx.guild)
print(voice)
ydl_opts = {
'format': 'bestaudio/best',
'postprocessors': [{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',
'preferredquality': '192',
}],
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download([url])
for file in os.listdir("./"):
if file.endswith(".mp3"):
os.rename(file, 'song.mp3')
voice.play(discord.FFmpegPCMAudio("song.mp3"))
voice.volume = 100
voice.is_playing()’’’
-
"MPEG audio header not found" error when opening with TagLib after converting with ffmpeg
6 juillet 2015, par Avrohom YisroelI converted a wma file simply by doing something like this...
ffmpeg -i song.wma -f mp3 song.mp3
I can then play the mp3 file in Windows Media player, so it looks like the conversion worked.
However, if I try to open the file in TagLib, I get an error "MPEG audio header not found" on the following line...
TagLib.File tf = TagLib.File.Create("song.mp3");
I’ve tried this on a few wma files, so it’s not just that one that’s at fault.
Anyone have any idea what I did wrong ? I find the docs for ffmpeg pretty overwhelming, and as a complete ignoramus in the field of audio encoding, I haven’t a clue what most of it means. Could be I’m missing something in the conversion, although that wouldn’t explain why WMP can play it but TagLib can’t open it.