Recherche avancée

Médias (1)

Mot : - Tags -/wave

Autres articles (105)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

Sur d’autres sites (9612)

  • Everytime I run my code ffmpeg responds with this instead of doing its function. How do I fix ?

    25 juillet 2023, par Oreo F
    Output from ffmpeg/avlib:

ffmpeg version 2023-07-19-git-efa6cec759-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
  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-libaribcaption --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-libharfbuzz --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-libcodec2 --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
  libavutil      58. 14.100 / 58. 14.100
  libavcodec     60. 22.100 / 60. 22.100
  libavformat    60. 10.100 / 60. 10.100
  libavdevice    60.  2.101 / 60.  2.101
  libavfilter     9.  8.102 /  9.  8.102
  libswscale      7.  3.100 /  7.  3.100
  libswresample   4. 11.100 /  4. 11.100
  libpostproc    57.  2.100 / 57.  2.100


    


    Everytime I run the code it does this.

    


    code :

    


    import praw
import requests
import cv2
import os
from pydub import AudioSegment

def download_video(url, filename):
    response = requests.get(url)
    with open(filename, 'wb') as f:
        f.write(response.content)

def combine_videos(video_urls, output_filename):
    video_clips = []
    audio_clips = []
    for i, url in enumerate(video_urls):
        temp_filename = f'temp_video_{i}.mp4'
        download_video(url, temp_filename)
        video_clip = cv2.VideoCapture(temp_filename)
        audio_clip = AudioSegment.from_file(temp_filename, format="mp4")
        video_clips.append(video_clip)
        audio_clips.append(audio_clip)
    
    if not video_clips:
        print("No video clips to combine.")
        return

    frame_width = int(video_clips[0].get(cv2.CAP_PROP_FRAME_WIDTH))
    frame_height = int(video_clips[0].get(cv2.CAP_PROP_FRAME_HEIGHT))
    fps = int(video_clips[0].get(cv2.CAP_PROP_FPS))

    fourcc = cv2.VideoWriter_fourcc(*'mp4v')
    output_clip = cv2.VideoWriter(output_filename, fourcc, fps, (frame_width, frame_height))

    for i, video_clip in enumerate(video_clips):
        while True:
            ret, frame = video_clip.read()
            if not ret:
                break
            output_clip.write(frame)
    
    for video_clip in video_clips:
        video_clip.release()
    
    output_clip.release()

    # Combining audio using pydub
    combined_audio = sum(audio_clips)
    combined_audio.export("combined_audio.mp3", format="mp3")

    # Merging audio with video using ffmpeg
    os.system(f'ffmpeg -i {output_filename} -i combined_audio.mp3 -c:v copy -c:a aac -strict experimental -map 0:v:0 -map 1:a:0 final_output.mp4')

    # Cleaning up temporary files
    os.remove("combined_audio.mp3")

def main():
    reddit = praw.Reddit(
       client_id='XXX',
        client_secret='XXX',
        user_agent='Reddit Video Downloader'
    )
    
    subreddit_name = input("Enter the name of the subreddit: ")
    limit = int(input("Enter the number of videos to download: "))
    
    subreddit = reddit.subreddit(subreddit_name)
    submissions = subreddit.hot(limit=limit)
    
    video_urls = [submission.url for submission in submissions if submission.media and 'reddit_video' in submission.media]
    
    if video_urls:
        output_filename = input("Enter the output filename (e.g., output.mp4): ")
        combine_videos(video_urls, output_filename)
        print("Videos combined successfully!")
    else:
        print("No Reddit videos found in the subreddit.")

if __name__ == "__main__":
    main()


    


    Anyone got any idea why this happens ?

    


    I'm making a script that scrapes videos from a specific subreddit.

    


    Also if it helps the temp video file is corrupted when it gets made.

    


    I've put this into chatGPT as well and brought an expert friend and he hasn't been able to help me.

    


  • cannot link ffmpeg libraries for my own Qt project

    14 août 2013, par Dan T

    EDIT : Question solved (see bottom)

    I have spent MANY hours searching for a solution to my problem, but have not managed. I am on OSX and trying to link ffmpeg to my own Qt project. I have tried to do the simplest thing possible but even this does not work :

    After gettings yasm and x264 installed, I ran
    ./configure —enable-static —enable-gpl —enable-libx264 and then
    make && make install

    ffmpeg runs fine when I then try to run it on the command line. I then just set up a simple project in the ffmpeg directory with the following ffmpeg.pro file :

    TEMPLATE = app

    QT += core

    INCLUDEPATH += /usr/local/include
    LIBS += -L/usr/local/lib
    LIBS += -lavdevice -lavfilter -lavformat -lavcodec -lpostproc -lswresample -lswscale -lavutil -lpthread -lbz2 -lm -lz -lx264

    HEADERS += ffmpeg.h

    SOURCES += ffmpeg.c

    I'm not sure whether I need all those libraries, but they were all the .a files that ffmpeg created. When I try to build the project (as is), I get the following linker error :

    g++ -headerpad_max_install_names -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -o ffmpeg.app/Contents/MacOS/ffmpeg ffmpeg.o -F/Users/dtamayo/QtSDK/Desktop/Qt/4.8.1/gcc/lib -L/Users/dtamayo/QtSDK/Desktop/Qt/4.8.1/gcc/lib -L/usr/local/lib -lavdevice -lavfilter -lavformat -lavcodec -lpostproc -lswresample -lswscale -lavutil -lpthread -lbz2 -lm -lz -lx264 -framework QtGui -L/usr/local/pgsql/lib -L/tmp/qt-stuff-85167/source/qt-everywhere-opensource-src-4.8.1/Desktop/Qt/4.8.1/gcc/lib -F/tmp/qt-stuff-85167/source/qt-everywhere-opensource-src-4.8.1/Desktop/Qt/4.8.1/gcc/lib -framework QtCore
    ld : warning : directory not found for option '-L/usr/local/pgsql/lib'
    ld : warning : directory not found for option '-L/tmp/qt-stuff-85167/source/qt-everywhere-opensource-src-4.8.1/Desktop/Qt/4.8.1/gcc/lib'
    ld : warning : directory not found for option '-F/tmp/qt-stuff-85167/source/qt-everywhere-opensource-src-4.8.1/Desktop/Qt/4.8.1/gcc/lib'
    Undefined symbols for architecture x86_64 :
    "_audio_sync_method", referenced from :
    _write_frame in ffmpeg.o
    _do_audio_out in ffmpeg.o
    "_audio_volume", referenced from :
    _transcode_init in ffmpeg.o
    "_cmdutils_read_file", referenced from :
    _transcode_init in ffmpeg.o
    "_configure_filtergraph", referenced from :
    _decode_audio in ffmpeg.o
    _decode_video in ffmpeg.o
    _transcode_init in ffmpeg.o
    "_copy_tb", referenced from :
    _transcode_init in ffmpeg.o
    "_copy_ts", referenced from :
    _process_input in ffmpeg.o
    "_debug_ts", referenced from :
    _write_frame in ffmpeg.o
    _do_audio_out in ffmpeg.o
    _do_video_out in ffmpeg.o
    _decode_video in ffmpeg.o
    _process_input in ffmpeg.o
    "_do_benchmark", referenced from :
    _ffmpeg_cleanup in ffmpeg.o
    _main in ffmpeg.o
    "_do_benchmark_all", referenced from :
    _update_benchmark in ffmpeg.o
    "_do_hex_dump", referenced from :
    _check_keyboard_interaction in ffmpeg.o
    _process_input in ffmpeg.o
    "_do_pkt_dump", referenced from :
    _check_keyboard_interaction in ffmpeg.o
    _process_input in ffmpeg.o
    "_dts_delta_threshold", referenced from :
    _process_input in ffmpeg.o
    "_dts_error_threshold", referenced from :
    _do_video_out in ffmpeg.o
    _process_input in ffmpeg.o
    "_exit_on_error", referenced from :
    _write_frame in ffmpeg.o
    _do_subtitle_out in ffmpeg.o
    _process_input in ffmpeg.o
    "_exit_program", referenced from :
    _sigterm_handler in ffmpeg.o
    _assert_avoptions in ffmpeg.o
    _abort_codec_experimental in ffmpeg.o
    _write_frame in ffmpeg.o
    _do_audio_out in ffmpeg.o
    _do_subtitle_out in ffmpeg.o
    _do_video_out in ffmpeg.o
    ...
    "_ffmpeg_parse_options", referenced from :
    _main in ffmpeg.o
    "_frame_bits_per_raw_sample", referenced from :
    _transcode_init in ffmpeg.o
    "_iconv", referenced from :
    _avcodec_decode_subtitle2 in libavcodec.a(utils.o)
    "_iconv_close", referenced from :
    _avcodec_decode_subtitle2 in libavcodec.a(utils.o)
    _avcodec_open2 in libavcodec.a(utils.o)
    "_iconv_open", referenced from :
    _avcodec_decode_subtitle2 in libavcodec.a(utils.o)
    _avcodec_open2 in libavcodec.a(utils.o)
    "_init_simple_filtergraph", referenced from :
    _transcode_init in ffmpeg.o
    "_ist_in_filtergraph", referenced from :
    _decode_audio in ffmpeg.o
    _decode_video in ffmpeg.o
    "_options", referenced from :
    _main in ffmpeg.o
    (maybe you meant : _ff_mpv_generic_options, _ff_rawvideo_options , _av_set_options_string , _ff_rtsp_options )
    "_parse_loglevel", referenced from :
    _main in ffmpeg.o
    "_parse_time_or_die", referenced from :
    _parse_forced_key_frames in ffmpeg.o
    "_print_error", referenced from :
    _write_frame in ffmpeg.o
    _process_input in ffmpeg.o
    "_print_stats", referenced from :
    _print_report in ffmpeg.o
    "_qp_hist", referenced from :
    _print_report in ffmpeg.o
    _check_keyboard_interaction in ffmpeg.o
    "_register_exit", referenced from :
    _main in ffmpeg.o
    "_show_banner", referenced from :
    _main in ffmpeg.o
    "_show_usage", referenced from :
    _main in ffmpeg.o
    "_stdin_interaction", referenced from :
    _transcode in ffmpeg.o
    "_uninit_opts", referenced from :
    _ffmpeg_cleanup in ffmpeg.o
    "_video_sync_method", referenced from :
    _write_frame in ffmpeg.o
    _do_video_out in ffmpeg.o
    _transcode_init in ffmpeg.o
    "_vstats_filename", referenced from :
    _ffmpeg_cleanup in ffmpeg.o
    _do_video_out in ffmpeg.o
    _do_video_stats in ffmpeg.o
    _flush_encoders in ffmpeg.o
    ld : symbol(s) not found for architecture x86_64
    collect2 : ld returned 1 exit status
    make : Leaving directory `/Users/dtamayo/Desktop/ffmpeg-build-desktop-Desktop_Qt_4_8_1_for_GCC__Qt_SDK__Debug'
    make : * [ffmpeg.app/Contents/MacOS/ffmpeg] Error 1
    14:35:42 : The process "/usr/bin/make" exited with code 2.
    Error while building project ffmpeg (target : Desktop)
    When executing build step 'Make'


    EDIT :


    Thank you very much for your quick responses. I'm embarrassed to say that with the help of a friend I found the problem, so I'll add the solution here in case there are others as inept as I am that run into the same issue !

    The problem is that I hadn't added the following source files to the project, which do not get built as part of one of the ffmpeg libraries :

    cmdutils.c ffmpeg_filter.c ffmpeg_opt.c

    In addition, I had to add usr/lib to my library path, and add the library -liconv.

  • i am getting when i am trying to run Ffmpegrabberframe on alpine image [closed]

    18 mars 2020, par avinash tiwari

    # # A fatal error has been detected by the Java Runtime Environment :

    # SIGSEGV (0xb) at pc=0x000000000000dc56, pid=446, tid=0x00007fd3c478db20 # # JRE version : OpenJDK Runtime Environment

    (8.0_242-b08) (build 1.8.0_242-b08) # Java VM : OpenJDK 64-Bit Server
    VM (25.242-b08 mixed mode linux-amd64 compressed oops) # Derivative :
    IcedTea 3.15.0 # Distribution : Custom build (Wed Jan 29 10:43:50 UTC
    2020) # Problematic frame : # C 0x000000000000dc56 # # Failed to
    write core dump. Core dumps have been disabled. To enable core
    dumping, try "ulimit -c unlimited" before starting Java again # # An
    error report file with more information is saved as : #
    /builds/had/tip/asset-delivery/firstgen-ingestion---backend/hs_err_pid446.log

    # If you would like to submit a bug report, please include # instructions on how to reproduce the bug and visit : #

    https://icedtea.classpath.org/bugzilla # Exception in thread
    "Thread-8" java.io.EOFException at
    java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:3015)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1576)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:465)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:423)
    at
    org.scalatest.tools.Framework$ScalaTestRunner$Skeleton$1$React.react(Framework.scala:818)
    at
    org.scalatest.tools.Framework$ScalaTestRunner$Skeleton$1.run(Framework.scala:807)

    def extractAVI(rawDrivePath: String): List[String] = {
       var errorList: List[String] = List.empty
       FileUtils.listFiles(new File(rawDrivePath), new SuffixFileFilter(".avi"), TrueFileFilter.INSTANCE)
         .asScala.toList.foreach(aviFile => {
         var grabber: FFmpegFrameGrabber = null
         var aviStream: InputStream = null
         var isFailedExtraction: Boolean = false
         try {
           LOGGER.info(s"--------inside try----------${aviFile.getAbsolutePath}")
           aviStream = new FileInputStream(aviFile.getAbsolutePath)
           LOGGER.info("--------create grabber----------")
           grabber = new FFmpegFrameGrabber(aviStream)
           LOGGER.info("--------created grabber extraction of drives----------")
           grabber.start()
           LOGGER.info("--------start grabber of drives----------")
           var count: Int = 1
           for (frame <- Iterator.continually(grabber.grabImage()).takeWhile(_ != null)) {
             ImageIO.write(converter.convert(frame), "jpg", new File(aviFile.getParent, "capture-" + count + ".jpg"))
             count += 1
           }
           grabber.stop()
         } catch {
           case ex: Exception => {
             LOGGER.info(s"Error while extracting images for ${aviFile.getAbsolutePath} {}", ex)
             errorList :+= s"${aviFile.getAbsolutePath.replace(rawDrivePath, "")} -> ${ex.getMessage}"
             isFailedExtraction = true
             LOGGER.info("last inside catch")
           }
         } finally {
           // Close the video file
           LOGGER.info(s"inside finally ")
           if (grabber != null)
             grabber.release()
           if (aviStream != null)
             aviStream.close()
           if (aviFile.exists() && !isFailedExtraction) {
             LOGGER.debug(s"Deleting ${aviFile.getAbsolutePath}")
             FileUtils.deleteQuietly(aviFile)
           }
         }
       })