Advanced search

Medias (91)

Other articles (105)

  • Encoding and processing into web-friendly formats

    13 April 2011, by

    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 April 2011, by

    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 March 2010, by

    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"

On other websites (12572)

  • Editing Video in Channel Changes Aspect Ratio to Square

    11 October 2024, by 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?

    


  • Download highest quality audio from YouTube using youtube-dl

    3 June 2020, by darvast

    I'm using this command:

    



    youtube-dl -f bestaudio --extract-audio --audio-format "opus" --add-metadata -o "%(playlist_index)s-%(title)s.%(ext)s" "https://www.youtube.com/playlist?list=OLAK5uy_lWRq5MhPNthDDe1nYXtlekDA40wtrpKE0"


    



    Here's the available streams:

    



    [info] Available formats for 6t1dErgAglk:
format code  extension  resolution note
249          webm       audio only tiny   58k , opus @ 50k (48000Hz), 416.34KiB
250          webm       audio only tiny   72k , opus @ 70k (48000Hz), 516.52KiB
140          m4a        audio only tiny  130k , m4a_dash container, mp4a.40.2@128k (44100Hz), 1.06MiB
251          webm       audio only tiny  131k , opus @160k (48000Hz), 923.79KiB
278          webm       140x144    144p   32k , webm container, vp9, 25fps, video only, 159.74KiB
160          mp4        140x144    144p   54k , avc1.4d400b, 25fps, video only, 278.62KiB
242          webm       232x240    240p   71k , vp9, 25fps, video only, 321.29KiB
134          mp4        350x360    360p   96k , avc1.4d4015, 25fps, video only, 303.75KiB
133          mp4        232x240    240p  124k , avc1.4d400c, 25fps, video only, 651.46KiB
243          webm       350x360    360p  126k , vp9, 25fps, video only, 545.77KiB
135          mp4        466x480    360p  174k , avc1.4d401e, 25fps, video only, 534.97KiB
244          webm       466x480    360p  215k , vp9, 25fps, video only, 1003.20KiB
136          mp4        698x720    720p  305k , avc1.4d401f, 25fps, video only, 942.76KiB
137          mp4        1048x1080  1080p  494k , avc1.640020, 25fps, video only, 1.49MiB
247          webm       698x720    720p  593k , vp9, 25fps, video only, 1.97MiB
248          webm       1048x1080  1080p  768k , vp9, 25fps, video only, 3.81MiB
18           mp4        350x360    360p  213k , avc1.42001E, 25fps, mp4a.40.2@ 96k (44100Hz), 1.73MiB
22           mp4        698x720    720p  242k , avc1.64001F, 25fps, mp4a.40.2@192k (44100Hz) (best)


    



    When I run the above command it seems to be converting m4a to opus: https://prnt.sc/st2l8u

    



    I'm wondering why it's doing that instead of getting it from the webm container?

    


  • Révision 21337: Ne pas confondre le Kazakh (kk - http://fr.wikipedia.org/wiki/Kazakh) et le Konk...

    5 May 2014, by kent1 -