Recherche avancée

Médias (3)

Mot : - Tags -/spip

Sur d’autres sites (2288)

  • File contains data in an unknown format. (m4a load from librosa)

    2 août 2022, par Moriyama Aiko

    So I am currently working on a DNN that takes in m4a files. I have ffmpeg, it creates a few batches and then dies on this error :

    


    Traceback (most recent call last):&#xA;  File "/users/work/s163838/./main.py", line 126, in <module>&#xA;    &#xA;  File "/users/work/s163838/./main.py", line 96, in main&#xA;    print("e")&#xA;  File "/apl/tryton/python/3.9.5/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 521, in __next__&#xA;    data = self._next_data()&#xA;  File "/apl/tryton/python/3.9.5/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 1203, in _next_data&#xA;    return self._process_data(data)&#xA;  File "/apl/tryton/python/3.9.5/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 1229, in _process_data&#xA;    data.reraise()&#xA;  File "/apl/tryton/python/3.9.5/lib/python3.9/site-packages/torch/_utils.py", line 425, in reraise&#xA;    raise self.exc_type(msg)&#xA;EOFError: Caught EOFError in DataLoader worker process 0.&#xA;Original Traceback (most recent call last):&#xA;  File "/users/kdm/s163838/.local/lib/python3.9/site-packages/librosa/core/audio.py", line 164, in load&#xA;    y, sr_native = __soundfile_load(path, offset, duration, dtype)&#xA;  File "/users/kdm/s163838/.local/lib/python3.9/site-packages/librosa/core/audio.py", line 195, in __soundfile_load&#xA;    context = sf.SoundFile(path)&#xA;  File "/users/kdm/s163838/.local/lib/python3.9/site-packages/soundfile.py", line 629, in __init__&#xA;    self._file = self._open(file, mode_int, closefd)&#xA;  File "/users/kdm/s163838/.local/lib/python3.9/site-packages/soundfile.py", line 1183, in _open&#xA;    _error_check(_snd.sf_error(file_ptr),&#xA;  File "/users/kdm/s163838/.local/lib/python3.9/site-packages/soundfile.py", line 1357, in _error_check&#xA;    raise RuntimeError(prefix &#x2B; _ffi.string(err_str).decode(&#x27;utf-8&#x27;, &#x27;replace&#x27;))&#xA;RuntimeError: Error opening &#x27;vox2/dev/aac/id08194/QnBYPze-x9A/00079.m4a&#x27;: File contains data in an unknown format.&#xA;&#xA;During handling of the above exception, another exception occurred:&#xA;&#xA;Traceback (most recent call last):&#xA;  File "/apl/tryton/python/3.9.5/lib/python3.9/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop&#xA;    data = fetcher.fetch(index)&#xA;  File "/apl/tryton/python/3.9.5/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch&#xA;    data = [self.dataset[idx] for idx in possibly_batched_index]&#xA;  File "/apl/tryton/python/3.9.5/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>&#xA;    data = [self.dataset[idx] for idx in possibly_batched_index]&#xA;  File "/users/work/s163838/vox_celeb_loader.py", line 53, in __getitem__&#xA;    load(speaker2utt1, self.num_samples)&#xA;  File "/users/work/s163838/vox_celeb_loader.py", line 13, in load&#xA;    wav, sr = librosa.load(path, sr=16000)&#xA;  File "/users/kdm/s163838/.local/lib/python3.9/site-packages/librosa/util/decorators.py", line 88, in inner_f&#xA;    return f(*args, **kwargs)&#xA;  File "/users/kdm/s163838/.local/lib/python3.9/site-packages/librosa/core/audio.py", line 170, in load&#xA;    y, sr_native = __audioread_load(path, offset, duration, dtype)&#xA;  File "/users/kdm/s163838/.local/lib/python3.9/site-packages/librosa/core/audio.py", line 226, in __audioread_load&#xA;    reader = audioread.audio_open(path)&#xA;  File "/users/kdm/s163838/.local/lib/python3.9/site-packages/audioread/__init__.py", line 111, in audio_open&#xA;    return BackendClass(path)&#xA;  File "/users/kdm/s163838/.local/lib/python3.9/site-packages/audioread/rawread.py", line 65, in __init__&#xA;    self._file = aifc.open(self._fh)&#xA;  File "/apl/tryton/python/3.9.5/lib/python3.9/aifc.py", line 917, in open&#xA;    return Aifc_read(f)&#xA;  File "/apl/tryton/python/3.9.5/lib/python3.9/aifc.py", line 358, in __init__&#xA;    self.initfp(f)&#xA;  File "/apl/tryton/python/3.9.5/lib/python3.9/aifc.py", line 314, in initfp&#xA;    chunk = Chunk(file)&#xA;  File "/apl/tryton/python/3.9.5/lib/python3.9/chunk.py", line 63, in __init__&#xA;    raise EOFError&#xA;EOFError&#xA;&#xA;</listcomp></module>

    &#xA;

    I am using this command

    &#xA;

        wav, sr = librosa.load(path, sr=16000)&#xA;

    &#xA;

    is it just a broken file ? How do I skip such then ? Or is it something about loading a m4a file even with ffmpeg and the desired output when tested on a single m4a file ?

    &#xA;

  • FFMpeg Unknown function in zoompan filter

    4 août 2022, par Luciano Salemme

    i'm using ffmpeg with zoompan filter in my local environment whit the following command and it works well :

    &#xA;

    ffmpeg -y -i "https://my.domain/workspaces/1/a_render_dir/video_spotx.mp4" -i "https://my.domain/workspaces/1/Gallery/travel_6.jpeg" -i "https://my.domain/workspaces/1/Gallery/travel_6.jpeg" -i "https://my.domain/workspaces/1/Gallery/travel_6.jpeg" -i "/usr/app/src/output/video.mp4/text_0.png" -i "/usr/app/src/output/video.mp4/text_1.png"    -filter_complex "[0]drawbox=x=0:y=0:w=iw:h=ih:color=00FF00@1:t=fill[padded];[0]format=yuva420p,pad=iw*2:ih*2:color=black@0,zoompan=z=&#x27;if(lt(it,0),2,if(lte(pzoom,1.0),2,max(1.56,pzoom-0.005789473684210526)))&#x27;:x=0:y=0:d=1:s=950x540[zp],[padded][zp]overlay=x=&#x27;if(lt(t,3.04),t*213/3.04,213)&#x27;:y=&#x27;if(lt(t,3.04),t*50/3.04,50)&#x27;:eval=frame[zp_stream],[1:v]scale=237.5:-1 [image1],[2:v]scale=237.5:-1 [image2],[3:v]scale=237.5:-1 [image3],[4:v]scale=475:-1 [image4],[5:v]scale=237.5:-1 [image5],[zp_stream][image1] overlay=95:54:enable=&#x27;between(t,3,8)&#x27; [overlay1],[overlay1][image2] overlay=380:216:enable=&#x27;between(t,3,8)&#x27; [overlay2],[overlay2][image3] overlay=532:54:enable=&#x27;between(t,5,10)&#x27; [overlay3],[overlay3][image4] overlay=475:270:enable=&#x27;between(t,1,8)&#x27; [overlay4],[overlay4][image5] overlay=0:0:enable=&#x27;between(t,1,8)&#x27; [overlay5]" -map "[overlay5]" -pix_fmt yuv420p -map 0:a -c:a copy "/usr/app/src/output/video.mp4/render_video.mp4"&#xA;

    &#xA;

    However when i build a docker container and run that command it is not working. The output error is the following :

    &#xA;

    [Parsed_zoompan_3 @ 0x2a08ac0c5140] [Eval @ 0x3ec4ec4c9ad0] Unknown function in &#x27;it,0),2,if(lte(pzoom,1.0),2,max(1.56,pzoom-0.005789473684210526)))&#x27;&#xA;

    &#xA;

    I tried to add a fixed z value to the zoompan filter, and the command works also inside the container, so the issue is on the zoompan syntax.

    &#xA;

    Here is my docker file

    &#xA;

    FROM node:16&#xA;&#xA;ENV NODE_ENV=production&#xA;&#xA;RUN apt-get -y update &amp;&amp; \&#xA;    apt-get install -y  ffmpeg \&#xA;    build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev &#xA;&#xA;WORKDIR /usr/src/app&#xA;COPY . .&#xA;RUN npm ci --production --silent&#xA;&#xA;CMD node src/index.js&#xA;

    &#xA;

    Problem starts when i switch on new Macbook pro with M1 processor, but i'm not sure it's related, i build the image with the following command :

    &#xA;

    docker buildx build --platform linux/x86_64  -t render-job .&#xA;

    &#xA;

    On my macchine there is ffmpeg 5.0.1 installed, but on docker container the command apt-get install -y     ffmpeg installs just the follow wersion :

    &#xA;

    ffmpeg version 4.1.9-0&#x2B;deb10u1 Copyright (c) 2000-2022 the FFmpeg developers&#xA;  built with gcc 8 (Debian 8.3.0-6)&#xA;

    &#xA;

    I don't think is relate to the version, because before to build with M1 processor the zoompan filter was working also in the container.

    &#xA;

    Any help is appreciated.&#xA;Thanks.

    &#xA;

  • ffmpeg : create slideshow of unknown number of images with transition

    13 août 2022, par FreddyVi

    hope someone could help me with this. Kinda new with ffmpeg and a bit stumped.

    &#xA;

    Given an input of a set of numbered images in a folder, I want to generate a video with each image shown for 60 seconds. I would love to use a default transition between each images.

    &#xA;

    The following code, correctly generates an mp4 without transitions :

    &#xA;

    ffmpeg -framerate 1/60 -pattern_type glob -i "*.png" -vcodec libx264 \&#xA;-pix_fmt yuv420p -r 30 -threads 4 -crf 25 -refs 1 -bf 0 -coder 0 -g 25 \&#xA;-keyint_min 15 -movflags &#x2B;faststart no_audio_output.mp4&#xA;

    &#xA;

    But when I try to add a default transition (supported in the version of ffmpeg I'm using that is the 5.1) :

    &#xA;

    ffmpeg -framerate 1/60 -pattern_type glob -i "WC*.png" -filter_complex &#xA;xfade=transition=circleopen:duration=5:offset=55 -vcodec libx264 \&#xA;-pix_fmt yuv420p -r 30 -threads 4 -crf 25 -refs 1 -bf 0 -coder 0 -g 25 \&#xA;-keyint_min 15 -movflags &#x2B;faststart no_audio_output.mp4&#xA;

    &#xA;

    I have as error :

    &#xA;

    Cannot find a matching stream for unlabeled input pad 1 on filter Parsed_xfade_0&#xA;

    &#xA;

    I googled a lot but still the solution is unclear. All the examples I found have been designed to deal with a slideshow/input with a define number of pieces while in my case the folder could contain any number of images.

    &#xA;

    Thanks all for your help !

    &#xA;