
Recherche avancée
Autres articles (70)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
Sur d’autres sites (6498)
-
Anomalie #4562 : Suite #4468 : Unification des CSS pour les boutons et les icônes
6 octobre 2020Mais pour l’ajout là c’est bizarre on voit pas le fond, c’est un peu nul, en tout cas pour cette couleur.
Oui : https://core.spip.net/issues/4562#note-25 et https://core.spip.net/issues/4562#note-5
Peut-être l’inverse aussi, le retrait est plus gros que l’ajout : ça ne va pas.
Oui c’est pas voulu, la capture a été faite à l’arrache dans l’inspecteur, devait rester un font-size planqué quelque part (il y en a pleins d’imbriqués en vrac de partout). Les 2 étaient censés être à la même taille.
Mais bref, pour mettre le bouton d’ajout à la taille normale il y a pas trop la place pour l’instant : les
.toggle_box_link
sont positionnés en absolute, ça ferait déborder. Et s’il faut faire rentrer tout ça je sens que ça va amener modifier pleins de choses en cascade. On tire sur un fil et on finit par dérouler toute la pelote de laine :pOn peut y aller par étapes aussi : laisser tout en
.mini.link
dans un 1er temps ça me semble acceptable, histoire de garder un truc proche de ce qu’il y avait avant, mais déjà un peu plus harmonisé. Et pis après on amélioera. -
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.


-
-
FFMPEG-Convert video from variable FPS to fixed FPS, without reencode
23 janvier 2021, par the_RRContext


Some videos are composed by joining several other videos with the same codec / resolution.
The ffmpeg 'concat' function is commonly used to accomplish this task.


When concatenating videos of the same codec, resolution, but with different FPS, there will be no error, being concatenated without reencoding and generating a video file with variable FPS.


With metadata similar to :


Frame rate : 29.838 FPS
Minimum frame rate : 2.602 FPS
Maximum frame rate : 29.970 FPS
Original frame rate : 12.500 FPS



note_01 : Metadata extracted from wmpc. See the full metadata information


The problem with this profile is that some streaming platforms, despite recognizing the x264 codec and format profile High, do not play streaming videos with variable FPS.

Example : Sending video using python lib pyrogram via API to Telegram.

Attempts to solve


All failures, because it was not possible to find a method without reencode that does not generate loss of sync with audio.


With reencode


Result : The transformation process is very long (6x), as there is a reencode. But the FPS becomes successfully fixed. As it takes time, it does not meet the purpose of the search.


ffmpeg -i "input.mp4" -filter:v fps=fps=12.5 "output.mp4"


Without reencode


Result : The complete process is fast (50x), but it generates a side effect of increasing the length of the video, losing the synchronization of the video with the audio. 01h 45min 24sec video, it was improperly transformed into 04h 11min 36sec.


note_02 : This side effect of loss of sync, only occurs when the the input_video has variable FPS. But performs perfectly when the video already has fixed FPS, serving as a means for changing FPS, with 'setpts' flag that accelerates/decelerate the video to counterbalance the effect of the FPS change without reencode in duration, as describe here.

Steps

ffmpeg -y -i "input.mp4" -c copy -f h264 "output_raw_bitstream.h264"
ffmpeg -i "input.mp4" -vn -acodec copy "input_audio.aac"
ffmpeg -r 12.5 -i "input_audio.aac" -i "output_raw_bitstream.h264" -acodec copy -vcodec copy "output.mp4"



- 

- 01-Generate raw_bitstream version
- 02-Extract audio
- 03-Merge raw_bitstream and audio, defining the new FPS








note_03 : Process suggested in the topic Using ffmpeg to change framerate


note_04 : I also tried to pass '-bsf : v h264_mp4toannexb' in the previous process, generating a .ts file, before turning the video into raw_bitstream.

Unfortunately it generated the same result.

The search continues...