Recherche avancée

Médias (91)

Autres articles (111)

  • 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

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • Other interesting software

    13 avril 2011, par

    We don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
    The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
    We don’t know them, we didn’t try them, but you can take a peek.
    Videopress
    Website : http://videopress.com/
    License : GNU/GPL v2
    Source code : (...)

Sur d’autres sites (11091)

  • FFMPEG concat audio and videos produces only audio

    19 septembre 2019, par justaguytrynabuildawebsite

    Im trying to combine multiple video files with a single audio file. When using only videos without audio, it works fine but when adding a audio track to the beginning of the concat file i get the return below, and the output.mp4 becomes just audio with no video when previewing in browser.
    FFMPEG command

    ffmpeg -f concat -safe 0 -i /var/www/html/video_tool/edit/out/concat.txt -c copy -flags +global_header /var/www/html/video_tool/edit/out/output.mp4

    concat.txt

    #CONCAT FILE
    file '/var/www/html/video_tool/edit/audio/sound.mp3'
    file '/var/www/html/video_tool/edit/vids/frame_0.mp4'
    file '/var/www/html/video_tool/edit/vids/frame_1.mp4'
    file '/var/www/html/video_tool/edit/vids/frame_2.mp4'
    file '/var/www/html/video_tool/edit/vids/frame_3.mp4'

    Output

    ffmpeg version 4.1.3-0york1~16.04 Copyright (c) 2000-2019 the FFmpeg developers
     built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.11) 20160609
     configuration: --prefix=/usr --extra-version='0york1~16.04' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-nonfree --enable-libfdk-aac --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
     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
     libavresample   4.  0.  0 /  4.  0.  0
     libswscale      5.  3.100 /  5.  3.100
     libswresample   3.  3.100 /  3.  3.100
     libpostproc    55.  3.100 / 55.  3.100
    [mp3 @ 0x5635174e08c0] Estimating duration from bitrate, this may be inaccurate
    Input #0, concat, from '/var/www/html/video_tool/edit/out/concat.txt':
     Duration: N/A, start: 0.000000, bitrate: 192 kb/s
       Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 192 kb/s
    Output #0, mp4, to '/var/www/html/video_tool/edit/out/output.mp4':
     Metadata:
       encoder         : Lavf58.20.100
       Stream #0:0: Audio: mp3 (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 192 kb/s
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
    Press [q] to stop, [?] for help
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x5635174e38c0] Auto-inserting h264_mp4toannexb bitstream filter
    [mp4 @ 0x5635174e5080] Non-monotonous DTS in output stream 0:0; previous: 9897984, current: 8976; changing to 9897985. This may result in incorrect timestamps in the output file.
    [mp4 @ 0x5635174e5080] Non-monotonous DTS in output stream 0:0; previous: 9897985, current: 8977; changing to 9897986. This may result in incorrect timestamps in the output file.
    [mp4 @ 0x5635174e5080] Non-monotonous DTS in output stream 0:0; previous: 9897986, current: 8979; changing to 9897987. This may result in incorrect timestamps in the output file.
    [mp4 @ 0x5635174e5080] Non-monotonous DTS in output stream 0:0; previous: 9897987, current: 8980; changing to 9897988. This may result in incorrect timestamps in the output file.
    etc, etc...
    size=    5347kB time=00:03:44.44 bitrate= 195.1kbits/s speed=2.91e+03x    
    video:0kB audio:5311kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.664769%
  • Bash script doesn't read entire line

    4 octobre 2019, par Miguel Alatorre

    First off, I am in the early stages of learning bash shell scripting, so I apologize if I say / do anything that doesn’t make sense.

    Currently, I’m trying to have an SBC, a Khadas VIM3 specifically, run a python script to find and label faces in any given video from a local server. Currently, I need to reduce the frame rate and resolution of the video, which is where the bash script comes into play. I need to automate this process and thought I’d do it using a bash script and crontab.
    The file paths are found and output into a file from a separate script, and are read by the bash script. The problem comes when I try and call ffmpeg to use the file paths.

    The Code :

    pathFile="/home/khadas/Documents/paths"

    while IFS= read -r line
    do
           ffmpeg -i "$line" -vf scale=960:540 -y "$line"
           cp "$line" ./
    done < $pathFile

    The resulting error :

    : No such file or directoryalRecognition/10/14-53.h264+/20-509-26-10-14-53.mp4
    cp: cannot stat '/home/khadas/Downloads/FacialRecognition/10/14-53.h264+/20-509-26-10-14-53.mp4'$'\r': No such file or directory

    Example of the paths file (There will be hundreds of entries) :

    /home/khadas/Downloads/FacialRecognition/10/14-42.h264+/20-509-26-10-14-42.mp4
    /home/khadas/Downloads/FacialRecognition/10/59-06.h264+/20-509-26-10-59-06.mp4
    /home/khadas/Downloads/FacialRecognition/10/36-28.h264+/20-509-26-10-36-28.mp4
    /home/khadas/Downloads/FacialRecognition/10/14-53.h264+/20-509-26-10-14-53.mp4

    When using a trimmed down version, the script works as expected. Could it be an issue with the length of the lines ? Any help is much appreciated.

  • pydub.exceptions.CouldntDecodeError : Decoding failed. ffmpeg returned error code : 1

    9 avril, par azail765

    This script will work on a 30 second wav file but not a 10 minutes phone call also in wav format. Any help would be appreciated

    


    I've downloaded ffmpeg.

    


    # Import necessary libraries 
from pydub import AudioSegment 
import speech_recognition as sr 
import os
import pydub


chunk_count = 0
directory = os.fsencode(r'C:\Users\zach.blair\Downloads\speechRecognition\New folder')
# Text file to write the recognized audio 
fh = open("recognized.txt", "w+")
for file in os.listdir(directory):
     filename = os.fsdecode(file)
     if filename.endswith(".wav"):
        chunk_count += 1
             # Input audio file to be sliced 
        audio = AudioSegment.from_file(filename,format="wav") 
          
        ''' 
        Step #1 - Slicing the audio file into smaller chunks. 
        '''
        # Length of the audiofile in milliseconds 
        n = len(audio) 
          
        # Variable to count the number of sliced chunks 
        counter = 1
          
         
          
        # Interval length at which to slice the audio file. 
        interval = 20 * 1000
          
        # Length of audio to overlap.  
        overlap = 1 * 1000
          
        # Initialize start and end seconds to 0 
        start = 0
        end = 0
          
        # Flag to keep track of end of file. 
        # When audio reaches its end, flag is set to 1 and we break 
        flag = 0
          
        # Iterate from 0 to end of the file, 
        # with increment = interval 
        for i in range(0, 2 * n, interval): 
              
            # During first iteration, 
            # start is 0, end is the interval 
            if i == 0: 
                start = 0
                end = interval 
          
            # All other iterations, 
            # start is the previous end - overlap 
            # end becomes end + interval 
            else: 
                start = end - overlap 
                end = start + interval  
          
            # When end becomes greater than the file length, 
            # end is set to the file length 
            # flag is set to 1 to indicate break. 
            if end >= n: 
                end = n 
                flag = 1
          
            # Storing audio file from the defined start to end 
            chunk = audio[start:end] 
          
            # Filename / Path to store the sliced audio 
            filename = str(chunk_count)+'chunk'+str(counter)+'.wav'
          
            # Store the sliced audio file to the defined path 
            chunk.export(filename, format ="wav") 
            # Print information about the current chunk 
            print(str(chunk_count)+str(counter)+". Start = "
                                +str(start)+" end = "+str(end)) 
          
            # Increment counter for the next chunk 
            counter = counter + 1
              
          
            AUDIO_FILE = filename 
            
            # Initialize the recognizer 
            r = sr.Recognizer() 
          
            # Traverse the audio file and listen to the audio 
            with sr.AudioFile(AUDIO_FILE) as source: 
                audio_listened = r.listen(source) 
          
            # Try to recognize the listened audio 
            # And catch expections. 
            try:     
                rec = r.recognize_google(audio_listened) 
                  
                # If recognized, write into the file. 
                fh.write(rec+" ") 
              
            # If google could not understand the audio 
            except sr.UnknownValueError: 
                    print("Empty Value") 
          
            # If the results cannot be requested from Google. 
            # Probably an internet connection error. 
            except sr.RequestError as e: 
                print("Could not request results.") 
          
            # Check for flag. 
            # If flag is 1, end of the whole audio reached. 
            # Close the file and break.                  
fh.close()    


    


    I get this error on audio = AudioSegment.from_file(filename,format="wav") :

    


    Traceback (most recent call last):&#xA;  File "C:\Users\zach.blair\Downloads\speechRecognition\New folder\speechRecognition3.py", line 17, in <module>&#xA;    audio = AudioSegment.from_file(filename,format="wav")&#xA;  File "C:\Users\zach.blair\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pydub\audio_segment.py", line 704, in from_file&#xA;    p.returncode, p_err))&#xA;pydub.exceptions.CouldntDecodeError: Decoding failed. ffmpeg returned error code: 1&#xA;</module>

    &#xA;

    Output from ffmpeg/avlib :

    &#xA;

      ffmpeg version N-95027-g8c90bb8ebb Copyright (c) 2000-2019 the FFmpeg developers&#xA;  built with gcc 9.2.1 (GCC) 20190918&#xA;  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf&#xA;  libavutil      56. 35.100 / 56. 35.100&#xA;  libavcodec     58. 58.101 / 58. 58.101&#xA;  libavformat    58. 33.100 / 58. 33.100&#xA;  libavdevice    58.  9.100 / 58.  9.100&#xA;  libavfilter     7. 58.102 /  7. 58.102&#xA;  libswscale      5.  6.100 /  5.  6.100&#xA;  libswresample   3.  6.100 /  3.  6.100&#xA;  libpostproc    55.  6.100 / 55.  6.100&#xA;Guessed Channel Layout for Input Stream #0.0 : mono&#xA;Input #0, wav, from &#x27;2a.wav.wav&#x27;:&#xA;  Duration: 00:09:52.95, bitrate: 64 kb/s&#xA;    Stream #0:0: Audio: pcm_mulaw ([7][0][0][0] / 0x0007), 8000 Hz, mono, s16, 64 kb/s&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (pcm_mulaw (native) -> pcm_s8 (native))&#xA;Press [q] to stop, [?] for help&#xA;[wav @ 0000024307974400] pcm_s8 codec not supported in WAVE format&#xA;Could not write header for output file #0 (incorrect codec parameters ?): Function not implemented&#xA;Error initializing output stream 0:0 -- &#xA;Conversion failed!&#xA;

    &#xA;