
Recherche avancée
Autres articles (14)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...) -
Selection of projects using MediaSPIP
2 mai 2011, parThe examples below are representative elements of MediaSPIP specific uses for specific projects.
MediaSPIP farm @ Infini
The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)
Sur d’autres sites (2553)
-
How to make ffmpeg re-encode an vp9 webm with alpha into a vp9 webm with alpha
28 juillet 2021, par LemmeTestThatI am trying to find optimal parameters for encoding a transparent video using ffmpeg in my scenario, and as a test, I have been re-encoding a pre-made transparent .webm (vp9 with alpha channel, made using python vidgear) like this :


$ /usr/bin/ffmpeg -i pre-made.webm pre-made-remade.webm
ffmpeg version 4.3.2-0york0~18.04 Copyright (c) 2000-2021 the FFmpeg developers
 built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
 configuration: --prefix=/usr --extra-version='0york0~18.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-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-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-libzimg --enable-pocketsphinx --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
Input #0, matroska,webm, from 'pre-made.webm':
 Metadata:
 ENCODER : Lavf58.45.100
 Duration: 00:01:11.04, start: 0.000000, bitrate: 1107 kb/s
 Stream #0:0: Video: vp9 (Profile 0), yuv420p(tv), 1514x1910, SAR 1:1 DAR 757:955, 25 fps, 25 tbr, 1k tbn, 1k tbc (default)
 Metadata:
 alpha_mode : 1
 ENCODER : Lavc58.91.100 libvpx-vp9
 DURATION : 00:01:11.040000000
Stream mapping:
 Stream #0:0 -> #0:0 (vp9 (native) -> vp9 (libvpx-vp9))
Press [q] to stop, [?] for help
[libvpx-vp9 @ 0x55927254b0c0] v1.7.0
[libvpx-vp9 @ 0x55927254b0c0] Neither bitrate nor constrained quality specified, using default CRF of 32
Output #0, webm, to 'pre-made-remade.webm':
 Metadata:
 encoder : Lavf58.45.100
 Stream #0:0: Video: vp9 (libvpx-vp9), yuv420p, 1514x1910 [SAR 1:1 DAR 757:955], q=-1--1, 25 fps, 1k tbn, 25 tbc (default)
 Metadata:
 alpha_mode : 1
 DURATION : 00:01:11.040000000
 encoder : Lavc58.91.100 libvpx-vp9
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame= 1776 fps=8.9 q=0.0 Lsize= 6159kB time=00:01:11.00 bitrate= 710.6kbits/s speed=0.354x
video:6146kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.214488%



According to the ffmpeg logs, the libvpx-vp9 is correctly being chosen, and alpha_mode is 1, which bodes well.
However, when actually viewing the video, the video is no longer trasparent.


How could I force ffmpeg to keep the alpha channel when re-encoding the video ? (This also applies when trying to merge audio into the .webm)


Bonus question : what arguments do you recommend for efficient vp9 encoding ? I have tried using
-threads 16 -speed 4 -tile-columns 6 -frame-parallel 1 -row-mt 1
but it seems to fail at fully utilizing all my CPU cores when encoding with the alpha channel (when piping frames from my python script).

-
libvorbis complains “more samples than frame size”
11 août 2021, par YozI am trying to figure out what's wrong with my command to encode into theora+vorbis. I am able to demonstrate the issue with minimum code as following :


encoding audio followed by video works ok :


ffmpeg -filter_complex "smptehdbars=size=1280x720:rate=30000/1001[v];sine=beep_factor=2[a]" -map [a] -map [v] -vcodec libtheora -acodec libvorbis -t 3 -f ogg map-audio-video.ogg -y



however video followed by audio does not work (swapped order of -map) :


ffmpeg -filter_complex "smptehdbars=size=1280x720:rate=30000/1001[v];sine=beep_factor=2[a]" -map [v] -map [a] -vcodec libtheora -acodec libvorbis -t 3 -f ogg map-video-audio.ogg -y



and fails with the following error :


ffmpeg version 4.4-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
 built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
Stream mapping:
 smptehdbars -> Stream #0:0 (libtheora)
 sine -> Stream #0:1 (libvorbis)
Press [q] to stop, [?] for help
[libvorbis @ 000001f846602fc0] more samples than frame size
Audio encoding failed
Conversion failed!



Any idea why the standard order video, audio breaks on samples vs. frame size ?


-
ffmpeg : Extracted wav from mp4 video does not have equal duration as the original video
26 juillet 2021, par John SmithI have a mp4 video that is 0.92 seconds, and I am trying to extract the audio of the video to a wav format. I have tried several commands (I have provided a list of some of the commands that I have tried), however, the resulting wav does not have the same duration as the original video (the resulting wav often has a duration of 0.96 seconds instead of 0.92 seconds). Ensuring that the video and audio are synchronous is crucial for what I am doing (the videos are typically videos of a person speaking, and it is important that the speech (audio) is in-sync with the mouth movements of the speaker).


I find it odd that, by extracting audio from a video, the duration changes, even despite what is happening under the hood for the conversion (in terms of codecs used, etc).


Some of the commands that I've tried include :


ffmpeg -i <input /> -c copy -map 0:a -sample_rate 16000 <output>

ffmpeg -i <input /> -async 1 -f wav <output>

ffmpeg -i <input /> -vn -acodec copy <output>

ffmpeg -i <input /> -ac 2 -f wav <output>
</output></output></output></output>


Any insight would be highly appreciated.
Thanks !


Edit Output of the command
ffmpeg -ignore_editlist true -i 00026.mp4 output.wav


ffmpeg version 2021-02-28-git-85ab9deb98-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
 built with gcc 10.2.0 (Rev6, 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-lzma --enable-lib
snappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --en
able-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --e
nable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --
enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwben
c --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --en
able-libsoxr --enable-chromaprint
 libavutil 56. 66.100 / 56. 66.100
 libavcodec 58.126.100 / 58.126.100
 libavformat 58. 68.100 / 58. 68.100
 libavdevice 58. 12.100 / 58. 12.100
 libavfilter 7.107.100 / 7.107.100
 libswscale 5. 8.100 / 5. 8.100
 libswresample 3. 8.100 / 3. 8.100
 libpostproc 55. 8.100 / 55. 8.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '00026.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2mp41
 encoder : Lavf57.37.101
 Duration: 00:00:00.98, start: 0.000000, bitrate: 599 kb/s
 Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 160x160 [SAR 1:1 DAR 1:1], 556 kb/s, 25 fps, 25 tbr, 12800 tbn, 25 tbc (default)
 Metadata:
 handler_name : VideoHandler
 vendor_id : [0][0][0][0]
 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 16000 Hz, mono, fltp, 65 kb/s (default)
 Metadata:
 handler_name : SoundHandler
 vendor_id : [0][0][0][0]
Stream mapping:
 Stream #0:1 -> #0:0 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, wav, to 'output.wav':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2mp41
 ISFT : Lavf58.68.100
 Stream #0:0(und): Audio: pcm_s16le ([1][0][0][0] / 0x0001), 16000 Hz, mono, s16, 256 kb/s (default)
 Metadata:
 handler_name : SoundHandler
 vendor_id : [0][0][0][0]
 encoder : Lavc58.126.100 pcm_s16le
size= 32kB time=00:00:00.96 bitrate= 273.7kbits/s speed= 212x
video:0kB audio:32kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.238037%