Recherche avancée

Médias (2)

Mot : - Tags -/doc2img

Autres articles (27)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une 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 (...)

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

  • Contribute to documentation

    13 avril 2011

    Documentation 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 (4903)

  • How to make a bot available to multiple users on blocking operations ? python, aiogram, pytube, ffmpeg

    27 février 2023, par Tony Reznik

    I'm trying to deal with multithreading and asynchrony, but I can't figure out how to deal with this situation.

    


    There is a telegram bot that downloads videos from YouTube and cuts only the first minute of the video into a separate file. Pytube and ffmpeg are used. The second bot user does not receive any response from the bot while the tasks of the first one are running. How to deal with such difficulties ?

    


    import subprocess

from aiogram import Bot, Dispatcher, types
from aiogram.utils import executor
from pytube import YouTube
import time

API_TOKEN = 'tkn'

bot = Bot(token=API_TOKEN)
dp = Dispatcher(bot)

video_folder = 'video/'


@dp.message_handler()
async def start_convert(message: types.Message):
    url = message.text
    yt = YouTube(url)

    await message.reply('accepted')

    video_name = time.strftime("%d-%m-%Y-%H-%M-%S") + '.mp4'

    video = yt.streams.get_highest_resolution()
    video.download(video_folder, filename=video_name)

    await message.reply('downloaded')

    subprocess.call(['ffmpeg', '-hide_banner', '-loglevel', 'error', '-i', f'{video_folder}{video_name}',
                     '-ss', '0', '-c:v', 'libx264', '-c:a', 'aac', '-b:v', '5M', '-to', '60',
                     f'{video_folder}1_min_{video_name}'])

    await message.reply('trimmed')

if __name__ == '__main__':
    executor.start_polling(dp, skip_updates=True)



    


    This is a code template.
In the current form, I want to understand how to implement the task correctly.

    


  • Tell users about supported audio samplerates in mmf.

    19 mars 2012, par Carl Eugen Hoyos

    Tell users about supported audio samplerates in mmf.

  • lavf/mov : Tell users about the use_absolute_path option.

    16 mai 2015, par Carl Eugen Hoyos
    lavf/mov : Tell users about the use_absolute_path option.
    

    Fixes ticket #4539.

    • [DH] libavformat/mov.c