Recherche avancée

Médias (1)

Mot : - Tags -/remix

Autres articles (71)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

Sur d’autres sites (10340)

  • 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()
  • Invalid data found when processing input when trying to convert vox file

    23 mars 2020, par topplethepat

    I get the error "Invalid data found when processing input" when trying to convert a vox/adpcm file to a different format (tried wav and mp3).

    I tried :

       ffmpeg -c:a adpcm_ima_oki -i x.vox -c:a pcm_s16le out_x.wav

    to see if I could force FFmpeg to use a specific decoder. This is from the thread here : https://www.reddit.com/r/ffmpeg/comments/chmqbr/unable_to_convert_adpcm_file/ but the same error occurs.

    EDIT : (I found out my codec was wrong. It should be g711)

    Using correct codec now, I tried :

       ffmpeg -headers G.711 -i x.adpcm -c:a G.711 -c:a pcm_s161e y.wav

    to see if inserting the codec as the header would suffice. But, same error. From the logs (truncated but all populated fields included) :

       ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
     built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-36)
     configuration:  --enable-decoder=pcm_f32le --enable-decoder=pcm_f64le
    --enable-decoder=pcm_s16le --enable-decoder=pcm_s24le --enable-
    decoder=pcm_s32le
     libavutil      56. 22.100 / 56. 22.100
     libavcodec     58. 35.100 / 58. 35.100
     libavformat    58. 20.100 / 58. 20.100
     libavdevice    58.  5.100 / 58.  5.100
     libavfilter     7. 40.101 /  7. 40.101
     libswscale      5.  3.100 /  5.  3.100
     libswresample   3.  3.100 /  3.  3.100
     libpostproc    55.  3.100 / 55.  3.100
      Splitting the commandline.
    Reading option '-headers' ... matched as AVOption 'headers' with
    argument 'G.711'.
    Reading option '-i' ... matched as input url with argument 'x.adpcm'.
    Reading option '-c:a' ... matched as option 'c' (codec name) with
    argument 'G.711'.
    Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'pcm_s161e'.
    Reading option 'y.wav' ... matched as output url.
    Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
    Finished splitting the commandline.
    Parsing a group of options: global .
    Applying option v (set logging level) with argument debug.
    Successfully parsed a group of options.
    Parsing a group of options: input url x.adpcm.
    Successfully parsed a group of options.
    Opening an input file: x.adpcm.
    [NULL @ 0x5555574651c0] Opening 'x.adpcm' for reading
    [file @ 0x555557465b00] Setting default whitelist 'file,crypto'
    [AVIOContext @ 0x55555746dec0] Statistics: 1048576 bytes read, 0 seeks
    x.adpcm: Invalid data found when processing input

    Does anyone have insights into how to convert a headerless format like this ? Is the problem that it needs to have headers in the conversion request and I’ve inserted the wrong headers ?

  • How to download m3u8 playlist with URL redirection ? (blob URL,HydraX, JW Player version 8.4.2)

    17 novembre 2019, par wltprgm

    The video in https://hydrax.net/ is using HLS, .m3u8 file, direct link is https://hydrax.net/demo/hydrax.html (from the iframe src).

    However, youtube-dl couldn’t read from the .m3u8 file I downloaded from blob in chrome.

    And using ffmpeg method (which usually works) to download from the .m3u8 file failed because the first segment of the file is a URL redirect

    Error when loading first segment 'https://i.donald-gaines.xyz/redirect/7qC173pnWiDwe2TumUTYnzX4WdbPn8XJDzhqDzXPo39PWtX4EaAxLq7FLUW17aI/WhsiWh1RO6oSXzr6QqkTOgljgRrXBgpJtQf6gMBAC5Jq95JkuQlWKpfpgPoo/BSGGloj6MOe7cO4K9HoDj76PRzjSVoiwcJ1Xl34kc3Z5/Bl2WS3KO8WsicRVG8l1EBoi3RN2DnqZx6o13U56YnDBv'
    2b0bdf87-656f-4880-8357-f7fd6329b2f8.m3u8: Invalid data found when processing input

    Somebody asked the same question in reddit some days ago : link