Recherche avancée

Médias (0)

Mot : - Tags -/masques

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (57)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

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

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

Sur d’autres sites (6945)

  • How can I resolve the FileNotFoundError when attempting to convert an MP3 to WAV using ffmpeg in Python ?

    3 juin 2023, par avocado123123

    I have an MP3 file that I want to convert into a WAV file, but no matter how I try writing the code, it keeps raising FileNotFoundError on the MP3 file and warns me about the installation of FFmpeg.

    


    my code :

    


    from pydub import AudioSegment

# Specify the path to the FFmpeg executable
ffmpeg_path = r"C:\Users\תמרה\AppData\Local\ffmpegio\ffmpeg-downloader\ffmpeg\bin\ffmpeg.exe"
AudioSegment.ffmpeg = ffmpeg_path
AudioSegment.ffprobe = ffmpeg_path

# Load the MP3 file
mp3_file = r"C:\Users\תמרה\Tea Time - Ofshane.mp3"
audio = AudioSegment.from_file(mp3_file, format="mp3")

# Export as WAV
wav_file = r"C:\Users\תמרה\Tea Time - Ofshane.wav"
audio.export(wav_file, format="wav")


    


    when running :

    


    C:\Users\תמרה\PycharmProjects\spotify\venv\Scripts\python.exe "C:\Users\תמרה\PycharmProjects\spotify\file stuff.py" C:\ffmpeg-2023-05-29-git-45fa85a777-full_build\bin\ffmpeg.exe &#xA;C:\Users\תמרה\PycharmProjects\spotify\venv\lib\site-packages\pydub\utils.py:170: RuntimeWarning: Couldn&#x27;t find ffmpeg or avconv - defaulting to ffmpeg, but may not work&#xA;  warn("Couldn&#x27;t find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)&#xA;C:\Users\תמרה\PycharmProjects\spotify\venv\lib\site-packages\pydub\utils.py:198: RuntimeWarning: Couldn&#x27;t find ffprobe or avprobe - defaulting to ffprobe, but may not work&#xA;  warn("Couldn&#x27;t find ffprobe or avprobe - defaulting to ffprobe, but may not work", RuntimeWarning)&#xA;Traceback (most recent call last):&#xA;  File "C:\Users\תמרה\PycharmProjects\spotify\file stuff.py", line 12, in <module>&#xA;    audio = AudioSegment.from_file(mp3_file, format="mp3")&#xA;  File "C:\Users\תמרה\PycharmProjects\spotify\venv\lib\site-packages\pydub\audio_segment.py", line 728, in from_file&#xA;    info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)&#xA;  File "C:\Users\תמרה\PycharmProjects\spotify\venv\lib\site-packages\pydub\utils.py", line 274, in mediainfo_json&#xA;    res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)&#xA;  File "C:\Users\תמרה\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 971, in __init__&#xA;True&#xA;    self._execute_child(args, executable, preexec_fn, close_fds,&#xA;  File "C:\Users\תמרה\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 1440, in _execute_child&#xA;    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,&#xA;FileNotFoundError: [WinError 2] The system cannot find the file specified&#xA;&#xA;Process finished with exit code 1&#xA;&#xA;</module>

    &#xA;

    What should I do to make this work ?

    &#xA;

  • Pydub : How to ave audio after convert it to aac ?

    4 août 2023, par suvodipMondal

    I am using django admin form to recieve a audio input, and I am trying to convert it into aac format with pydub.&#xA;I have installed ffmpeg in my system and also added pydub and ffmpeg-python as dependencies.

    &#xA;

    Here is the django ModelAdmin :

    &#xA;

    class AudioAdmin(admin.ModelAdmin):&#xA;    fields = (&#x27;file&#x27;, &#x27;bit_rate&#x27;, &#x27;format&#x27;)&#xA;    list_display = (&#x27;id&#x27;, &#x27;file&#x27;, &#x27;bit_rate&#x27;, &#x27;format&#x27;, &#x27;content_type&#x27;)&#xA;&#xA;    def save_model(self, request, obj, form, change):&#xA;        audio_file = form.cleaned_data[&#x27;file&#x27;]&#xA;        _, file_extension = os.path.splitext(audio_file.name)&#xA;        curr_audio = AudioSegment.from_file(file=audio_file, format=file_extension.replace(&#x27;.&#x27;, &#x27;&#x27;))&#xA;        new_audio = curr_audio.export(out_f=audio_file.name, format="aac")&#xA;        obj.file = new_audio&#xA;        obj.save()&#xA;&#xA;

    &#xA;

    I am still getting this error while converting an mp3 file in aac format.

    &#xA;

        raise CouldntEncodeError(&#xA;pydub.exceptions.CouldntEncodeError: Encoding failed. ffmpeg/avlib returned error code: 1&#xA;Command:[&#x27;ffmpeg&#x27;, &#x27;-y&#x27;, &#x27;-f&#x27;, &#x27;wav&#x27;, &#x27;-i&#x27;, &#x27;/var/folders/8g/230x9vx55p7c0bdwx0cmzx9r0000gq/T/tmpxaetjjk0&#x27;, &#x27;-f&#x27;, &#x27;aac&#x27;, &#x27;/var/folders/8g/230x9vx55p7c0bdwx0cmzx9r0000gq/T/tmpa3ae8nn1&#x27;]&#xA;Output from ffmpeg/avlib:&#xA;ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers&#xA;  built with Apple clang version 14.0.0 (clang-1400.0.29.202)&#xA;  configuration: --prefix=/usr/local/Cellar/ffmpeg/6.0 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox&#xA;  libavutil      58.  2.100 / 58.  2.100&#xA;  libavcodec     60.  3.100 / 60.  3.100&#xA;  libavformat    60.  3.100 / 60.  3.100&#xA;  libavdevice    60.  1.100 / 60.  1.100&#xA;  libavfilter     9.  3.100 /  9.  3.100&#xA;  libswscale      7.  1.100 /  7.  1.100&#xA;  libswresample   4. 10.100 /  4. 10.100&#xA;  libpostproc    57.  1.100 / 57.  1.100&#xA;Guessed Channel Layout for Input Stream #0.0 : stereo&#xA;Input #0, wav, from &#x27;/var/folders/8g/230x9vx55p7c0bdwx0cmzx9r0000gq/T/tmpxaetjjk0&#x27;:&#xA;  Duration: 00:03:14.72, bitrate: 1411 kb/s&#xA;  Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 2 channels, s16, 1411 kb/s&#xA;[NULL @ 0x7fe40da072c0] Requested output format &#x27;aac&#x27; is not a suitable output format&#xA;/var/folders/8g/230x9vx55p7c0bdwx0cmzx9r0000gq/T/tmpa3ae8nn1: Invalid argument&#xA;

    &#xA;

  • Grabbing a single image from a MS VS .NET 6.0 C# WPF process always returns the same image

    12 mai 2023, par Wolfgang Kurz

    I am trying to develop a MS VS .NET 6.0 C# WPF application to digitize my Super 8 cine films. To grab the frames of the film I want to use FFMPEG because Accord.NET6.0 DirectShow does not work under MS VS 2022 .&#xA;I use&#xA;FFmpeg 64-bit static Windows build from www.gyan.dev&#xA;Version : 2022-09-29-git-8089fe072e-full_build-www.gyan.dev

    &#xA;

    FFMPEG is invoked from a Process in ma application whicch sets the process FFMPEG start parameters. The webcam parameter is "USB Webcam" ( digital Celestron handheld microscope connected via USB - is DirectShow compatible )&#xA;The video resolution parameter "camRes" is "1280x960"

    &#xA;

    public void UpdateImage(string aString)&#xA;    {&#xA;        string startPath = "C:" &#x2B; MainWindow.bSl &#x2B; "ffmpeg" &#x2B; MainWindow.bSl &#x2B; "bin" &#x2B; MainWindow.bSl &#x2B; "ffmpeg.exe ";&#xA;&#xA;        MainWindow.aResult = "";&#xA;        System.Drawing.Bitmap result;&#xA;        ProcessStartInfo psi;&#xA;        psi = new ProcessStartInfo();&#xA;        psi.FileName = startPath;&#xA;        string targPath;&#xA;        psi.Arguments = "-f dshow -video_size" &#x2B; MainWindow.dQuote &#x2B; webCam &#x2B; MainWindow.dQuote &#x2B;&#xA;             " -framerate 10  -i video=" &#x2B; MainWindow.dQuote &#x2B; camRes &#x2B; MainWindow.dQuote &#x2B;&#xA;            " -frames:v 1 test%3d.bmp -update 1";&#xA;        string errors = "";&#xA;        string results = "";&#xA;        psi.CreateNoWindow = false;&#xA;        psi.RedirectStandardOutput = true;&#xA;        psi.RedirectStandardError = true;&#xA;        psi.WindowStyle = ProcessWindowStyle.Normal;&#xA;        psi.WorkingDirectory = "C:" &#x2B; MainWindow.bSl &#x2B; "ffmpeg" &#x2B; MainWindow.bSl &#x2B; "bin" &#x2B; MainWindow.bSl;&#xA;&#xA;        using (Process theProcess = new Process())&#xA;        {&#xA;            theProcess.StartInfo = psi;&#xA;            theProcess.Start();&#xA;&#xA;            theProcess.WaitForExit();&#xA;            while (theProcess.HasExited == false)&#xA;            {&#xA;                Thread.Sleep(50);&#xA;            }&#xA;            Thread.Sleep(50);&#xA;&#xA;            try&#xA;            {&#xA;                if (File.Exists(pathCI) == true)&#xA;                {&#xA;                    DefineImage.ffmpegRes = new Bitmap(pathCI);&#xA;                    MainWindow.actMWInstance.UpdateMessage(DateTime.Now &#x2B;&#xA;                        "- Old image disposed, new image grabbed");&#xA;                    File.Delete(pathCI);&#xA;                }&#xA;            }&#xA;            catch (System.Exception ex)&#xA;            {&#xA;                MainWindow.actMWInstance.UpdateMessage(DateTime.Now &#x2B; "Image grabbing failed");&#xA;            }&#xA;            theProcess.Close();&#xA;            theProcess.Dispose();&#xA;        }&#xA;&#xA;        if (aString.Length == 0)&#xA;        {&#xA;            File.Delete(pathCI);&#xA;            MainWindow.actMWInstance.DoMove("200", "0", true);&#xA;        }&#xA;        if (ffmpegRes != null)&#xA;        {&#xA;            BitmapSource aBMPSrc = BitmapConversion.ToWpfBitmap(ffmpegRes);&#xA;            IMGFrame.Source = aBMPSrc;&#xA;        }&#xA;        Show();&#xA;    }&#xA;

    &#xA;

    The attached screenshot shows the expected GUI content.&#xA;https://www.wkurz.com/wkurz/images/FFMPEGTEST.jpg

    &#xA;

    My problem now is, when I try to refresh the image in the DefineDialog window, I always get the same image although the film has been moved by one frame.

    &#xA;

    Is the first image cached by FFMPEG and always used again with the provided parameters.

    &#xA;

    How to force FFMPEG to replace the image with a new one.

    &#xA;


    &#xA;

    -----------------------------------------------------------------------+this is additional information to the question.&#xA;I have managed to grab the film frame but still get always the same image during a session :*

    &#xA;

    GUI of the WPF C# program

    &#xA;

    It is obvious that the cine film frame has been successfully grabbbed.&#xA;The next step should be to work at the image ( correct brightness contrast, gama and colors) and then store the evaluated correction values that have later to be applied to the frames during a batch process, which automatically transports the film, grabs the frames and corrects the colors and then stores the frames as consecutively numbered images which than can be used to generate a video with FFMPEG :

    &#xA;

    Now the problem I cannot overcome :

    &#xA;

    In the definition dialog there are 2 buttons ( Refresh and New Image). The intension is to reread / regrab a frame, if the current frame is not optimal to evaluate the correction values.

    &#xA;

    Whenever I click one of the buttons FFMPEG seems to grab an image, but FFMPEG provides always the same (identcial to the first already available image) to the caller ( a .NET C# Process in my proggram).

    &#xA;

    The output stream is a single jpg image ( test%04d.jpg ) in a specified target library . Here follows the generated output which seem to be OK according to my knowledge.

    &#xA;

    I want to ask all interested persons to look over this provided information - may be someone has an idea, what causes the fact, that FFMPEG 6.0 van Neumann always delivers the first image grabbed. in a session.&#xA;It seems that there is something cached and reused over and over again.

    &#xA;

    DefImg 147: UpdateImage started ( Lines starting with DefImg or DefineImage are test output statements provided by the C# program)&#xA;

    &#xA;

    DefineImage 155 11.05.2023 17:53:20 C :\ffmpeg\bin\ffmpeg.exe -y -nostdin -f dshow -an -video_size 1280x960 -framerate 10 -i video="USB Microscope" -filter:v "smartblur=luma_radius=0.9:luma_strength=0.7:luma_threshold=0" -frames:v 1 C :\FilmProjList\TEST\TEST%%04d.jpg -update 1&#xA;DefineImage 180 ffmpeg version 6.0-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers&#xA;built with gcc 12.2.0 (Rev10, Built by MSYS2 project)&#xA;configuration : —enable-gpl —enable-version3 —enable-static —disable-w32threads —disable-autodetect —enable-fontconfig —enable-iconv —enable-gnutls —enable-libxml2 —enable-gmp —enable-bzlib —enable-lzma —enable-libsnappy —enable-zlib —enable-librist —enable-libsrt —enable-libssh —enable-libzmq —enable-avisynth —enable-libbluray —enable-libcaca —enable-sdl2 —enable-libaribb24 —enable-libdav1d —enable-libdavs2 —enable-libuavs3d —enable-libzvbi —enable-librav1e —enable-libsvtav1 —enable-libwebp —enable-libx264 —enable-libx265 —enable-libxavs2 —enable-libxvid —enable-libaom —enable-libjxl —enable-libopenjpeg —enable-libvpx —enable-mediafoundation —enable-libass —enable-frei0r —enable-libfreetype —enable-libfribidi —enable-liblensfun —enable-libvidstab —enable-libvmaf —enable-libzimg —enable-amf —enable-cuda-llvm —enable-cuvid —enable-ffnvcodec —enable-nvdec —enable-nvenc —enable-d3d11va —enable-dxva2 —enable-libvpl —enable-libshaderc —enable-vulkan —enable-libplacebo —enable-opencl —enable-libcdio —enable-libgme —enable-libmodplug —enable-libopenmpt —enable-libopencore-amrwb —enable-libmp3lame —enable-libshine —enable-libtheora —enable-libtwolame —enable-libvo-amrwbenc —enable-libilbc —enable-libgsm —enable-libopencore-amrnb —enable-libopus —enable-libspeex —enable-libvorbis —enable-ladspa —enable-libbs2b —enable-libflite —enable-libmysofa —enable-librubberband —enable-libsoxr —enable-chromaprint&#xA;libavutil 58. 2.100 / 58. 2.100&#xA;libavcodec 60. 3.100 / 60. 3.100&#xA;libavformat 60. 3.100 / 60. 3.100&#xA;libavdevice 60. 1.100 / 60. 1.100&#xA;libavfilter 9. 3.100 / 9. 3.100&#xA;libswscale 7. 1.100 / 7. 1.100&#xA;libswresample 4. 10.100 / 4. 10.100&#xA;libpostproc 57. 1.100 / 57. 1.100&#xA;Trailing option(s) found in the command : may be ignored.&#xA;Input #0, dshow, from 'video=USB Microscope' :&#xA;Duration : N/A, start : 5368.514437, bitrate : N/A&#xA;Stream #0:0 : Video : rawvideo (YUY2 / 0x32595559), yuyv422(tv, bt470bg/bt709/unknown), 1280x960, 10 fps, 10 tbr, 10000k tbn&#xA;Stream mapping :&#xA;Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))&#xA;[swscaler @ 000001442fdcebc0] deprecated pixel format used, make sure you did set range correctly ( that I do not understand )&#xA;Last message repeated 3 times&#xA;[mjpeg @ 00000144278b0d80] removing common factors from framerate&#xA;Output #0, image2, to 'C :\FilmProjList\TEST\TEST%04d.jpg' :&#xA;Metadata :&#xA;encoder : Lavf60.3.100&#xA;Stream #0:0 : Video : mjpeg, yuvj422p(pc, bt470bg/bt709/unknown, progressive), 1280x960, q=2-31, 200 kb/s, 10 fps, 10 tbn&#xA;Metadata :&#xA;encoder : Lavc60.3.100 mjpeg&#xA;Side data :&#xA;cpb : bitrate max/min/avg : 0/0/200000 buffer size : 0 vbv_delay : N/A&#xA;frame= 0 fps=0.0 q=3.6 size= 0kB time=00:00:00.00 bitrate=N/A speed=N/A
    &#xA;frame= 1 fps=0.0 q=3.6 Lsize=N/A time=00:00:00.00 bitrate=N/A speed= 0x
    &#xA;video:45kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead : unknown

    &#xA;

    DefineImage 248 11.05.2023 17:53:23 ( test output from, the C# program)&#xA;Das Programm "[11724] Cine2Video.exe" wurde mit Code 0 (0x0) beendet.

    &#xA;

    &#xA;

    &#xA;

    Mit freundlichen Grüßen / Best regards&#xA;Ute & Wolfgang Kurz&#xA;Domaine : https://uwkurz.de ; Homepage : https://www.uwkurz.de/home&#xA;Location : 9° 11' 27,75" East, 48° 43' 32,80" North&#xA;E-Mail : wolfgang@uwkurz.de , ute@uwkurz.de&#xA;Gesendet über Glasfaser von HOMENET.de

    &#xA;

    &#xA;