Recherche avancée

Médias (91)

Autres articles (105)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

  • Gestion de la ferme

    2 mars 2010, par

    La ferme est gérée dans son ensemble par des "super admins".
    Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
    Dans un premier temps il utilise le plugin "Gestion de mutualisation"

Sur d’autres sites (13003)

  • Telegram Bot - Editing Video in Channel Changes Aspect Ratio to Square

    11 octobre 2024, par Shayki Abramczyk

    I'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 ?

    


  • avfilter/vsrc_gradients : add square type

    26 novembre 2023, par Paul B Mahol
    avfilter/vsrc_gradients : add square type
    
    • [DH] doc/filters.texi
    • [DH] libavfilter/vsrc_gradients.c
  • converting png to movies with R via ffmpeg

    10 mai 2021, par user237554

    I want to convert a series of *.png files to a movie with R and have installed ffmpeg in the root directory. I think the installation has been successful because if I type

    


         ffmpeg -version


    


    in terminal I get all of the version information etc., etc.

    


    I have my *.png files saved in the wd and in R I say

    


        imgs <- list.files(pattern="*.png")
        saveVideo({
        for(img in imgs){
          im <- magick::image_read(img)
          plot(as.raster(im))
        }
      })


    


    I get an error message that "the command ""ffmpeg"" is not available in your system. Please install FFmpeg". Is there something I need to do to get R and ffmpeg to talk to each other ? Again, from terminal, ffmpeg is in the directory and it looks like it installed.

    


    thanks