Recherche avancée

Médias (3)

Mot : - Tags -/collection

Autres articles (103)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

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

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (4458)

  • "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.

  • Encoding real, source duration of a timelapse into MP4 container using FFMPEG (GoPro) [closed]

    13 août 2024, par Marek Towarek

    Footage recorded with GoPro TimeLapse / TimeWarp, indicates the total, real-time duration of recorded data, while the video stream is of reduced length by the timelapse interval.

    


    General
Complete name               : E:\Video\GoPro\GoPro\GH010656.MP4
Format                      : MPEG-4
Format profile              : Base Media / Version 1
Codec ID                    : mp41 (mp41)
File size                   : 1.94 GiB
Duration                    : 22 min 55 s
Overall bit rate mode       : Variable
Overall bit rate            : 12.1 Mb/s

Video
ID                          : 1
Format                      : AVC
Format/Info                 : Advanced Video Codec
Format profile              : High@L5
Format settings             : CABAC / 2 Ref Frames
Format settings, CABAC      : Yes
Format settings, Reference  : 2 frames
Format settings, GOP        : M=1, N=15
Codec ID                    : avc1
Codec ID/Info               : Advanced Video Coding
Duration                    : 4 min 35 s
Bit rate mode               : Variable
Bit rate                    : 60.0 Mb/s
Width                       : 1 920 pixels
Height                      : 1 440 pixels
Display aspect ratio        : 4:3
Rotation                    : 180°
Frame rate mode             : Constant
Frame rate                  : 29.970 (30000/1001) FPS
Color space                 : YUV
Chroma subsampling          : 4:2:0
Bit depth                   : 8 bits
Scan type                   : Progressive
Bits/(Pixel*Frame)          : 0.724
Stream size                 : 1.92 GiB (99%)
Title                       : GoPro AVC  
Language                    : English
Color range                 : Limited
colour_range_Original       : Full
Color primaries             : BT.709
Transfer characteristics    : BT.709
Matrix coefficients         : BT.709
Codec configuration box     : avcC

Other #1
ID                          : 2
Type                        : Time code
Format                      : QuickTime TC
Duration                    : 4 min 35 s
Bit rate mode               : Constant
Frame rate                  : 29.970 (30000/1001) FPS
Title                       : GoPro TCD  
Language                    : English

Other #2
Type                        : meta
Duration                    : 22 min 55 s
Source duration             : 4 min 35 s
Bit rate mode               : Variable
Stream size                 : 15.0 MiB
Source stream size          : 15.0 MiB


    


    This information could be omitted.
    
But it becomes quite important for correctness of GPS Data stored in Stream #2.

    


    Unfortunately, all the settings I have tried for FFMPEG, do not preserve the duration of Stream #2.
& the output ends up looking like this :

    


    General
Complete name               : C:\Video_Encode\GoPro\GH010656.mp4
Format                      : MPEG-4
Format profile              : Base Media
Codec ID                    : isom (isom/iso2/mp41)
File size                   : 717 MiB
Duration                    : 4 min 35 s
Overall bit rate            : 21.9 Mb/s
Encoded date                : UTC 2026-03-29 11:28:23
Tagged date                 : UTC 2026-03-29 11:28:23
Writing application         : Lavf61.5.101

Video
ID                          : 1
Format                      : HEVC
Format/Info                 : High Efficiency Video Coding
Format profile              : Main@L5@Main
Codec ID                    : hvc1
Codec ID/Info               : High Efficiency Video Coding
Duration                    : 4 min 35 s
Bit rate                    : 21.4 Mb/s
Width                       : 1 920 pixels
Height                      : 1 440 pixels
Display aspect ratio        : 4:3
Frame rate mode             : Constant
Frame rate                  : 29.970 (30000/1001) FPS
Color space                 : YUV
Chroma subsampling          : 4:2:0 (Type 0)
Bit depth                   : 8 bits
Scan type                   : Progressive
Bits/(Pixel*Frame)          : 0.258
Stream size                 : 702 MiB (98%)
Title                       : GoPro AVC  
Writing library             : x265 3.6+35-dd594f59d:[Windows][GCC 14.1.0][64 bit] 8bit+10bit+12bit
Language                    : English
Encoded date                : UTC 2026-03-29 11:28:23
Tagged date                 : UTC 2026-03-29 11:28:23
Color range                 : Full
Color primaries             : BT.709
Transfer characteristics    : BT.709
Matrix coefficients         : BT.709
Codec configuration box     : hvcC

Other #1
ID                          : 2
Type                        : Time code
Format                      : QuickTime TC
Duration                    : 4 min 35 s
Frame rate                  : 29.970 (30000/1001) FPS
Time code of first frame    : 17:55:35:02
Time code of last frame     : 18:00:09:28
Time code, stripped         : Yes
Title                       : GoPro TCD  
Language                    : English
Default                     : Yes
Alternate group             : 2
Encoded date                : UTC 2026-03-29 11:28:23
Tagged date                 : UTC 2026-03-29 11:28:23
mdhd_Duration               : 275175

Other #2
Type                        : meta
Duration                    : 4 min 35 s
Bit rate mode               : Variable


    


    Any ideas how to preserve that real time duration indicator ?
    
Here is the FFMPEG binary I use to get the TMCD & GMPD data to copy : GitHub Link

    


  • moviepy VideoFileClip IndexError : list index out of range, OSError : MoviePy error : failed to read the duration of file

    21 mai 2022, par Mohamed Medhat

    We are recording videos from the browser with the following encoding
'video/webm ; codecs="vp8, opus"', then we upload these videos to an AWS S3 bucket.
Our ML model works on these videos, and one of the models needs to extarct the audio and process it.
Here is a code snapit for extracting the audio

    


    import speech_recognition as sr
import moviepy.editor as me
from denoise2 import denoise
from sentence_transformers import SentenceTransformer
from sklearn.metrics.pairwise import cosine_similarity
import math

model_name = 'bert-base-nli-mean-tokens'
model = SentenceTransformer(model_name)


class recomm:
    y = 0.0

    def __init__(self, path, keywords):
        video_clip = me.VideoFileClip(r"{}".format(path))
        path2 = "y2.wav"
        video_clip.audio.write_audiofile(r"{}".format(path2), nbytes=2)
        recognizer = sr.Recognizer()
        """a = AudioSegment.from_wav(path2)
        a = a + 5
        a.export(path2, "wav")"""
        audio_clip = sr.AudioFile("{}".format(path2))
        with audio_clip as source:
            audio_file = recognizer.record(source)
        sent = []
        result = ""
        try:
            result = recognizer.recognize_google(audio_file)
        except sr.UnknownValueError:
            print("Can not process audio ")
        if not result:
            self.y = 0
        else:
            print(result)
            sent.append(result)
            sent = sent + keywords
            sent_vec3 = model.encode(sent)
            x = cosine_similarity(
                [sent_vec3[0]],
                sent_vec3[1:]
            )
            for i in range(len(x)):
                self.y = self.y + x[0][i]
            self.y = (self.y / (len(sent) - 1)) * 1000.0

    def res(self):
        if self.y < 0:
            self.y = 0
        return self.y


    


    And that's the traceback,
the error occurred at this line

    


    video_clip = me.VideoFileClip(r"{}".format(path))


    


    Traceback (most recent call last):
File "/home/medo/Dev/Smart-remotely-interviewing-system/backend/Process-interview/test/lib/python3.8/site-packages/moviepy/video/io/ffmpeg_reader.py", line 286, in ffmpeg_parse_infos
match = re.findall("([0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9])", line)[0]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "main.py", line 90, in
main()
File "main.py", line 85, in main
interviews_channel.start_consuming()
File "/home/medo/Dev/Smart-remotely-interviewing-system/backend/Process-interview/test/lib/python3.8/site-packages/pika/adapters/blocking_connection.py", line 1865, in start_consuming
self._process_data_events(time_limit=None)
File "/home/medo/Dev/Smart-remotely-interviewing-system/backend/Process-interview/test/lib/python3.8/site-packages/pika/adapters/blocking_connection.py", line 2026, in _process_data_events
self.connection.process_data_events(time_limit=time_limit)
File "/home/medo/Dev/Smart-remotely-interviewing-system/backend/Process-interview/test/lib/python3.8/site-packages/pika/adapters/blocking_connection.py", line 833, in process_data_events
self._dispatch_channel_events()
File "/home/medo/Dev/Smart-remotely-interviewing-system/backend/Process-interview/test/lib/python3.8/site-packages/pika/adapters/blocking_connection.py", line 567, in _dispatch_channel_events
impl_channel._get_cookie()._dispatch_events()
File "/home/medo/Dev/Smart-remotely-interviewing-system/backend/Process-interview/test/lib/python3.8/site-packages/pika/adapters/blocking_connection.py", line 1492, in _dispatch_events
consumer_info.on_message_callback(self, evt.method,
File "main.py", line 79, in callback
processing(json.loads(body))
File "main.py", line 34, in processing
r = recomm(path, keywords)
File "/home/medo/Dev/Smart-remotely-interviewing-system/backend/Process-interview/recommendation.py", line 17, in init
video_clip = me.VideoFileClip(r"{}".format(path))
File "/home/medo/Dev/Smart-remotely-interviewing-system/backend/Process-interview/test/lib/python3.8/site-packages/moviepy/video/io/VideoFileClip.py", line 88, in init
self.reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt,
File "/home/medo/Dev/Smart-remotely-interviewing-system/backend/Process-interview/test/lib/python3.8/site-packages/moviepy/video/io/ffmpeg_reader.py", line 35, in init
infos = ffmpeg_parse_infos(filename, print_infos, check_duration,
File "/home/medo/Dev/Smart-remotely-interviewing-system/backend/Process-interview/test/lib/python3.8/site-packages/moviepy/video/io/ffmpeg_reader.py", line 289, in ffmpeg_parse_infos
raise IOError(("MoviePy error: failed to read the duration of file %s.\n"
OSError: MoviePy error: failed to read the duration of file 74b74292-3642-486a-8319-255bb7e7da5a-1647363285285.webm.
Here are the file infos returned by ffmpeg:

ffmpeg version 4.2.2-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)
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
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Input #0, matroska,webm, from '74b74292-3642-486a-8319-255bb7e7da5a-1647363285285.webm':
Metadata:
encoder : Chrome
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0(eng): Audio: opus, 48000 Hz, mono, fltp (default)
Stream #0:1(eng): Video: vp8, yuv420p(progressive), 640x480, SAR 1:1 DAR 4:3, 29.42 fps, 29.42 tbr, 1k tbn, 1k tbc (default)
Metadata:
alpha_mode : 1
At least one output file must be specified