
Recherche avancée
Médias (3)
-
Exemple de boutons d’action pour une collection collaborative
27 février 2013, par
Mis à jour : Mars 2013
Langue : français
Type : Image
-
Exemple de boutons d’action pour une collection personnelle
27 février 2013, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
Autres articles (111)
-
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...) -
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 -
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 (6875)
-
Anomalie #4001 (Fermé) : date_thread non renseignée sur le forum admin
20 septembre 2017, par Julien -Bonjour,
SPIP 3.2-beta.
Le date_thread n’est pas renseigné sur les messages laissés dans le forum administrateur.
C’était le cas en SPIP 2.1.Peut-être que ce changement est venu de #3398
-
Why doesn't seem to be able to send an audio file with FRONT_COVER on the Pytelegrambotapi
27 décembre 2024, par exorikIn general the problem is that the audio file is sent to a file without a picture. I first thought that the problem is that the picture is installed on the wrong version of id3, and tried four methods of installation


- 

-
via the ffmpeg
command = [ “ffmpeg”, “-i”, file_path, “-i”, cover_path, “-map”, “0”, “-map”, “1”, “-c:a”, “copy”, “-c:v”, “mjpeg”, “-id3v2_version”, “3“,”-y”, output_file, ]subprocess.run(command, check=True)


-
via eyed3, audiofile.tag.images.set(
eyed3.id3.frames.ImageFrame.FRONT_COVER,
cover_data,
“` image/jpeg,
)


-
through the mutagen library, tried setting audio.add(
APIC(
encoding=3,
mime=“image/jpeg”,
type=3,
desc=“Cover”,
data=open(saved_photo, “rb”).read(),
)
)
At this stage I realized that the problem is not in the correct id3 tag setting, but in the method through which the audio file is sent. because if I opened it manually and sent it, the cover was there.
But I also tried installing the tag. second version. through the eyed3 library, but that also didn't result in the audio file with the cover art being sent to telegram.












and the exact same audio file, only with the cover art. (it hasn't been altered in any way)





user_states = {}




def save_audio(message):
 file_info = bot.get_file(message.audio.file_id)
 downloaded_file = bot.download_file(file_info.file_path)

 user_dir = os.path.join("TEMP", str(message.chat.id), "albums")
 os.makedirs(user_dir, exist_ok=True)

 original_file_name = (
 message.audio.file_name
 if message.audio.file_name
 else f"{message.audio.file_id}.mp3"
 )

 file_path = os.path.join(user_dir, original_file_name)

 if message.chat.id not in user_states:
 user_states[message.chat.id] = {"files": [], "stage": None}

 with open(file_path, "wb") as f:
 f.write(downloaded_file)

 user_states[message.chat.id]["files"].append(file_path)

 return file_path


def clear_metadata_for_file(file_path, user_id):
 clear_metadata = settings.get(str(user_id), {}).get("clear", True)

 if clear_metadata:
 temp_file_path = f"{file_path}.temp.mp3"
 command = [
 "ffmpeg",
 "-i",
 file_path,
 "-map_metadata",
 "-1",
 "-c:a",
 "copy",
 "-y",
 temp_file_path,
 ]
 subprocess.run(command, check=True)
 os.replace(temp_file_path, file_path)

 audio_file = eyed3.load(file_path)
 if audio_file.tag is not None:
 audio_file.tag.clear()
 audio_file.tag.save()

 else:
 return file_path


def send_files(message):
 chat_id = message.chat.id
 if chat_id not in user_states or "files" not in user_states[chat_id]:
 return "No files found"

 for file_path in user_states[chat_id]["files"]:
 try:
 with open(file_path, "rb") as f:
 bot.send_audio(chat_id, f)
 except Exception as e:
 return e



@bot.message_handler(content_types=["photo"])
def handle_cover(message):

 if message.content_type == "photo":
 try:

 saved_photo = save_photo(message)


 for file_path in user_states[message.chat.id]["files"]:

 audio = ID3(file_path)
 audio.add(
 APIC(
 encoding=3,
 mime="image/jpeg",
 type=3,
 desc="Cover",
 data=open(saved_photo, "rb").read(),
 )
 )
 audio.save(file_path)
 with open(saved_photo, "rb") as image_file:
 image_data = image_file.read()

 audiofile = eyed3.load(file_path)

 if audiofile.tag is None:
 audiofile.initTag(version=(2, 3, 0))

 audiofile.tag.images.set(
 3, image_data, "image/jpeg", description="Cover"
 )
 audiofile.tag.save(version=(2, 3, 0))

 send_files(message)

 except Exception as e:
 return

bot.infinity_polling()




I was hoping to get some audio files with cover art, and I'm sure there's no problem with that. But for some reason, the file itself is sent visually without the cover art. I'd really appreciate it if you could help me out with this.


-
-
python h265 webcam streaming
26 mai 2021, par D.GiunchiI did a very simple python video chat that from OpenCV takes the frames from webcam and send them through udp socket.
If I want to use h265 and ffmpeg-python, what should I do ? Is there some example somewhere ?