
Recherche avancée
Autres articles (15)
-
Publier sur MédiaSpip
13 juin 2013Puis-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 -
Taille des images et des logos définissables
9 février 2011, parDans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...) -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
Sur d’autres sites (4050)
-
libavcodec/sanm : clear codec47 diff buffers with specific color
8 novembre 2024, par Manuel Lausslibavcodec/sanm : clear codec47 diff buffers with specific color
The codec47 header provides colors to use to clear the
2 difference buffers. This fixes artifacts (black hair, faces) in
Curse of Monkey Island "CURSERNG.SAN" video.Signed-off-by : Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by : Anton Khirnov <anton@khirnov.net> -
OSError : [Errno 9] Bad file descriptor when downloading using pytube and playing with discord.py
15 septembre 2022, par Trevor MathisenWhen using pytube to download a YouTube video and discord.py to play it, I am getting a OSError : [Errno 9] Bad file descriptor error. I've had this working at one point and can't seem to figure out what I changed which broke it.


Full traceback :


2022-09-15 20:20:44 INFO discord.voice_client The voice handshake is being terminated for Channel ID 902294184994693224 (Guild ID 902294184994693220)
2022-09-15T20:20:44.010142763Z 2022-09-15 20:20:44 INFO discord.voice_client Disconnecting from voice normally, close code 1000.
2022-09-15T20:20:44.058592513Z 2022-09-15 20:20:44 ERROR discord.player Exception in voice thread Thread-5
2022-09-15T20:20:44.058623864Z Traceback (most recent call last):
2022-09-15T20:20:44.058629130Z File "/usr/local/lib/python3.10/dist-packages/discord/player.py", line 698, in run
2022-09-15T20:20:44.058632003Z self._do_run()
2022-09-15T20:20:44.058634500Z File "/usr/local/lib/python3.10/dist-packages/discord/player.py", line 691, in _do_run
2022-09-15T20:20:44.058637013Z play_audio(data, encode=not self.source.is_opus())
2022-09-15T20:20:44.058639334Z File "/usr/local/lib/python3.10/dist-packages/discord/voice_client.py", line 683, in send_audio_packet
2022-09-15T20:20:44.058648759Z self.socket.sendto(packet, (self.endpoint_ip, self.voice_port))
2022-09-15T20:20:44.058653057Z OSError: [Errno 9] Bad file descriptor
2022-09-15T20:20:44.058673762Z 2022-09-15 20:20:44 INFO discord.player ffmpeg process 12 has not terminated. Waiting to terminate...
2022-09-15T20:20:44.062083854Z 2022-09-15 20:20:44 INFO discord.player ffmpeg process 12 should have terminated with a return code of -9.



Dockerfile :


ENV MEDIA_DIR='/media/'
RUN mkdir -p /media



Download function (check_path returns True, showing the file is there) :


def download_videos(stream, filename):
 print(f'downloading {filename}')
 filepath = stream.download(output_path=config_db.environ_path, filename=f'{filename}.mp4')
 print(f'completed download of {filepath}')
 check_path = Path(filepath)
 if check_path.is_file():
 print(check_path)
 return filepath



Play function :


async def play(voice_channel, message, control = None):
 vc = get_vc()
 if not vc:
 vc = await voice_channel.connect()
 next_yt = YouTube(next_song)
 next_file = sub(r'\W+', '', next_yt.title.replace(' ', '_').replace('__', '_')).lower()
 next_song_path = download_videos(next_yt.streams.filter(only_audio=True, file_extension='mp4')[0], next_file)

 await message.channel.send(f'Done getting ready, I\'ll be there in a moment.')

while next_song:
 while vc.is_playing():
 await asynciosleep(0.5)
 continue

 try:
 vc.play(FFmpegPCMAudio(next_song_path))
 print(f'Playing {next_song_path} with latency of {vc.average_latency}')
 vc.source = PCMVolumeTransformer(vc.source, volume=0.15)
 except Exception as e:
 print(e)
 await vc.disconnect()
 next_song = None
 return
 next_song = sounds_db.get_next_song()
 next_yt = YouTube(next_song) if next_song else None
 next_file = sub(r'\W+', '', next_yt.title.replace(' ', '_').replace('__', '_')).lower() if next_song else None
 next_song_path = download_videos(next_yt.streams.filter(only_audio=True, file_extension='mp4')[0], next_file) if next_song else None



I've mounted the /media/ dir during docker -v and can see the file is getting downloaded and when I copy the file to my local machine I can play it in an audio player.


The program can access the SQLite database right next to the files in question just fine.


I've deployed the container locally and to two different VPS's with the same file structure with the same behavior. I'm ripping my hair out.


-
The Mystery of the No such file or directory exception
22 avril 2022, par JohnWickNo idea what's going on here. Set a breakpoint after the for of loop in the following function. temp/concat.txt exists but the following exception is thrown :




Uncaught Error Error : ffmpeg exited with code 1 : temp/concat.txt : No
such file or directory




Outputting stderr gives a bit more info :




[concat @ 000001e2e30124c0] Impossible to open
'temp/concat.txt#voiceover #funny #fall #lol.mp4' index.js:19
temp/concat.txt : No such file or directory




And here is the contents of concat.txt, standard ffmpeg concat demuxer format :


file '#voiceover #funny #fall #lol.mp4'
file 'part 2 repost 🙄 #fyp #funny @jordond262 @princemoonjq add my snap heroicdw333.mp4'
file 'This is my hair wet wet WOAHHH #GrowUpWithMe #fyp #foryoupage #love #funny #puppy #goldenretriever #cute #dog #wetwet.mp4'
file 'POV calling your friends when your 90#FootlongShuffle #GhostMode #funny #grandma #fyp #halloween #collegegotmelike #tiktok #foryoupage.mp4'
file 'Sam Ki Singing Kaisi Lgi 😂😜 insta-samayranarula #foryou #trending #lockdown #queen_samayra #tiktokindia #funny #gharbaithoindia 🏠 #comedyindia.mp4'
file 'Reply to @juswa646 #fyp#funny #relatable.mp4'
file 'RaNdOm ViDeOs! #fy #fypシ #viral #meme #funny #xyzbca #funnyvideos #randomvideo.mp4'
file 'Reply to @bratzdoll.maya what should I do next 🙄 #fyp #foryoupage #leethe4th #memes #tall #funny #lol.mp4'
file 'Part 2 #fyp #foryou #viral #foryoupageofficiall #funny #trending.mp4'
file 'Lmfao 😂 (via @danibreezy01) #lmao #lmfao #funny #cousins #family #fyp #foryou #foryoupage.mp4'
file 'When you are a clumsy kitty #trend #joke #Khaleesi #funny #kittensoftiktok #foryou #fyp #foryoupage #cute #catsoftiktok.mp4'
file 'Tag That Friend That Always Be Falling Asleep 😂 #foryou #funny #fail #nap #sleep #pennsylvania #SHEINcares #viral #trending #meme #memes #foryoupage.mp4'
file '#funny #funnyvideos #girlfriend #crzy #Birdshit.mp4'
file 'He forgot he was a dog. #dog #fyp #talkingdog #cute #pet #funny.mp4'
file 'Bad Day #part1 #badday #falling #funny #memes #viral #jokes #comedy #trending #fyp #foryou #share #likes #us #uk #xyzbca #epic #pourtoi #fail #wee.mp4'
file 'I think he got offended ( #catsoftiktok #fyp #funny #catlover #MyJob #yellow #foryoupage.mp4'
file 'They took OFF today 🐶🤠🐶 #joshbutlertv #roxyandremi #funny #comedy #dogs #viral #memes.mp4'
file 'Had to make sure momma was there #funny #fyp #raccoons #love #bff #foryoupage #ThisorThatSBLV.mp4'
file 'That\'s not how you get out... #mysterymakers #escaperoom #foryou #fyp #crazystory #friends #funny #crazy #teammate.mp4'



The function throwing the exception.


async function makeCompilation(paths, outPath) {
 for (const filePath of paths) {
 await fs.appendFile(
 "temp/concat.txt",
 `file '${path.basename(filePath).replace("'", "\\'")}'${os.EOL}`
 );
 }
 return new Promise((resolve, reject) => {
 ffmpeg("temp/concat.txt")
 .inputOptions(["-f concat", "-safe 0"])
 .outputOption("-c copy")
 .on("stderr", (line) => console.log(line))
 .on("end", async () => {
 await fs.rm("temp/concat.txt");
 resolve();
 })
 .save(outPath);
 });
}