Recherche avancée

Médias (0)

Mot : - Tags -/tags

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

Autres articles (111)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

Sur d’autres sites (5825)

  • FFMPEG concat 2 files of different resolution hangs

    6 octobre 2023, par knagode

    I am trying to concat 2 videos of different size and resize it to 426x240 :

    


    ffmpeg -y -i video_1.mp4 -i video_2.mp4 -filter_complex '[0]scale=426:240:force_original_aspect_ratio=decrease,pad=426:240:(ow-iw)/2:(oh-ih)/2,setsar=1[v0];[1]scale=426:240:force_original_aspect_ratio=decrease,pad=426:240:(ow-iw)/2:(oh-ih)/2,setsar=1[v1];[v0][0:a:0][v1][1:a:0]concat=n=2:v=1:a=1[v][a]' -map '[v]' -map '[a]' concatenated_video.mp4


    


    In the output I see :

    


    ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers
  built with Apple clang version 14.0.3 (clang-1403.0.22.14.1)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/6.0_1 --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-libjxl --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
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video_1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf60.3.100
  Duration: 00:00:05.76, start: 0.000000, bitrate: 1582 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 640x360 [SAR 1:1 DAR 16:9], 1473 kb/s, 30 fps, 30 tbr, 15360 tbn (default)
    Metadata:
      handler_name    : ISO Media file produced by Google Inc. Created on: 08/17/2020.
      vendor_id       : [0][0][0][0]
      encoder         : Lavc60.3.100 libx264
  Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 112 kb/s (default)
    Metadata:
      handler_name    : ISO Media file produced by Google Inc. Created on: 08/17/2020.
      vendor_id       : [0][0][0][0]
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'video_2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf60.3.100
  Duration: 00:00:16.40, start: 0.000000, bitrate: 383 kb/s
  Stream #1:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 426x240 [SAR 640:639 DAR 16:9], 245 kb/s, 29.97 fps, 29.97 tbr, 30k tbn (default)
    Metadata:
      handler_name    : Core Media Video
      vendor_id       : [0][0][0][0]
      encoder         : Lavc60.3.100 libx264
  Stream #1:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : Core Media Audio
      vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 (h264) -> scale:default
  Stream #0:1 (aac) -> concat
  Stream #1:0 (h264) -> scale:default
  Stream #1:1 (aac) -> concat
  concat -> Stream #0:0 (libx264)
  concat -> Stream #0:1 (aac)
Press [q] to stop, [?] for help
[vost#0:0/libx264 @ 0x7fc777006280] Frame rate very high for a muxer not efficiently supporting it.
Please consider specifying a lower framerate, a different muxer or setting vsync/fps_mode to vfr
[libx264 @ 0x7fc777006580] using SAR=1/1
[libx264 @ 0x7fc777006580] MB rate (405000000) > level limit (16711680)
[libx264 @ 0x7fc777006580] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7fc777006580] profile High, level 6.2, 4:2:0, 8-bit
[libx264 @ 0x7fc777006580] 264 - core 164 r3095 baee400 - H.264/MPEG-4 AVC codec - Copyleft 2003-2022 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=7 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'concatenated_video.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf60.3.100
  Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(tv, progressive), 426x240 [SAR 1:1 DAR 71:40], q=2-31, 1000k tbn
    Metadata:
      encoder         : Lavc60.3.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
  Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc60.3.100 aac
[vost#0:0/libx264 @ 0x7fc777006280] More than 1000 frames duplicated  1.1kbits/s speed=4.94x


    


    Process hangs and I see that ffmpeg uses 500% of the CPU. Any idea how to fix (deal with) this ?

    


    I can open both videos on my computer and play them.

    


  • "ffmpeg has text relocations" error in Android

    5 janvier 2015, par djzmo

    I’m building an Android video-sending application. I need the video to be compressed before being uploaded. In this case, I chose to use this Android wrapper of FFmpeg : https://github.com/hiteshsondhi88/ffmpeg-android-java

    FFmpeg error: WARNING: linker: /data/data/com.mycompany.myapplication/files/ffmpeg has text relocations. This is wasting memory and prevents security hardening. Please fix.
       ffmpeg version n2.4.2 Copyright (c) 2000-2014 the FFmpeg developers
       built on Oct  7 2014 15:08:46 with gcc 4.8 (GCC)
       configuration: --target-os=linux --cross-prefix=/home/sb/Source-Code/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/sb/Source-Code/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/sb/Source-Code/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/sb/Source-Code/ffmpeg-android/build/armeabi-v7a-neon --extra-cflags='-I/home/sb/Source-Code/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all -mfpu=neon' --extra-ldflags='-L/home/sb/Source-Code/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
       libavutil      54.  7.100 / 54.  7.100
       libavcodec     56.  1.100 / 56.  1.100
       libavformat    56.  4.101 / 56.  4.101
       libavdevice    56.  0.100 / 56.  0.100
       libavfilter     5.  1.100 /  5.  1.100
       libswscale      3.  0.100 /  3.  0.100
       libswresample   1.  1.100 /  1.  1.100
       libpostproc    53.  0.100 / 53.  0.100
       Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/DCIM/Camera/VID_20150104_235926.mp4':
       Metadata:
       major_brand     : mp42
       minor_version   : 0
       compatible_brands: isommp42
       creation_time   : 2015-01-04 16:00:40
       Duration: 00:01:12.60, start: 0.000000, bitrate: 19590 kb/s
       Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 19364 kb/s, SAR 65536:65536 DAR 16:9, 26.73 fps, 26.92 tbr, 90k tbn, 180k tbc (default)
       Metadata:
       creation_time   : 2015-01-04 16:00:40
       handler_name    : VideoHandle
       Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 196 kb/s (default)
       Metadata:
       creation_time   : 2015-01-04 16:00:40
       handler_name    : SoundHandle
       [libx264 @ 0x40208800] using SAR=1/1
       [libx264 @ 0x40208800] frame MB size (120x68) > level limit (1620)
       [libx264 @ 0x40208800] DPB size (1 frames, 8160 mbs) > level limit (0 frames, 8100 mbs)
       [libx264 @ 0x40208800] MB rate (219640) > level limit (40500)
       [libx264 @ 0x40208800] using cpu capabilities: none!
       [libx264 @ 0x40208800] profile Constrained Baseline, level 3.0
       [libx264 @ 0x40208800] 264 - core 142 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc_lookahead=0 rc=crf mbtree=0 crf=28.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=2500 vbv_bufsize=1835 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=0
       Output #0, mp4, to '/storage/emulated/0/Android/data/com.mycompany.myapplication/cache/VID_20150104_235926.mp4':
       Metadata:
       major_brand     : mp42
       minor_version   : 0
       compatible_brands: isommp42
       encoder         : Lavf56.4.101
       Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 65536:65536 DAR 16:9], q=-1--1, 2500 kb/s, 26.92 fps, 10336 tbn, 26.92 tbc (default)
       Metadata:
       creation_time   : 2015-01-04 16:00:40
       handler_name    : VideoHandle
       encoder         : Lavc56.1.100 libx264
       Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 4

    Everything seemed fine when I compress small files (below 20 seconds), but when I tried to compress larger files, I seldom get the above error in the middle of the compression process, and the process was also terminated immediately. I need the application to be able to compress one minute video to about 20-35 MB.

    Here is the FFmpeg command I used :

    ffmpeg -y -i -codec:v libx264 -profile:v baseline -level 3.0 -b:v 2500k -minrate 2500k -maxrate 2500k -bufsize 1835k -pix_fmt yuv420p -preset ultrafast -crf 28 -codec:a copy

    Any idea on what went wrong ?
    Any kind of help would be very appreciated.

  • pyqt5 gui dependent on ffmpeg compiled with pyinstaller doesn't run on other machines ?

    19 octobre 2022, par Soren

    I am trying to create a simple Pyqt5 GUI for Windows 10 that uses OpenAI's model Whisper to transcribe a sound file and outputting the results in an Excel-file. It works on my own computer where I have installed the necessary dependencies for Whisper as stated on their github i.e. FFMEG. I provide a minimal example of my code below :

    


    # Import library
import whisper
import os
from PyQt5 import QtCore, QtGui, QtWidgets
import pandas as pd
import xlsxwriter


class Ui_Dialog(QtWidgets.QDialog):
    
    
    # Define functions to use in GUI
   
    # Define function for selecting input files
    def browsefiles(self, Dialog):
      
       
       # Make Dialog box and save files into tuple of paths
       files = QtWidgets.QFileDialog().getOpenFileNames(self, "Select soundfiles", os.getcwd(), "lyd(*mp2 *.mp3 *.mp4 *.m4a *wma *wav)")
       
       self.liste = []
       for url in range(len(files[0])):
           self.liste.append(files[0][url])   

    
    def model_load(self, Dialog):
               
        # Load picked model
        self.model = whisper.load_model(r'C:\Users\Søren\Downloads\Whisper_gui\models' + "\\" + self.combo_modelSize.currentText() + ".pt") ##the path is set to where the models are on the other machine
        
    
    def run(self, Dialog):
                
        # Make list for sound files
        liste_df = []
        
        
        # Running loop for interpreting and encoding sound files
        for url in range(len(self.liste)):
                          
            # Make dataframe
            df = pd.DataFrame(columns=["filename", "start", "end", "text"])
            
            # Run model
            result = self.model.transcribe(self.liste[url])
                            
            # Extract results
            for i in range(len(result["segments"])):
                start = result["segments"][i]["start"]
                end = result["segments"][i]["end"]
                text = result["segments"][i]["text"]
                
                df = df.append({"filename": self.liste[url].split("/")[-1],
                            "start": start, 
                            "end": end, 
                            "text": text}, ignore_index=True)
            
            # Add detected language to dataframe
            df["sprog"] = result["language"]
            
            
            liste_df.append(df)
        
        
        
        # Make excel output
        
        # Concatenate list of dfs
        dataframe = pd.concat(liste_df)
        
        
        # Create a Pandas Excel writer using XlsxWriter as the engine.
        writer = pd.ExcelWriter(self.liste[0].split(".")[0] + '_OUTPUT.xlsx', engine='xlsxwriter')
        writer_wrap_format = writer.book.add_format({"text_wrap": True, 'num_format': '@'})


        # Write the dataframe data to XlsxWriter. Turn off the default header and
        # index and skip one row to allow us to insert a user defined header.
        dataframe.to_excel(writer, sheet_name="Output", startrow=1, header=False, index=False)

        # Get the xlsxwriter workbook and worksheet objects.
        #workbook = writer.book
        worksheet = writer.sheets["Output"]

        # Get the dimensions of the dataframe.
        (max_row, max_col) = dataframe.shape

        # Create a list of column headers, to use in add_table().
        column_settings = [{'header': column} for column in dataframe.columns]

        # Add the Excel table structure. Pandas will add the data.
        worksheet.add_table(0, 0, max_row, max_col - 1, {'columns': column_settings})

        # Make the columns wider for clarity.
        worksheet.set_column(0, max_col - 1, 12)
        
        in_col_no = xlsxwriter.utility.xl_col_to_name(dataframe.columns.get_loc("text"))
        
        worksheet.set_column(in_col_no + ":" + in_col_no, 30, writer_wrap_format)

        # Close the Pandas Excel writer and output the Excel file.
        writer.save()
        writer.close()
    
    
    ## Design setup
    
    def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(730, 400)
        
        self.select_files = QtWidgets.QPushButton(Dialog)
        self.select_files.setGeometry(QtCore.QRect(40, 62, 81, 31))
        font = QtGui.QFont()
        font.setPointSize(6)
        self.select_files.setFont(font)
        self.select_files.setObjectName("select_files")
        
    
               
        
        self.combo_modelSize = QtWidgets.QComboBox(Dialog)
        self.combo_modelSize.setGeometry(QtCore.QRect(40, 131, 100, 21))
        font = QtGui.QFont()
        font.setPointSize(6)
        self.combo_modelSize.setFont(font)
        self.combo_modelSize.setObjectName("combo_modelSize")
               
        
        self.runButton = QtWidgets.QPushButton(Dialog)
        self.runButton.setGeometry(QtCore.QRect(40, 289, 71, 21))
        font = QtGui.QFont()
        font.setPointSize(6)
        self.runButton.setFont(font)
        self.runButton.setObjectName("runButton")
        
        
       

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
        
        
        
        modelSize_options = ['Chose model', 'tiny', 'base', 'small', 'medium', 'large']
        self.combo_modelSize.addItems(modelSize_options)
        
        # Do an action!
        self.select_files.clicked.connect(self.browsefiles)
        self.combo_modelSize.currentIndexChanged.connect(self.model_load)
        self.runButton.clicked.connect(self.run)
        
        
        
    

    def retranslateUi(self, Dialog):
        _translate = QtCore.QCoreApplication.translate
        Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
        self.runButton.setText(_translate("Dialog", "Go!"))
        self.select_files.setText(_translate("Dialog", "Select"))


if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    Dialog = QtWidgets.QDialog()
    ui = Ui_Dialog()
    ui.setupUi(Dialog)
    Dialog.show()
    sys.exit(app.exec_())


    


    I compile this app with pyinstaller using the following code. I had some issues to begin with so I found other with similar problems and ended up with this :

    


    pyinstaller --onedir --hidden-import=pytorch --collect-data torch --copy-metadata torch --copy-metadata tqdm --copy-metadata tokenizers --copy-metadata importlib_metadata --hidden-import="sklearn.utils._cython_blas" --hidden-import="sklearn.neighbors.typedefs" --hidden-import="sklearn.neighbors.quad_tree" --hidden-import="sklearn.tree" --hidden-import="sklearn.tree._utils" --copy-metadata regex --copy-metadata requests --copy-metadata packaging --copy-metadata filelock --copy-metadata numpy --add-data "./ffmpeg/*;./ffmpeg/" --hidden-import=whisper --copy-metadata whisper --collect-data whisper minimal_example_whisper.py

    


    When I take the outputtet dist directory and try to run the app on another Windows machine without FFMPEG installed (or Whisper or any other things), I get the following error from the terminal as I push the "run" button in the app (otherwise the app does run).

    


    C:\Users\Søren>"G:\minimal_example_whisper\minimal_example_whisper.exe"
whisper\transcribe.py:70: UserWarning: FP16 is not supported on CPU; using FP32 instead
Traceback (most recent call last):
  File "minimal_example_whisper.py", line 45, in run
  File "whisper\transcribe.py", line 76, in transcribe
  File "whisper\audio.py", line 111, in log_mel_spectrogram
  File "whisper\audio.py", line 42, in load_audio
  File "ffmpeg\_run.py", line 313, in run
  File "ffmpeg\_run.py", line 284, in run_async
  File "subprocess.py", line 951, in __init__
  File "subprocess.py", line 1420, in _execute_child
FileNotFoundError: [WinError 2] Den angivne fil blev ikke fundet


    


    I suspect this has something to do with FFMPEG not being installed on the other machines system ? Does anyone have an automatic solution for this when compiling the app or can it simply only run on machines that has FFMPEG installed ?

    


    Thanks in advance !