Recherche avancée

Médias (2)

Mot : - Tags -/doc2img

Autres articles (90)

  • Possibilité de déploiement en ferme

    12 avril 2011, par

    MediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
    Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...)

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

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

Sur d’autres sites (9574)

  • ffmpeg error in subprocess.run but works in terminal

    6 juin 2023, par 8TM

    I'm creating my own MKV videos and I found a strange bug when I'm using subprocess module from python 3.11.2 to execute FFmpeg command.

    


    My FFmpeg command is running fine in terminal (ends with success) :

    


    ffmpeg -y \
-i input_video_stream.mkv \
-i input_audio_stream_1.ac3 \
-i input_audio_stream_2.ac3 \
-i input_audio_stream_3.ac3 \
-i input_audio_stream_4.ac3 \
-f srt -i input_subtitle_stream_1.srt \
-f srt -i input_subtitle_stream_2.srt \
-map 0 -map 1 -map 2 -map 3 -map 4 -map 5 -map 6 \
-c copy \
-metadata:s:a:0 language=eng -metadata:s:a:0 title="English1" \
-metadata:s:a:1 language=eng -metadata:s:a:1 title="English2" \
-metadata:s:a:2 language=eng -metadata:s:a:2 title="English3" \
-metadata:s:a:3 language=eng -metadata:s:a:3 title="English4" \
-metadata:s:s:0 language=eng -metadata:s:s:0 title="English1" -metadata:s:s:0 mimetype=application/x-ass \
-metadata:s:s:1 language=eng -metadata:s:s:1 title="English2" -metadata:s:s:1 mimetype=application/x-ass \
-disposition:a:0 default -disposition:s:s:0 default \
output_video_with_audio_and_subtitles.mkv


    


    But when I'm running it by in the same terminal (the same session and the same ffmpeg version) by python from subprocess.run(command) :

    


    subprocess.run([
    'ffmpeg', '-y',
    '-i', 'input_video_stream.mkv',
    '-i', 'input_audio_stream_1.ac3',
    '-i', 'input_audio_stream_2.ac3',
    '-i', 'input_audio_stream_3.ac3',
    '-i', 'input_audio_stream_4.ac3',
    '-f', 'srt', '-i', 'input_subtitle_stream_1.srt',
    '-f', 'srt', '-i', 'input_subtitle_stream_2.srt',
    '-map', '0', '-map', '1', '-map', '2', '-map', '3', '-map', '4', '-map', '5', '-map', '6',
    '-c', 'copy',
    '-metadata:s:a:0', 'language=eng', '-metadata:s:a:0', 'title="English1"', 
    '-metadata:s:a:1', 'language=eng', '-metadata:s:a:1', 'title="English2"', 
    '-metadata:s:a:2', 'language=eng', '-metadata:s:a:2', 'title="English3"', 
    '-metadata:s:a:3', 'language=eng', '-metadata:s:a:3', 'title="English4"', 
    '-metadata:s:s:0', 'language=eng', '-metadata:s:s:0', 'title="English1"', 
    '-metadata:s:s:0', 'mimetype=application/x-ass',
    '-metadata:s:s:1', 'language=eng', '-metadata:s:s:1', 'title="English2"', '-metadata:s:s:1', 'mimetype=application/x-ass', 
    '-disposition:a:0 default', '-disposition:s:s:0 default', 
    'output_video_with_audio_and_subtitles.mkv'
])



    


    it fails :

    


    
ffmpeg version 5.1.2-3 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 12 (Debian 12.2.0-14)
  configuration : —prefix=/usr —extra-version=3 —toolchain=hardened —libdir=/usr/lib/x86_64-linux-gnu —incdir=/usr/include/x86_64-linux-gnu —arch=amd64 —enable-gpl —disable-stripping —enable-gnutls —enable-ladspa —enable-libaom —enable-libass —enable-libbluray —enable-libbs2b —enable-libcaca —enable-libcdio —enable-libcodec2 —enable-libdav1d —enable-libflite —enable-libfontconfig —enable-libfreetype —enable-libfribidi —enable-libglslang —enable-libgme —enable-libgsm —enable-libjack —enable-libmp3lame —enable-libmysofa —enable-libopenjpeg —enable-libopenmpt —enable-libopus —enable-libpulse —enable-librabbitmq —enable-librist —enable-librubberband —enable-libshine —enable-libsnappy —enable-libsoxr —enable-libspeex —enable-libsrt —enable-libssh —enable-libsvtav1 —enable-libtheora —enable-libtwolame —enable-libvidstab —enable-libvorbis —enable-libvpx —enable-libwebp —enable-libx265 —enable-libxml2 —enable-libxvid —enable-libzimg —enable-libzmq —enable-libzvbi —enable-lv2 —enable-omx —enable-openal —enable-opencl —enable-opengl —enable-sdl2 —disable-sndio —enable-libjxl —enable-pocketsphinx —enable-librsvg —enable-libmfx —enable-libdc1394 —enable-libdrm —enable-libiec61883 —enable-chromaprint —enable-frei0r —enable-libx264 —enable-libplacebo —enable-librav1e —enable-shared
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
Input #0, matroska,webm, from 'input_video_stream.mkv' :
  Metadata :
    ENCODER : Lavf59.27.100
  Duration : 00:44:19.94, start : 0.000000, bitrate : 22551 kb/s
  Stream #0:0 : Video : h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn (default)
    Metadata :
      BPS : 22549589
      NUMBER_OF_FRAMES : 63631
      NUMBER_OF_BYTES : 7480665638
      _STATISTICS_WRITING_APP : mkvmerge v56.0.0 ('Strasbourg / St. Denis') 64-bit
      _STATISTICS_WRITING_DATE_UTC : 2023-05-15 08:21:43
      _STATISTICS_TAGS : BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      DURATION : 00:44:19.942000000
[ac3 @ 0x55b374ee9e80] Estimating duration from bitrate, this may be inaccurate
Input #1, ac3, from 'input_audio_stream_1.ac3' :
  Duration : 00:44:19.89, start : 0.000000, bitrate : 448 kb/s
  Stream #1:0 : Audio : ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
[ac3 @ 0x55b37502ef80] Estimating duration from bitrate, this may be inaccurate
Input #2, ac3, from 'input_audio_stream_2.ac3' :
  Duration : 00:44:19.89, start : 0.000000, bitrate : 192 kb/s
  Stream #2:0 : Audio : ac3, 48000 Hz, stereo, fltp, 192 kb/s
[ac3 @ 0x55b374efc900] Estimating duration from bitrate, this may be inaccurate
Input #3, ac3, from 'input_audio_stream_3.ac3' :
  Duration : 00:43:19.18, start : 0.000000, bitrate : 384 kb/s
  Stream #3:0 : Audio : ac3, 48000 Hz, stereo, fltp, 384 kb/s
[ac3 @ 0x55b374fd60c0] Estimating duration from bitrate, this may be inaccurate
Input #4, ac3, from 'input_audio_stream_4.ac3' :
  Duration : 00:43:19.18, start : 0.000000, bitrate : 192 kb/s
  Stream #4:0 : Audio : ac3, 48000 Hz, stereo, fltp, 192 kb/s
Input #5, srt, from 'input_subtitle_stream_1.srt' :
  Duration : N/A, bitrate : N/A
  Stream #5:0 : Subtitle : subrip
Input #6, srt, from 'input_subtitle_stream_2.srt' :
  Duration : N/A, bitrate : N/A
  Stream #6:0 : Subtitle : subrip
[matroska @ 0x55b3751a1940] Invalid stream specifier : a:0 default.
    Last message repeated 1 times


    


    I know it's reporting something with audio ([matroska @ 0x55b3751a1940] Invalid stream specifier : a:0 default. Last message repeated 1 times) but it's probably problem with my ffmpeg command.

    


  • Attaching audio to video stream using ffmpeg

    5 novembre 2023, par lazarea

    My goal is to build a simple 10-second long video with a grey background, a simple text, and a simple mp3 audio to be played. I believe it should be a simple enough task ; yet, I am unable to get it right, as the audio is not attached to the video stream.

    


    My code is as follows :

    


    import subprocess
from pathlib import Path

folder_path = Path(__file__).parent.absolute()
assert folder_path / "i_have_a_cat.mp3"

ffmpeg_command = [
    'ffmpeg',
    '-y',  # Force override without prompting
    '-f', 'lavfi',
    '-i', 'color=c=gray:s=640x480:d=10',
    '-i', str(folder_path / 'i_have_a_cat.mp3'),
    '-vf', 'drawtext=text=\'I have a cat\':fontsize=24:fontcolor=white:x=(w-text_w)/2:y=(h-text_h)/3*2:enable=\'between(t,2,5)\'',
    '-t', '10',
    str(folder_path / 'output.mp4')
]

subprocess.run(ffmpeg_command)


    


    Checking the ffmpeg logs, I don't see anything extraordinary but I'll paste them here nevertheless because I might be overlooking something.

    


    Input #0, lavfi, from 'color=c=gray:s=640x480:d=10':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc

[mp3 @ 000001d271db1140] Estimating duration from bitrate, this may be inaccurate
Input #1, mp3, from 'c:\Users\myfolder\ffmpeg_poc\i_have_a_cat.mp3':
  Metadata:
    encoder         : Lavf58.76.100
  Duration: 00:00:00.86, start: 0.000000, bitrate: 48 kb/s
    Stream #1:0: Audio: mp3, 22050 Hz, mono, fltp, 48 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (mp3 (mp3float) -> aac (native))


    


    Output #0, mp4, to 'c:\Users\myfolder\ffmpeg_poc\output.mp4':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p(progressive), 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 25 fps, 12800 tbn, 25 tbc     
    Metadata:
      encoder         : Lavc58.54.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 22050 Hz, mono, fltp, 69 kb/s
    Metadata:
      encoder         : Lavc58.54.100 aac
[Parsed_color_0 @ 000001d271c6b040] EOF timestamp not reliable
frame=  250 fps=0.0 q=-1.0 Lsize=      24kB time=00:00:09.88 bitrate=  19.9kbits/s speed=31.3x    
video:7kB audio:12kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 23.716467%
[libx264 @ 000001d271d058c0] frame I:1     Avg QP: 9.00  size:   104
[libx264 @ 000001d271d058c0] frame P:63    Avg QP: 9.21  size:    41
[libx264 @ 000001d271d058c0] frame B:186   Avg QP:12.67  size:    21
[libx264 @ 000001d271d058c0] consecutive B-frames:  0.8%  0.0%  0.0% 99.2%
[libx264 @ 000001d271d058c0] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 000001d271d058c0] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:  0.0%  0.0%  0.0%  0.0%  0.0%    skip:100.0%
[libx264 @ 000001d271d058c0] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.0%  0.0%  0.0%  direct: 0.0%  skip:100.0%  L0:50.0% L1:50.0% BI: 0.0%      
[libx264 @ 000001d271d058c0] 8x8 transform intra:0.0%
[libx264 @ 000001d271d058c0] coded y,uvDC,uvAC intra: 0.7% 0.0% 0.0% inter: 0.0% 0.0% 0.0%
[libx264 @ 000001d271d058c0] i16 v,h,dc,p: 97%  0%  3%  0%
[libx264 @ 000001d271d058c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 58% 10% 17%  2%  4%  2%  2%  2%  2%
[libx264 @ 000001d271d058c0] i8c dc,h,v,p: 100%  0%  0%  0%
[libx264 @ 000001d271d058c0] Weighted P-Frames: Y:1.6% UV:0.0%
[libx264 @ 000001d271d058c0] kb/s:5.26
[aac @ 000001d271d071c0] Qavg: 24689.965


    


    Edit

    


    The output of ffprobe -i output.mp4 is as follows :

    


    ffprobe version 6.0-essentials_build-www.gyan.dev Copyright (c) 2007-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-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth 
--enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-libfreetype --enable-libfribidi --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-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  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 'output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.29.100
  Duration: 00:00:04.00, start: 0.000000, bitrate: 37 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 640x480 [SAR 1:1 DAR 4:3], 6 kb/s, 25 fps, 25 tbr, 12800 tbn 
(default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 22050 Hz, mono, fltp, 111 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]


    


  • FFmpeg-command freezes app on NET MAUI Android [closed]

    28 septembre 2024, par Christian Röder

    Cheers,

    


    I'm developing a .NET MAUI app where I want to create videos from a list of images.

    


    This is the command : "-y -f concat -safe 0 -analyzeduration 100M -probesize 50M -i {Path.Combine(basePath, "input.txt")} -vf \"scale=720:1280,setsar=1:1\" -vcodec mpeg4 -pix_fmt yuv420p {outputPath}"

    


    The problem is, my app freezes when the command is executed. I've tried so much await/async/await/Task stuff, it changes nothing. The video ist created anyway...
When I'm using a simple command like "-encoders" everything is fine.

    


    This is the log when creating a video out of three images :

    


    [ffmpeg-kit] ffmpeg version n6.0
[ffmpeg-kit]  Copyright (c) 2000-2023 the FFmpeg developers
[ffmpeg-kit] 
[ffmpeg-kit]   built with Android (7155654, based on r399163b1) clang version 11.0.5 (https://android.googlesource.com/toolchain/llvm-project 87f1315dfbea7c137aa2e6d362dbb457e388158d)
[ffmpeg-kit]   configuration: --cross-prefix=aarch64-linux-android- --sysroot=/Users/sue/Library/Android/sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/darwin-x86_64/sysroot --prefix=/Users/sue/Projects/arthenica/ffmpeg-kit/prebuilt/android-arm64/ffmpeg --pkg-config=/opt/homebrew/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --target-os=android --enable-neon --enable-asm --enable-inline-asm --ar=aarch64-linux-android-ar --cc=aarch64-linux-android24-clang --cxx=aarch64-linux-android24-clang++ --ranlib=aarch64-linux-android-ranlib --strip=aarch64-linux-android-strip --nm=aarch64-linux-android-nm --extra-libs='-L/Users/sue/Projects/arthenica/ffmpeg-kit/prebuilt/android-arm64/cpu-features/lib -lndk_compat' --disable-autodetect --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --disable-static --enable-shared --enable-pthreads --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-videotoolbox --disable-audiotoolbox --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gmp --enable-gnutls --enable-libmp3lame --enable-libass --enable-iconv --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libopencore-amrnb --enable-libshine --enable-libspeex --enable-libdav1d --enable-libkvazaar --enable-libilbc --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libtwolame --disable-sdl2 --enable-libvo-amrwbenc --enable-libzimg --disable-openssl --enable-zlib --enable-mediacodec
[ffmpeg-kit]   libavutil      58.  2.100 / 58.  2.100
[ffmpeg-kit]   libavcodec     60.  3.100 / 60.  3.100
[ffmpeg-kit]   libavformat    60.  3.100 / 60.  3.100
[ffmpeg-kit]   libavdevice    60.  1.100 / 60.  1.100
[ffmpeg-kit]   libavfilter     9.  3.100 /  9.  3.100
[ffmpeg-kit]   libswscale      7.  1.100 /  7.  1.100
[ffmpeg-kit]   libswresample   4. 10.100 /  4. 10.100
[ffmpeg-kit] Input #0, concat, from '/data/user/0/com.companyname.myapp/cache/input.txt':
[ffmpeg-kit]   Duration: 
[ffmpeg-kit] 00:00:01.50
[ffmpeg-kit] , start: 
[ffmpeg-kit] 0.000000
[ffmpeg-kit] , bitrate: 
[ffmpeg-kit] 1 kb/s
[ffmpeg-kit] 
[ffmpeg-kit]   Stream #0:0
[ffmpeg-kit] : Video: png, rgba(pc), 1080x1970
[ffmpeg-kit] , 
[ffmpeg-kit] 25 fps, 
[ffmpeg-kit] 25 tbr, 
[ffmpeg-kit] 25 tbn
[ffmpeg-kit] 
[ffmpeg-kit] Stream mapping:
[ffmpeg-kit]   Stream #0:0 -> #0:0
[ffmpeg-kit]  (png (native) -> mpeg4 (native))
[ffmpeg-kit] 
[ffmpeg-kit] Press [q] to stop, [?] for help
[ffmpeg-kit] Output #0, mp4, to '/data/user/0/com.companyname.myapp/cache/myapp.mp4':
[ffmpeg-kit]   Metadata:
[ffmpeg-kit]     encoder         : 
[ffmpeg-kit] Lavf60.3.100
[ffmpeg-kit] 
[ffmpeg-kit]   Stream #0:0
[ffmpeg-kit] : Video: mpeg4 (mp4v / 0x7634706D), yuv420p(tv, unknown/bt709/iec61966-2-1, progressive), 720x1280 [SAR 1:1 DAR 9:16], q=2-31, 200 kb/s
[ffmpeg-kit] , 
[ffmpeg-kit] 25 fps, 
[ffmpeg-kit] 12800 tbn
[ffmpeg-kit] 
[ffmpeg-kit]     Metadata:
[ffmpeg-kit]       encoder         : 
[ffmpeg-kit] Lavc60.3.100 mpeg4
[ffmpeg-kit] 
[ffmpeg-kit]     Side data:
[ffmpeg-kit]       
[ffmpeg-kit] cpb: 
[ffmpeg-kit] bitrate max/min/avg: 0/0/200000 buffer size: 0 
[ffmpeg-kit] vbv_delay: N/A
[ffmpeg-kit] 
[ffmpeg-kit] frame=    0 fps=0.0 q=4.1 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
[ffmpeg-kit] frame=   36 fps=0.0 q=2.7 Lsize=     268kB time=00:00:01.40 bitrate=1568.3kbits/s dup=33 drop=0 speed=7.18x    
[ffmpeg-kit] video:267kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 
[ffmpeg-kit] 0.382941%
[ffmpeg-kit] 


    


    I've putting the execute command in many different ways like Task.Run(() => ffmpegService.Execute(encoderCommand));