Recherche avancée

Médias (1)

Mot : - Tags -/biographie

Autres articles (96)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • 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

Sur d’autres sites (4996)

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

    


  • FFmpeg with Quicksync : unable to hardware decode file

    9 juin 2023, par MuchToKnow

    I'm trying to convert a h264 video to h265 using hardware decoding/decoding of the iGPU (Quicksync). Decoding does not work throwing the error "Impossible to convert between the formats supported by the filter 'graph 0 input from stream 0:0' and the filter 'auto_scaler_0'"

    


    I'm using the most basic example from https://trac.ffmpeg.org/wiki/Hardware/QuickSync. Hardware encoding works (in this example it's software decoded)

    


    ffmpeg -v verbose -hwaccel qsv -i VID_20230526_174925.mp4 -c:v hevc_qsv -b:v 5M output.mp4


    


    but hardware decoding does not work :

    


    ffmpeg -v verbose -hwaccel qsv -c:v h264_qsv -i VID_20230526_174925.mp4 -f null -


    


    I'm out of ideas.

    


    Full ffmpeg output :

    


    ffmpeg version 4.3.6-0+deb11u1 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 10 (Debian 10.2.1-6)
  configuration: --prefix=/usr --extra-version=0+deb11u1 --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-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-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --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-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
[h264 @ 0x55d0c3b3bfc0] Reinit context to 1920x1088, pix_fmt: yuv420p
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'VID_20230526_174925.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2023-05-26T15:49:25.000000Z
    com.android.version: 10
  Duration: 00:01:22.88, start: 0.000000, bitrate: 14784 kb/s
    Stream #0:0(eng): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, bt709, left), 1920x1080 (1920x1088), 14517 kb/s, SAR 1:1 DAR 16:9, 29.69 fps, 29.75 tbr, 90k tbn, 180k tbc (default)
    Metadata:
      rotate          : 90
      creation_time   : 2023-05-26T15:49:25.000000Z
      handler_name    : VideoHandle
    Side data:
      displaymatrix: rotation of -90.00 degrees
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 191 kb/s (default)
    Metadata:
      creation_time   : 2023-05-26T15:49:25.000000Z
      handler_name    : SoundHandle
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (h264_qsv) -> wrapped_avframe (native))
  Stream #0:1 -> #0:1 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
[graph_1_in_0_1 @ 0x55d0c3ba67c0] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x3
[format_out_0_1 @ 0x55d0c3b5f100] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_1'
[auto_resampler_0 @ 0x55d0c3b81900] ch:2 chl:stereo fmt:fltp r:48000Hz -> ch:2 chl:stereo fmt:s16 r:48000Hz
[AVHWDeviceContext @ 0x55d0c3bb4640] Trying to use DRM render node for device 0, with matching kernel driver (i915).
[AVHWDeviceContext @ 0x55d0c3bb4640] libva: VA-API version 1.10.0
[AVHWDeviceContext @ 0x55d0c3bb4640] libva: User requested driver 'iHD'
[AVHWDeviceContext @ 0x55d0c3bb4640] libva: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x55d0c3bb4640] libva: Found init function __vaDriverInit_1_10
[AVHWDeviceContext @ 0x55d0c3bb4640] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x55d0c3bb4640] Initialised VAAPI connection: version 1.10
[AVHWDeviceContext @ 0x55d0c3bb4640] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 21.1.1 ().
[AVHWDeviceContext @ 0x55d0c3bb4640] Driver not found in known nonstandard list, using standard behaviour.
[AVHWDeviceContext @ 0x55d0c3bbc080] Initialize MFX session: API version is 1.34, implementation version is 1.34
[AVHWDeviceContext @ 0x55d0c3d4d200] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 21.1.1 ().
[AVHWDeviceContext @ 0x55d0c3d4d200] Driver not found in known nonstandard list, using standard behaviour.
[h264_qsv @ 0x55d0c3b59940] Decoder: output is video memory surface
[AVHWDeviceContext @ 0x55d0c3d82640] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 21.1.1 ().
[AVHWDeviceContext @ 0x55d0c3d82640] Driver not found in known nonstandard list, using standard behaviour.
[h264_qsv @ 0x55d0c3b59940] Decoder: output is video memory surface
[graph 0 input from stream 0:0 @ 0x55d0c3da30c0] w:1920 h:1080 pixfmt:qsv tb:1/90000 fr:119/4 sar:1/1
[auto_scaler_0 @ 0x55d0c3d6f2c0] w:iw h:ih flags:'bicubic' interl:0
[transpose @ 0x55d0c3de3600] auto-inserting filter 'auto_scaler_0' between the filter 'graph 0 input from stream 0:0' and the filter 'transpose'
Impossible to convert between the formats supported by the filter 'graph 0 input from stream 0:0' and the filter 'auto_scaler_0'
Error reinitializing filters!
Failed to inject frame into filter network: Function not implemented
Error while processing the decoded data for stream #0:0
[AVIOContext @ 0x55d0c3b43140] Statistics: 670703 bytes read, 3 seeks


    


    Tried to hardware decode a h264 file and it results in the error

    


    Impossible to convert between the formats supported by the filter 'graph 0 input from stream 0:0' and the filter 'auto_scaler_0'


    


  • python subprocess ffmpeg return code = 69

    13 juin 2023, par Tim Chen

    I try to call ffmpeg through the subprocess.run(['ffmpeg', '-i', file_name, output_file_name], capture_output=True, text=True) command in python to convert the audio file incoming from the front end to wav format file. The backend code is as follows, using python+fastapi :

    


    @app.post("/api/upload/convert")
async def convert_upload_file(request: Request, file: UploadFile = File(...)):
    token = uuid.uuid4().hex
    tmpFileName = os.path.join(os.path.dirname(__file__), token)
    with open(tmpFileName, "wb") as buffer:
        buffer.write(await file.read())
    await file.seek(0)
    output_path = tmpFileName + '-output.wav'
    command = ['ffmpeg', '-i', tmpFileName, output_path]
    result = subprocess.run(command, capture_output=True, text=True)


    


    This code usually works, but there are some scenarios where it doesn't work. The audio file is recorded by js code (specifically navigator.mediaDevices.getUserMedia({audio: true})).
The code of the audio recorded in windows chrome can run normally and get the converted wav file, but the audio recorded from ios15 safari for more than 3 seconds cannot be converted, prompting returncode=69. The error message is as follows :

    


    CompletedProcess(args=['ffmpeg', '-i', '5cfb52c503a646bda0f422b517c8014a', '5cfb52c503a646bda0f422b517c8014a-output.wav'], returncode=69, stdout='', stderr="
ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --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-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --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 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil      56. 70.100 / 56. 70.100
libavcodec     58.134.100 / 58.134.100
libavformat    58. 76.100 / 58. 76.100
libavdevice    58. 13.100 / 58. 13.100
libavfilter     7.110.100 /  7.110.100
libswscale      5.  9.100 /  5.  9.100
libswresample   3.  9.100 /  3.  9.100
libpostproc    55.  9.100 / 55.  9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '5cfb52c503a646bda0f422b517c8014a':
  Metadata:
    major_brand     : iso5
    minor_version   : 1
    compatible_brands: isomiso5hlsf
    creation_time   : 2023-06-11T16:36:53.000000Z
  Duration: 00:00:07.06, start: 0.000000, bitrate: 187 kb/s
  Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 184 kb/s (default)
    Metadata:
      creation_time   : 2023-06-11T16:36:53.000000Z
      handler_name    : Core Media Audio
      vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, wav, to '5cfb52c503a646bda0f422b517c8014a-output.wav':
  Metadata:
    major_brand     : iso5
    minor_version   : 1
    compatible_brands: isomiso5hlsf
    ISFT            : Lavf58.76.100
  Stream #0:0(und): Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, mono, s16, 768 kb/s (default)
    Metadata:
      creation_time   : 2023-06-11T16:36:53.000000Z
      handler_name    : Core Media Audio
      vendor_id       : [0][0][0][0]
      encoder         : Lavc58.134.100 pcm_s16le
size=       2kB time=00:00:00.00 bitrate=N/A speed=N/A    
[aac @ 0x55f1f8f19fc0] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x55f1f8f19fc0] Too large remapped id is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x55f1f8f19fc0] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
Error while decoding stream #0:0: Not yet implemented in FFmpeg, patches welcome
[aac @ 0x55f1f8f19fc0] Multiple frames in a packet.
[aac @ 0x55f1f8f19fc0] Reserved bit set.
[aac @ 0x55f1f8f19fc0] Number of bands (18) exceeds limit (13).
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x55f1f8f19fc0] Reserved bit set.
[aac @ 0x55f1f8f19fc0] Prediction is not allowed in AAC-LC.
Error while decoding stream #0:0: Invalid data found when processing input
[aac @ 0x55f1f8f19fc0] Reserved bit set.


    


    For the abnormal code, I tried to execute ffmpeg -i input output.wav after fastapi handle request on the command line and subprocess.run(['ffmpeg', '-i', file_name, output_path], capture_output =True, text=True), all succeeded, which means that the final file must be normal, otherwise the subsequent verification work will get the same error.

    


    This confuses me, is there some information I'm missing ?