Recherche avancée

Médias (1)

Mot : - Tags -/ticket

Autres articles (26)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

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

Sur d’autres sites (4104)

  • ffmpeg volumn not work in complex filter

    6 février 2018, par rick lee

    "volumn" filter not work in complex filter.
    the audio that converted volumn is not affected.

    env : Mac OS 10.12.6

    ffmpeg -i /path/bg.mp3 -y -filter_complex [0:0]volume=0[output] -map
    [output] -acodec libmp3lame -write_xing 0 /path/mixed.mp3

    full log =====================================================================

    liqideMacBook-Pro:pinyin-api work$ ffmpeg -i
    /Users/work/dev/codebase/pinyin/pinyin-api/test/resources/bg_audio2.mp3
    -y -filter_complex [0:0]volume=0.1[output] -map [output] -acodec
    libmp3lame -f mp3 -write_xing 0 /Users/work/dev/codebase/pinyin/pinyin-
    api/test/resources/mixed3.mp3
    ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers
     built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/3.4.1 --enable-
    shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --
    enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-
    gpl --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-
    opencl --enable-videotoolbox --disable-lzma
     libavutil      55. 78.100 / 55. 78.100
     libavcodec     57.107.100 / 57.107.100
     libavformat    57. 83.100 / 57. 83.100
     libavdevice    57. 10.100 / 57. 10.100
     libavfilter     6.107.100 /  6.107.100
     libavresample   3.  7.  0 /  3.  7.  0
     libswscale      4.  8.100 /  4.  8.100
     libswresample   2.  9.100 /  2.  9.100
     libpostproc    54.  7.100 / 54.  7.100
    Input #0, mp3, from '/Users/work/dev/codebase/pinyin/pinyin-
    api/test/resources/bg_audio2.mp3':
     Metadata:
       title           : 喜洋洋
       album           : 贺岁新年音乐会
       encoder         : Lavf56.4.101
     Duration: 00:02:43.58, start: 0.025057, bitrate: 128 kb/s
       Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
    Stream mapping:
     Stream #0:0 (mp3) -> volume
     volume -> Stream #0:0 (libmp3lame)
    Press [q] to stop, [?] for help
    Output #0, mp3, to '/Users/work/dev/codebase/pinyin/pinyin-
    api/test/resources/mixed3.mp3':
     Metadata:
       TIT2            : 喜洋洋
       TALB            : 贺岁新年音乐会
       TSSE            : Lavf57.83.100
       Stream #0:0: Audio: mp3 (libmp3lame), 44100 Hz, stereo, fltp
       Metadata:
         encoder         : Lavc57.107.100 libmp3lame
    [libmp3lame @ 0x7fad80001a00] Trying to remove 1152 samples, but the
    queue is empty
    size=    2556kB time=00:02:43.57 bitrate= 128.0kbits/s speed=51.7x
    video:0kB audio:2556kB subtitle:0kB other streams:0kB global
    headers:0kB muxing overhead: 0.003782%
    liqideMacBook-Pro:pinyin-api work$

    =====================================================================

  • How to fix out of bounds error in to_soundarray in moviepy ?

    16 décembre 2019, par Rad0n

    The code works with the default youtube_dl name but not outtmpl name that I put in ydl_opts

    the solution given here - https://www.reddit.com/r/moviepy/comments/dwc27w/to_sound_array_issue/
    doesnt seem to work

    here is the code -

    import numpy as np
    import matplotlib.pyplot as plt
    %matplotlib inline
    import moviepy.editor as mpy
    !pip install youtube_dl
    import youtube_dl


    url = 'https://www.youtube.com/watch?v=5pIpVK3Gecg'
    start_ts = 170
    end_ts = 180

    ydl_opts = {
     'format': 'bestaudio/best',
     'postprocessors': [{
         'key': 'FFmpegExtractAudio',
         'preferredcodec': 'wav',
         'preferredquality': '192',
     }],
     'outtmpl': 'original.wav',

    }

    with youtube_dl.YoutubeDL(ydl_opts) as ydl:
     ydl.download([url])


    from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip

    ffmpeg_extract_subclip('original.wav' ,170, 180, targetname='clipped.wav')

    talk = mpy.AudioFileClip('clipped.wav')


    plt.axis('off')

    sample_rate = talk.fps

    NFFT = sample_rate /25
    audio_data = talk.to_soundarray()

    fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(2.44, 2.44), dpi=100.)

    ax.axis('off')
    spectrum, freqs, time, im = ax.specgram(audio_data.mean(axis=1), NFFT=NFFT, pad_to=4096, Fs=sample_rate,
                                           noverlap=512, mode='magnitude', )

    and here is the error -

    [youtube] 5pIpVK3Gecg: Downloading webpage
    [youtube] 5pIpVK3Gecg: Downloading video info webpage
    [download] original.wav has already been downloaded
    [download] 100% of 48.12MiB
    [ffmpeg] Correcting container in "original.wav"
    [ffmpeg] Post-process file original.wav exists, skipping

    [MoviePy] Running:
    >>> /root/.imageio/ffmpeg/ffmpeg-linux64-v3.3.1 -y -i original.wav -ss 170.00 -t 10.00 -vcodec copy -acodec copy clipped.wav
    ... command successful.

    ---------------------------------------------------------------------------

    IndexError                                Traceback (most recent call last)

    /usr/local/lib/python3.6/dist-packages/moviepy/audio/io/readers.py in get_frame(self, tt)
       189                     indices = indices - (self.buffersize // 2 - len(self.buffer) + 1)
    --> 190                 result[in_time] = self.buffer[indices]
       191                 return result

    IndexError: index -59041 is out of bounds for axis 0 with size 40960


    During handling of the above exception, another exception occurred:

    IndexError                                Traceback (most recent call last)

    10 frames

    in <module>()
        30
        31 NFFT = sample_rate /25
    ---> 32 audio_data = talk.to_soundarray()
        33
        34 fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(2.44, 2.44), dpi=100.)

    local/lib/python3.6/dist-packages/decorator.py:decorator-gen-194> in to_soundarray(self, tt, fps, quantize, nbytes, buffersize)

    /usr/local/lib/python3.6/dist-packages/moviepy/decorators.py in requires_duration(f, clip, *a, **k)
        52         raise ValueError("Attribute 'duration' not set")
        53     else:
    ---> 54         return f(clip, *a, **k)
        55
        56

    /usr/local/lib/python3.6/dist-packages/moviepy/audio/AudioClip.py in to_soundarray(self, tt, fps, quantize, nbytes, buffersize)
       115             if self.duration > max_duration:
       116                 return stacker(self.iter_chunks(fps=fps, quantize=quantize,
    --> 117                                                 nbytes=2, chunksize=buffersize))
       118             else:
       119                 tt = np.arange(0, self.duration, 1.0/fps)

    &lt;__array_function__ internals> in vstack(*args, **kwargs)

    /usr/local/lib/python3.6/dist-packages/numpy/core/shape_base.py in vstack(tup)
       277         # raise warning if necessary
       278         _arrays_for_stack_dispatcher(tup, stacklevel=2)
    --> 279     arrs = atleast_2d(*tup)
       280     if not isinstance(arrs, list):
       281         arrs = [arrs]

    /usr/local/lib/python3.6/dist-packages/moviepy/audio/AudioClip.py in generator()
        82                 tt = (1.0/fps)*np.arange(pospos[i], pospos[i+1])
        83                 yield self.to_soundarray(tt, nbytes=nbytes, quantize=quantize,
    ---> 84                                          fps=fps, buffersize=chunksize)
        85
        86         if progress_bar:

    local/lib/python3.6/dist-packages/decorator.py:decorator-gen-194> in to_soundarray(self, tt, fps, quantize, nbytes, buffersize)

    /usr/local/lib/python3.6/dist-packages/moviepy/decorators.py in requires_duration(f, clip, *a, **k)
        52         raise ValueError("Attribute 'duration' not set")
        53     else:
    ---> 54         return f(clip, *a, **k)
        55
        56

    /usr/local/lib/python3.6/dist-packages/moviepy/audio/AudioClip.py in to_soundarray(self, tt, fps, quantize, nbytes, buffersize)
       128         #print tt.max() - tt.min(), tt.min(), tt.max()
       129
    --> 130         snd_array = self.get_frame(tt)
       131
       132         if quantize:

    local/lib/python3.6/dist-packages/decorator.py:decorator-gen-132> in get_frame(self, t)

    /usr/local/lib/python3.6/dist-packages/moviepy/decorators.py in wrapper(f, *a, **kw)
        87         new_kw = {k: fun(v) if k in varnames else v
        88                  for (k,v) in kw.items()}
    ---> 89         return f(*new_a, **new_kw)
        90     return decorator.decorator(wrapper)
        91

    /usr/local/lib/python3.6/dist-packages/moviepy/Clip.py in get_frame(self, t)
        92                 return frame
        93         else:
    ---> 94             return self.make_frame(t)
        95
        96     def fl(self, fun, apply_to=None, keep_duration=True):

    /usr/local/lib/python3.6/dist-packages/moviepy/audio/io/AudioFileClip.py in <lambda>(t)
        76         self.buffersize = self.reader.buffersize
        77
    ---> 78         self.make_frame = lambda t: self.reader.get_frame(t)
        79         self.nchannels = self.reader.nchannels
        80

    /usr/local/lib/python3.6/dist-packages/moviepy/audio/io/readers.py in get_frame(self, tt)
       200                 # repeat the last frame instead
       201                 indices[indices>=len(self.buffer)] = len(self.buffer) -1
    --> 202                 result[in_time] = self.buffer[indices]
       203                 return result
       204

    IndexError: index -59041 is out of bounds for axis 0 with size 40960

    </lambda></module>

    it seems to work when I don’t set outtmpl option in ydl_opts and manually enter the name that ydl auto assigns to ffmpeg_extract_subclip

    import matplotlib.pyplot as plt
    %matplotlib inline
    import moviepy.editor as mpy
    !pip install youtube_dl
    import youtube_dl

    ydl_opts = {
       'format': 'bestaudio/best',
       'postprocessors': [{
           'key': 'FFmpegExtractAudio',
           'preferredcodec': 'wav',
           'preferredquality': '192',
       }],
    }
    with youtube_dl.YoutubeDL(ydl_opts) as ydl:
       ydl.download(['https://www.youtube.com/watch?v=5pIpVK3Gecg'])

    #Tyler, The Creator - 'IGOR,' Odd Future and Scoring a Number 1 Album _ Apple Music-5pIpVK3Gecg.wav is the name
    #that youtube_dl auto assigns. I got it from the output of ydl.download command

    from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
    ffmpeg_extract_subclip("Tyler, The Creator - 'IGOR,' Odd Future and Scoring a Number 1 Album _ Apple Music-5pIpVK3Gecg.wav", 170, 180, targetname="talk.wav")


    talk = mpy.AudioFileClip('talk.wav')


    sample_rate = talk.fps
    NFFT = sample_rate /25
    audio_data = talk.to_soundarray()
  • 2023-04-18 18:25:05 INFO discord.player ffmpeg process ##### successfully terminated with return code of 0

    19 avril 2023, par I_am_thing

    I am making a discord music bot with discord.py and ctx, it uses Spotify

    &#xA;

    I am using FFmpeg for my music feature. This is my !play code

    &#xA;

    client_id = &#x27;&#x27;&#xA;client_secret = &#x27;&#x27;&#xA;client_credentials_manager = SpotifyClientCredentials(client_id=client_id, client_secret=client_secret)&#xA;sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager)&#xA;&#xA;bot.volume = 0.5 # initial volume of the bot (can be changed)&#xA;&#xA;@bot.command()&#xA;async def play(ctx, *, track_query):&#xA;    # check if the query is a valid Spotify link&#xA;    if &#x27;open.spotify.com/track/&#x27; in track_query:&#xA;        track_id = track_query.split(&#x27;/&#x27;)[-1] # extract the track ID from the link&#xA;    else:&#xA;        # search for tracks with the given name&#xA;        track_results = sp.search(q=track_query, type=&#x27;track&#x27;, limit=1)&#xA;        if len(track_results[&#x27;tracks&#x27;][&#x27;items&#x27;]) == 0:&#xA;            await ctx.send(f&#x27;Sorry, I could not find any track with the name "{track_query}".&#x27;)&#xA;            return&#xA;        track_id = track_results[&#x27;tracks&#x27;][&#x27;items&#x27;][0][&#x27;id&#x27;] # get the track ID for the first search result&#xA;    track_info = sp.track(track_id) # get the track information for the given ID&#xA;    track_name = track_info[&#x27;name&#x27;]&#xA;    track_artist = track_info[&#x27;artists&#x27;][0][&#x27;name&#x27;]&#xA;    track_duration = time.strftime(&#x27;%M:%S&#x27;, time.gmtime(track_info[&#x27;duration_ms&#x27;]//1000))&#xA;    track_preview_url = track_info[&#x27;preview_url&#x27;] # get the preview URL for the track&#xA;    if track_preview_url is None:&#xA;        await ctx.send(f&#x27;Sorry, the track "{track_name}" by {track_artist} cannot be played.&#x27;)&#xA;        return&#xA;    voice_channel = ctx.author.voice.channel&#xA;    if voice_channel is None:&#xA;        await ctx.send(&#x27;Please join a voice channel first.&#x27;)&#xA;        return&#xA;    voice_client = await voice_channel.connect()&#xA;    audio_source = discord.FFmpegPCMAudio(track_preview_url, options="-b:a 128k -bufsize 512k")&#xA;    voice_client.play(audio_source, after=lambda e: print(&#x27;Player error: %s&#x27; % e) if e else None)&#xA;    voice_client.source = discord.PCMVolumeTransformer(voice_client.source)&#xA;    voice_client.source.volume = bot.volume&#xA;&#xA;    # format the embed message&#xA;    embed = discord.Embed(title=track_name, description=track_artist, color=0xff8c00)&#xA;    embed.add_field(name=&#x27;Duration&#x27;, value=track_duration, inline=True)&#xA;    embed.set_thumbnail(url=track_info[&#x27;album&#x27;][&#x27;images&#x27;][0][&#x27;url&#x27;])&#xA;    embed.set_footer(text=&#x27;This music is from https://www.spotify.com/&#x27;)&#xA;    await ctx.send(embed=embed)&#xA;&#xA;    while voice_client.is_playing():&#xA;        await asyncio.sleep(1)&#xA;    await voice_client.disconnect()&#xA;

    &#xA;

    I joined the unofficial ffmpeg discord server no one could find a fix I searched for ages and I couldn't fix it

    &#xA;