
Recherche avancée
Autres articles (38)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
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 -
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...)
Sur d’autres sites (6002)
-
Anomalie #2025 : Surlignage intempestif
14 avril 2011, par r o m yNon, pas en plugin, ni en option, mais par défaut. Ce surlignement devrait résulter d’un choix volontaire du webmestre, plutôt que d’être découvert ultérieurement (car c’est ignoré, mal documenté, peu maniable et peu utile), comme désagrément.
-
Anomalie #2025 (Nouveau) : Surlignage intempestif
8 avril 2011, par r o m yLe surlignage des résultats de recherche tel qu’actuellement géré par SPIP, pose plusieurs soucis, dont des surlignements, souvent plus surprenants qu’utiles, lorsqu’on arrive sur un site après une requête en moteur de recherche Google.
le surlignage devrait être inactif par défaut (poser la class (...)
-
Editing Caption in Video Message Changes Aspect Ratio to Square
12 octobre 2024, par Shayki AbramczykI'm working on a Telegram bot that processes videos by adding a watermark and then edits the original message to replace the video in a channel post. The issue I'm encountering is that when I edit the message with the new video, the aspect ratio changes, and the video becomes a square, even though the original video is in vertical format.


Here’s a simplified version of the code I’m using to edit the message with the processed video :


video_file = await video.get_file()
print(video_file)
random = randint(0,9999)
input_path = f"input_{user_id}_{random}.mp4"
output_path = f"output_{user_id}_{random}.mp4"
await video_file.download_to_drive(input_path)

loop = asyncio.get_event_loop()
executor = ThreadPoolExecutor()
await loop.run_in_executor(executor, process_video_sync, input_path, output_path, watermark_path, settings)

try:
 if return_file:
 return open(output_path, 'rb')
 if channel:
 chat_id = post.chat_id
 message_id = post.message_id
 caption = post.caption if post.caption else ""
 if settings['has_signature']:
 signature = settings['signature']
 else:
 caption = post.caption_html if post.caption_html else (post.caption or "")
 video_clip = VideoFileClip(output_path)
 await context.bot.edit_message_media(
 chat_id=chat_id,
 message_id=message_id,
 media=InputMediaVideo(media=open(output_path, 'rb'), width=video_clip.w, height=video_clip.h, caption=caption, parse_mode="HTML")
 )
 elif update.message:
 caption = update.message.caption if update.message.caption else ""
 video_clip = VideoFileClip(output_path)
 
 with open(output_path, 'rb') as video_file:
 await update.message.reply_video(
 video=InputFile(video_file),
 caption=caption,
 width=video_clip.w,
 height=video_clip.h,
 supports_streaming=True
 )
except Exception as e:
 logger.error("Error in sending video. Exception Type:", e.args[0][0], "Message:", e.args[0][1])
finally:
 os.remove(input_path)
 os.remove(output_path)



When editing the message in a channel, the video’s aspect ratio changes from vertical to square (if the video is horizonal it's ok). However, if I send the video as a new message, the aspect ratio remains correct.


How can I ensure that when I edit the video in the channel, the aspect ratio stays the same as the original, and doesn’t get cropped or turned into a square ?


EDIT :


I found it's because I editing the video caption and added there some HTML elements which cause it.


If I just add a simple text it's ok.


Why ?