Recherche avancée

Médias (3)

Mot : - Tags -/Valkaama

Autres articles (75)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer 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 (3146)

  • FFMPEG is not working in app service post deployment

    1er mars 2024, par Tushar Gupta

    I using the Xabe.FFmpeg package to generate clips from a video. The code is basically converting a video to multiple clips and it's working fine in my local but whenever I am uploading the code to app service the code is not working.

    


    Stack : .net
App Service OS : Windows

    


    Error :

    


    2024-02-13 08:57:34.092 +00:00 [Error] Microsoft.AspNetCore.Server.IIS.Core.IISHttpServer : Connection ID "16573246629528734243", Request ID "40000a24-0000-e600-b63f-84710c7967bb" : An unhandled exception was thrown by the application.System.ComponentModel.Win32Exception (193) : An error occurred trying to start process 'C :\home\site\wwwroot\Controllers\ffmpeg\bin\ffmpeg.exe' with working directory 'C :\home\site\wwwroot'. The specified executable is not a valid application for this OS platform.at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)at System.Diagnostics.Process.Start()at Xabe.FFmpeg.FFmpeg.RunProcess(String args, String processPath, Nullable1 priority, Boolean standardInput, Boolean standardOutput, Boolean standardError)at Xabe.FFmpeg.FFmpegWrapper.&lt;>c__DisplayClass14_0.<runprocess>b__0()at System.Threading.Tasks.Task</runprocess>1.InnerInvoke()at System.Threading.Tasks.Task.<>c.<.cctor>b__281_0(Object obj)at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)--- End of stack trace from previous location ---at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)--- End of stack trace from previous location ---at Xabe.FFmpeg.Conversion.Start(String parameters, CancellationToken cancellationToken)at ExtractResponseAPI.Controllers.HomeController.PrepareVideoClips(CloudBlockBlob sourceVideoBlob, TimeSpan startTime, TimeSpan endTime) in C :\Users\tushar.h.gupta\source\repos\ExtractResponseAPI\Controllers\HomeController.cs:line 164at ExtractResponseAPI.Controllers.HomeController.GetIntervalsAsync(String query) in C :\Users\tushar.h.gupta\source\repos\ExtractResponseAPI\Controllers\HomeController.cs:line 60at ExtractResponseAPI.Controllers.HomeController.Get(String query) in C :\Users\tushar.h.gupta\source\repos\ExtractResponseAPI\Controllers\HomeController.cs:line 24at lambda_method4(Closure, Object)at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask1 actionResultValueTask)at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<invokenextactionfilterasync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State&amp; next, Scope&amp; scope, Object&amp; state, Boolean&amp; isCompleted)at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<invokeinnerfilterasync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<invokefilterpipelineasync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<invokeasync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<invokeasync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT</invokeasync></invokeasync></invokefilterpipelineasync></invokeinnerfilterasync></invokenextactionfilterasync>1.ProcessRequestAsync()

    &#xA;

    Code :

    &#xA;

    private async Task> PrepareVideoClips(CloudBlockBlob sourceVideoBlob, TimeSpan startTime, TimeSpan endTime)&#xA;{&#xA;    string tempDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());&#xA;&#xA;    // Create a temporary directory to store clips locally&#xA;    Directory.CreateDirectory(tempDirectory);&#xA;&#xA;    // Download the source video&#xA;    string sourceVideoPath = Path.Combine(tempDirectory, "sourceVideo.mp4");&#xA;    await sourceVideoBlob.DownloadToFileAsync(sourceVideoPath, FileMode.Create);&#xA;    FFmpeg.SetExecutablesPath("Controllers\\ffmpeg\\bin\\");&#xA;    // Use FFmpegCore to trim the video&#xA;    string outputVideoPath = Path.Combine(tempDirectory, "output.mp4");&#xA;&#xA;    await FFmpeg.Conversions.New()&#xA;        .AddParameter($"-ss {startTime.TotalSeconds}") // Start time&#xA;        .AddParameter($"-i {sourceVideoPath}")&#xA;        .AddParameter($"-to {(endTime - startTime).TotalSeconds}") // Duration&#xA;        .SetOutput(outputVideoPath)&#xA;        .Start();&#xA;&#xA;    // Return a list of file paths for the clips&#xA;    return new List<string> { outputVideoPath };&#xA;}&#xA;</string>

    &#xA;

    I tried deploying the app service using different OS but still facing the same issue, I also tried using different packages but the result is same.

    &#xA;

  • PyQt6 6.7.0 - How to fix error : No QtMultimedia backends found

    4 février, par Belleroph0N

    Problem on Windows 10 and Windows 11 using Anaconda.

    &#xA;

    Here is the full error message for PyQt6=6.7.0 :

    &#xA;

    No QtMultimedia backends found. Only QMediaDevices, QAudioDevice, QSoundEffect, QAudioSink, and QAudioSource are available.&#xA;Failed to initialize QMediaPlayer "Not available"&#xA;Failed to create QVideoSink "Not available"&#xA;

    &#xA;

    Installed PyQt6 using a requirements file :

    &#xA;

    PyQt6&#xA;PyQt6-WebEngine&#xA;requests&#xA;pyserial&#xA;pynput&#xA;

    &#xA;

    Here are a couple things I tried :

    &#xA;

      &#xA;
    1. Reroll version back to PyQt6=6.6.1. This results in an error as well : ImportError : DLL load failed while importing QtGui : The specified procedure could not be found.
    2. &#xA;

    3. I thought that missing ffmpeg might be the issue so I installed it, but the issue persists.
    4. &#xA;

    5. Tried the setup on Ubuntu (WSL2) and the issue disappears, but there is just a black screen and nothing gets displayed in the widget. (EDIT : Got this up and running, the problem was with differences in file paths in linux vs windows.)
    6. &#xA;

    &#xA;

    I am new to PyQt so any pointers will be helpful !

    &#xA;

    Edit : Here is generic code (taken from here) that gives the same error :

    &#xA;

    from PyQt6.QtGui import QIcon, QFont&#xA;from PyQt6.QtCore import QDir, Qt, QUrl, QSize&#xA;from PyQt6.QtMultimedia import QMediaPlayer&#xA;from PyQt6.QtMultimediaWidgets import QVideoWidget&#xA;from PyQt6.QtWidgets import (QApplication, QFileDialog, QHBoxLayout, QLabel, QStyleFactory,&#xA;        QPushButton, QSizePolicy, QSlider, QStyle, QVBoxLayout, QWidget, QStatusBar)&#xA;&#xA;&#xA;class VideoPlayer(QWidget):&#xA;&#xA;    def __init__(self, parent=None):&#xA;        super(VideoPlayer, self).__init__(parent)&#xA;&#xA;        self.mediaPlayer = QMediaPlayer()&#xA;&#xA;        btnSize = QSize(16, 16)&#xA;        videoWidget = QVideoWidget()&#xA;&#xA;        openButton = QPushButton("Open Video")   &#xA;        openButton.setToolTip("Open Video File")&#xA;        openButton.setStatusTip("Open Video File")&#xA;        openButton.setFixedHeight(24)&#xA;        openButton.setIconSize(btnSize)&#xA;        openButton.setFont(QFont("Noto Sans", 8))&#xA;        openButton.setIcon(QIcon.fromTheme("document-open", QIcon("D:/_Qt/img/open.png")))&#xA;        openButton.clicked.connect(self.abrir)&#xA;&#xA;        self.playButton = QPushButton()&#xA;        self.playButton.setEnabled(False)&#xA;        self.playButton.setFixedHeight(24)&#xA;        self.playButton.setIconSize(btnSize)&#xA;        self.playButton.setIcon(self.style().standardIcon(QStyle.StandardPixmap.SP_MediaPlay))&#xA;        self.playButton.clicked.connect(self.play)&#xA;&#xA;        self.positionSlider = QSlider(Qt.Orientation.Horizontal)&#xA;        self.positionSlider.setRange(0, 0)&#xA;        self.positionSlider.sliderMoved.connect(self.setPosition)&#xA;&#xA;        self.statusBar = QStatusBar()&#xA;        self.statusBar.setFont(QFont("Noto Sans", 7))&#xA;        self.statusBar.setFixedHeight(14)&#xA;&#xA;        controlLayout = QHBoxLayout()&#xA;        controlLayout.setContentsMargins(0, 0, 0, 0)&#xA;        controlLayout.addWidget(openButton)&#xA;        controlLayout.addWidget(self.playButton)&#xA;        controlLayout.addWidget(self.positionSlider)&#xA;&#xA;        layout = QVBoxLayout()&#xA;        layout.addWidget(videoWidget)&#xA;        layout.addLayout(controlLayout)&#xA;        layout.addWidget(self.statusBar)&#xA;&#xA;        self.setLayout(layout)&#xA;&#xA;        #help(self.mediaPlayer)&#xA;        self.mediaPlayer.setVideoOutput(videoWidget)&#xA;        self.mediaPlayer.playbackStateChanged.connect(self.mediaStateChanged)&#xA;        self.mediaPlayer.positionChanged.connect(self.positionChanged)&#xA;        self.mediaPlayer.durationChanged.connect(self.durationChanged)&#xA;        self.mediaPlayer.errorChanged.connect(self.handleError)&#xA;        self.statusBar.showMessage("Ready")&#xA;&#xA;    def abrir(self):&#xA;        fileName, _ = QFileDialog.getOpenFileName(self, "Select Media",&#xA;                ".", "Video Files (*.mp4 *.flv *.ts *.mts *.avi)")&#xA;&#xA;        if fileName != &#x27;&#x27;:&#xA;            self.mediaPlayer.setSource(QUrl.fromLocalFile(fileName))&#xA;            self.playButton.setEnabled(True)&#xA;            self.statusBar.showMessage(fileName)&#xA;            self.play()&#xA;&#xA;    def play(self):&#xA;        if self.mediaPlayer.playbackState() == QMediaPlayer.PlaybackState.PlayingState:&#xA;            self.mediaPlayer.pause()&#xA;        else:&#xA;            self.mediaPlayer.play()&#xA;&#xA;    def mediaStateChanged(self, state):&#xA;        if self.mediaPlayer.playbackState() == QMediaPlayer.PlaybackState.PlayingState:&#xA;            self.playButton.setIcon(&#xA;                    self.style().standardIcon(QStyle.StandardPixmap.SP_MediaPause))&#xA;        else:&#xA;            self.playButton.setIcon(&#xA;                    self.style().standardIcon(QStyle.StandardPixmap.SP_MediaPlay))&#xA;&#xA;    def positionChanged(self, position):&#xA;        self.positionSlider.setValue(position)&#xA;&#xA;    def durationChanged(self, duration):&#xA;        self.positionSlider.setRange(0, duration)&#xA;&#xA;    def setPosition(self, position):&#xA;        self.mediaPlayer.setPosition(position)&#xA;&#xA;    def handleError(self):&#xA;        self.playButton.setEnabled(False)&#xA;        self.statusBar.showMessage("Error: " &#x2B; self.mediaPlayer.errorString())&#xA;&#xA;if __name__ == &#x27;__main__&#x27;:&#xA;    import sys&#xA;    app = QApplication(sys.argv)&#xA;    player = VideoPlayer()&#xA;    player.setWindowTitle("Player")&#xA;    player.resize(900, 600)&#xA;    player.show()&#xA;    sys.exit(app.exec())&#xA;

    &#xA;

    The videos I want to play are in the same folder as this .py file.&#xA;The conda env (python 3.9.2) I am working on has the following packages :

    &#xA;

    certifi                     2024.6.2&#xA;charset-normalizer          3.3.2&#xA;idna                        3.7&#xA;pip                         24.0&#xA;pynput                      1.7.6&#xA;PyQt6                       6.7.0&#xA;PyQt6-Qt6                   6.7.1&#xA;PyQt6-sip                   13.6.0&#xA;PyQt6-WebEngine             6.7.0&#xA;PyQt6-WebEngine-Qt6         6.7.1&#xA;PyQt6-WebEngineSubwheel-Qt6 6.7.1&#xA;pyserial                    3.5&#xA;requests                    2.31.0&#xA;setuptools                  69.5.1&#xA;six                         1.16.0&#xA;urllib3                     2.2.1&#xA;wheel                       0.43.0&#xA;

    &#xA;

    PS : MacOS seems to have the same issue.

    &#xA;

  • Index error with moviepy when running on aws

    29 avril 2024, par Hardik Patel

    I am getting this error :&#xA;"MoviePy error : failed to read the duration of file %s.\n"&#xA;OSError : MoviePy error : failed to read the duration of file https://delivery.gettyimages.com/downloads/1490392845?k=20&e=AnE-X_nyTRBG5QvUm1OnnCZEOURkdWAdDeQJTmDW8Eo41FL7u_ROCopEha5N-Kwh-fxBr44QIe5s2vzAUchlcVs91TwSlJTMOKWYSTraamKCPRcJv19CqNZRB_FgLaW_.

    &#xA;

    The funny thing is that for the same line of code :

    &#xA;

    video_duration = VideoFileClip(getty_url).duration&#xA;

    &#xA;

    when running on my mac, it is running fine. However when running from an aws server I am getting this error :

    &#xA;

    [2024-04-29 05:55:42,126: ERROR/ForkPoolWorker-1] Task scripttovideoapp.create_video[18288b91-d304-400a-97a9-285fac776f85] raised unexpected: OSError(&#x27;MoviePy error: failed to read the duration of file https://delivery.gettyimages.com/downloads/1490392845?k=20&amp;e=AnE-X_nyTRBG5QvUm1OnnCZEOURkdWAdDeQJTmDW8Eo41FL7u_ROCopEha5N-Kwh-fxBr44QIe5s2vzAUchlcVs91TwSlJTMOKWYSTraamKCPRcJv19CqNZRB_FgLaW_.\nHere are the file infos returned by ffmpeg:\n\nffmpeg version 4.2.2-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2019 the FFmpeg developers\n  built with gcc 8 (Debian 8.3.0-6)\n  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg\n  libavutil      56. 31.100 / 56. 31.100\n  libavcodec     58. 54.100 / 58. 54.100\n  libavformat    58. 29.100 / 58. 29.100\n  libavdevice    58.  8.100 / 58.  8.100\n  libavfilter     7. 57.100 /  7. 57.100\n  libswscale      5.  5.100 /  5.  5.100\n  libswresample   3.  5.100 /  3.  5.100\n  libpostproc    55.  5.100 / 55.  5.100\n&#x27;)&#xA;Traceback (most recent call last):&#xA;  File "/home/ec2-user/.local/lib/python3.9/site-packages/moviepy/video/io/ffmpeg_reader.py", line 285, in ffmpeg_parse_infos&#xA;    line = [l for l in lines if keyword in l][index]&#xA;IndexError: list index out of range&#xA;&#xA;During handling of the above exception, another exception occurred:&#xA;&#xA;Traceback (most recent call last):&#xA;  File "/home/ec2-user/.local/lib/python3.9/site-packages/celery/app/trace.py", line 477, in trace_task&#xA;    R = retval = fun(*args, **kwargs)&#xA;  File "/home/ec2-user/.local/lib/python3.9/site-packages/celery/app/trace.py", line 760, in __protected_call__&#xA;    return self.run(*args, **kwargs)&#xA;  File "/home/ec2-user/videoproj/scripttovideoapp.py", line 454, in create_video&#xA;    all_urls, video_details = process_script(script, paths, company_a, company_b, api_key)&#xA;  File "/home/ec2-user/videoproj/scripttovideoapp.py", line 232, in process_script&#xA;    video_duration = VideoFileClip(file).duration  # This needs to be replaced with a proper duration if available&#xA;  File "/home/ec2-user/.local/lib/python3.9/site-packages/moviepy/video/io/VideoFileClip.py", line 88, in __init__&#xA;    self.reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt,&#xA;  File "/home/ec2-user/.local/lib/python3.9/site-packages/moviepy/video/io/ffmpeg_reader.py", line 35, in __init__&#xA;    infos = ffmpeg_parse_infos(filename, print_infos, check_duration,&#xA;  File "/home/ec2-user/.local/lib/python3.9/site-packages/moviepy/video/io/ffmpeg_reader.py", line 289, in ffmpeg_parse_infos&#xA;    raise IOError(("MoviePy error: failed to read the duration of file %s.\n"&#xA;OSError: MoviePy error: failed to read the duration of file https://delivery.gettyimages.com/downloads/1490392845?k=20&amp;e=AnE-X_nyTRBG5QvUm1OnnCZEOURkdWAdDeQJTmDW8Eo41FL7u_ROCopEha5N-Kwh-fxBr44QIe5s2vzAUchlcVs91TwSlJTMOKWYSTraamKCPRcJv19CqNZRB_FgLaW_.&#xA;Here are the file infos returned by ffmpeg:&#xA;&#xA;ffmpeg version 4.2.2-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2019 the FFmpeg developers&#xA;  built with gcc 8 (Debian 8.3.0-6)&#xA;  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg&#xA;  libavutil      56. 31.100 / 56. 31.100&#xA;  libavcodec     58. 54.100 / 58. 54.100&#xA;  libavformat    58. 29.100 / 58. 29.100&#xA;  libavdevice    58.  8.100 / 58.  8.100&#xA;  libavfilter     7. 57.100 /  7. 57.100&#xA;  libswscale      5.  5.100 /  5.  5.100&#xA;  libswresample   3.  5.100 /  3.  5.100&#xA;  libpostproc    55.  5.100 / 55.  5.100&#xA;&#xA;

    &#xA;

    I checked the version of my package on both mac and aws, the packages are the same. Went through different stackover flow solutions but non of them totally aligns with my issue.

    &#xA;