
Recherche avancée
Autres articles (70)
-
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
-
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)
Sur d’autres sites (5139)
-
B2B Customer Journey Map : A Quickfire Guide for Growth
20 mai 2024, par Erin -
Increased File Size When Converting MP4 to WebM using FFmpeg
23 décembre 2024, par kimgijeongI am using FFmpeg to convert MP4 to WebM with the following command :


ffmpeg -y -hide_banner -nostats \
-f mov,mp4,m4a,3gp,3g2,mj2 -i "http://127.0.0.1:80/lotteon-low-bitrate.mp4" \
-threads auto -f webm -acodec libopus -b:a 96.059k -vcodec libsvtav1 -preset 11 -pix_fmt yuv420p \
-vf "scale='min(-1, iw)':'min(-1,ih)':force_original_aspect_ratio=decrease,crop=trunc(iw/2)*2:trunc(ih/2)*2" \
"/usr/local/m2/m2temp/xcdrtmp/2052_1.webm"



However, the output webm file size is larger than the source MP4 file. For example :


- 

-
Source MP4 : 4.6 MB (bit rate : 994,053 bps)


-
Output WebM : 16 MB (bit rate : 3,902,037 bps)








I know SVT-AV1 encoder defaults to CRF mode. Due to not specifying the bitrate explicitly, the SVT-AV1 encoder automatically sets the bit_rate. It appears that the encoder is setting it to a much higher value (3,323,104 bps), causing the increase in file size compared to the source MP4 (994,053 bps). Here are the methods i tried to reduce the WebM file size compared to the source MP4 :


- 

-b:v 994k




I tried to match the target bitrate with the source MP4's bitrate to reduce the output size, but encountered the following error :


Svt[error]: Instance 1: Force key frames is not supported for VBR mode Last message r
epeated 2 times [libsvtav1 @ 0x239dd100] Error setting encoder parameters: bad parameter (0x80001005)



Looking at the official documentation, this mode change (from CRF to VBR when setting a target bitrate) appears to be expected behavior. However, the error is puzzling since I haven't set any force keyframe parameters in the FFmpeg command.


- 

svtav1-params "mbr=994k"




The second method i tried was using the
svtav1-params "mbr=994k"
option to set the maxrate while maintaining CRF mode This method showed some improvement, but the output file size was still larger than the source MP4.

- 

- Output WebM : 5MB (bit rate : 1,209,877 bps)




The more critical reason why we can't adopt the second method (using
svtav1-params "mbr=994k"
) is that even for the same MP4 source file, the output file size varies slightly with each encoding.

- 

-b:v 994k -svtav1-params “rc=2:pred-struct=1”
(CBR, low delay)




The final method I tried was setting the target bitrate while using CBR (Constant Bit Rate) and low-delay mode The default value for pred-structure is 2(random access), but I had to use low-delay mode due to the following error :


Svt[error]: CBR Rate control is currently not supported for SVT_AV1_PRED_RANDOM_ACCESS, use VBR mode



This way was the only approach among those i tried that successfully reduced the output size.


- 

- Output WebM : 4.3MB (bit rate : 1,032,373 bps)




In summary, I have three questions about this MP4 to WebM conversion issue :


- 

-
When setting the target bitrate with -b:v 994k, the switch to VBR mode is expected behavior. However, why does the force keyframe error occur when we haven't explicitly set any force keyframe parameters ?


-
Why does the output WebM file size fluctuate when setting maxrate either through -maxrate or svtav1-params "mbr=994k", even when using the same MP4 source file ?


-
Besides using -b:v 994k -svtav1-params "rc=2:pred-struct=1" (CBR with low delay), are there any other methods that can guarantee a WebM output size smaller than the source MP4 when converting from MP4 to WebM ?










I am using a recent version of the SVT-AV1 codec :


Svt[info]: SVT [version]: SVT-AV1 Encoder Lib 58146ca
Svt[info]: SVT [build] : GCC 11.5.0 20240719 (Red Hat 11.5.0-2) 64 bit
Svt[info]: LIB Build date: Oct 28 2024 07:40:59
ffmpeg video svt-av1



-
-
ffmpeg does not respect the -t option and keeps recording [closed]
21 juillet 2024, par Naman MuleyThe command I use is :


ffmpeg -f avfoundation -framerate 30 -i "2:0" -vcodec libx264 -pix_fmt yuv420p -acodec aac -strict experimental -t 10 ./recordings/tmp.mp4



With the above command, I expect the recording output to stop after 10 seconds. But the ffmpeg command keeps running and does not stop.
Feels like I am missing something basic but I have now spent 3 hours debugging and cannot figure out why.


Usecase :
I need to record my screen's video as well as audio for a specifiable amount of time.


According to the manual, putting
-t
before-i
limits the input recording and putting it after-i
limits the output recording. I believe after the-i
is the correct way to go.

Output of list devices :


ffmpeg -v verbose -f avfoundation -list_devices true -i ""
ffmpeg version 7.0.1 Copyright (c) 2000-2024 the FFmpeg developers
 built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)
 configuration: --prefix=/usr/local/Cellar/ffmpeg/7.0.1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox
 libavutil 59. 8.100 / 59. 8.100
 libavcodec 61. 3.100 / 61. 3.100
 libavformat 61. 1.100 / 61. 1.100
 libavdevice 61. 1.100 / 61. 1.100
 libavfilter 10. 1.100 / 10. 1.100
 libswscale 8. 1.100 / 8. 1.100
 libswresample 5. 1.100 / 5. 1.100
 libpostproc 58. 1.100 / 58. 1.100
[AVFoundation indev @ 0x7fdc48f047c0] AVFoundation video devices:
[AVFoundation indev @ 0x7fdc48f047c0] [0] FaceTime HD Camera (Built-in)
[AVFoundation indev @ 0x7fdc48f047c0] [1] Screwdriver Desk View Camera
[AVFoundation indev @ 0x7fdc48f047c0] [2] Capture screen 0
[AVFoundation indev @ 0x7fdc48f047c0] [3] Capture screen 1
[AVFoundation indev @ 0x7fdc48f047c0] AVFoundation audio devices:
[AVFoundation indev @ 0x7fdc48f047c0] [0] Built-in Microphone
[AVFoundation indev @ 0x7fdc48f047c0] [1] Screwdriver Microphone
[in#0 @ 0x7fdc49904080] Error opening input: Input/output error
Error opening input file .
Error opening input files: Input/output error



- 

- I tried using different codecs and pix_fmt options.
- Tried moving the
-t
before the-i
option and after. no change.






Works with only audio input :
The below command that records only the audio works out just fine.


ffmpeg -f avfoundation -i ":0" -acodec libmp3lame -t 10 ./recordings/tmp.mp3