Recherche avancée

Médias (91)

Autres articles (40)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (6505)

  • Trim video file to edit-out silent parts

    18 décembre 2018, par karel

    I have video recordings of webinars with long silent gaps in them. I need to edit out the silent parts (both the audio and corresponding video tracks). I need to do this through a linux command and be able to do this as a batch action for several video files.
    Ideal scenario is to run a command that :

    1. detects long silent gaps (longer than defined time threshold, e.g. 5
      seconds)
    2. cuts out long silent sections and leaves only 5 seconds of
      silent video bet ween all ’loud’ video sections.

    In another post I found this great script (below). It does the job, but it a) doesn’t leave in extra silent 5 seconds of video which I need after every ’loud’ video part, and b) doesn’t compile produced video files into one composed video file (this problem is less of an issue for me, although it would be great to do that in the same command).

    I didn’t figure out how to modify the script to do this.

    Thanks beforehand for any suggestion.

    ffmpeg -i input.mkv -filter_complex "[0:a]silencedetect=n=-90dB:d=0.3[outa]" -map [outa] -f s16le -y /dev/null |& F=’-aq 70 -v warning’ perl -ne ’INIT $ss=0 ; $se=0 ; if (/silence_start : (\S+)/) $ss=$1 ; $ctr+=1 ; printf "ffmpeg -nostdin -i input.mkv -ss %f -t %f $ENVF -y %03d.mkv\n", $se, ($ss-$se), $ctr ; if (/silence_end : (\S+)/) $se=$1 ; END printf "ffmpeg -nostdin -i input.mkv -ss %f $ENVF -y %03d.mkv\n", $se, $ctr+1 ; ’ | bash -x

  • Trimming and batch converting arbitrary video files to WebMs with python and ffmpeg

    22 juin 2018, par Romtromon

    I’ve got a whole lot of video files that I want to break up into multiple WebMs, each containing a trimmed portion of a specific video.

    I plan on having a csv file attached to each video file (having the same filename as the video) with a column structure similar to :

    Start Time | End Time | Rotation | Output Filename

    And I want to parse the csv files using python to execute ffmpeg, and I did a quick search and found the ffmpeg-python library and thought it might do the trick. The problem is, I don’t know the first thing about ffmpeg or video encoding. I’ve tried reading through the ffmpeg documentation and trying to replicate stuff using ffmpeg-python but the furthest I can get is an output video of the same format as the input file, trimmed (but mpv still shows the duration as the duration of the original file but cuts off playback when the end of the trim is reached) and without audio.

    As a side note, I currently use a software named "WebM for Retards" (excuse the offensive title) which uses ffmpeg and I’m happy with its output but it’s very tedious for my requirement. However I noticed that these are the arguments passed by using the software :

    -f nut -i pipe:0   -c:v libvpx -pix_fmt yuv420p -threads 8 -slices 4 -metadata title="This is a title" -ac 2 -c:a libvorbis -qmin 28 -crf 30 -qmax 32 -qcomp 1 -b:v 0 -qscale:a 3 -f webm -y "C:\Output.webm"

    I’d be happy if I could replicate output similar to what this provides. Thanks in advance for any help !

  • 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.