
Recherche avancée
Autres articles (96)
-
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ; -
Librairies et logiciels spécifiques aux médias
10 décembre 2010, parPour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...) -
Taille des images et des logos définissables
9 février 2011, parDans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)
Sur d’autres sites (4062)
-
VP8 And FFmpeg
18 juin 2010, par Multimedia Mike — VP8UPDATE, 2010-06-17 : You don’t need to struggle through these instructions anymore. libvpx 0.9.1 and FFmpeg 0.6 work together much better. Please see this post for simple instructions on getting up and running quickly.
Let’s take the VP8 source code (in Google’s new libvpx library) for a spin ; get it to compile and hook it up to FFmpeg. I am hesitant to publish specific instructions for building in the somewhat hackish manner available on day 1 (download FFmpeg at a certain revision and apply a patch) since that kind of post has a tendency to rise in Google rankings. I will just need to remember to update this post after the library patches are applied to the official FFmpeg tree.
Statement of libvpx’s Relationship to FFmpeg
I don’t necessarily speak officially for FFmpeg. But I’ve been with the project long enough to explain how certain things work.Certainly, some may wonder if FFmpeg will incorporate Google’s newly open sourced libvpx library into FFmpeg. In the near term, FFmpeg will support encoding and decoding VP8 via external library as it does with a number of other libraries (most popularly, libx264). FFmpeg will not adopt the code for its own codebase, even if the license may allow it. That just isn’t how the FFmpeg crew rolls.
In the longer term, expect the FFmpeg project to develop an independent, interoperable implementation of the VP8 decoder. Sometime after that, there may also be an independent VP8 encoder as well.
Building libvpx
Download and build libvpx. This is a basic ’configure && make’ process. The build process creates a static library, a bunch of header files, and 14 utilities. A bunch of these utilities operate on a file format called IVF which is apparently a simple transport method for VP8. I have recorded the file format on the wiki.We could use a decoder for this in the FFmpeg code base for testing VP8 in the future.
Who’s game ?Just as I was proofreading this post, I saw that David Conrad has sent an IVF demuxer to the ffmpeg-devel list.There doesn’t seem to be a ’make install’ step for the library. Instead, go into the overly long directory (on my system, this is generated as vpx-vp8-nopost-nodocs-generic-gnu-v0.9.0), copy the contents of include/ to /usr/local/include and the static library in lib/ to /usr/local/lib .
Building FFmpeg with libvpx
Download FFmpeg source code at the revision specified or take your chances with the latest version (as I did). Download and apply provided patches. This part hurts since there is one diff per file. Most of them applied for me.Configure FFmpeg with
'configure --enable-libvpx_vp8 --enable-pthreads'
. Ideally, this should yield no complaints and ’libvpx_vp8’ should show up in the enabled decoders and encoders sections. The library apparently relies on threading which is why'--enable-pthreads'
is necessary. After I did this, I was able to create a new webm/VP8/Vorbis file simply with :ffmpeg -i input_file output_file.webm
Unfortunately, I can’t complete the round trip as decoding doesn’t seem to work. Passing the generated .webm file back into FFmpeg results in a bunch of errors of this format :
[libvpx_vp8 @ 0x8c4ab20]v0.9.0 [libvpx_vp8 @ 0x8c4ab20]Failed to initialize decoder : Codec does not implement requested capability
Maybe this is the FFmpeg revision mismatch biting me.
FFmpeg Presets
FFmpeg features support for preset files which contain collections of tuning options to be loaded into the program. Google provided some presets along with their FFmpeg patches :- 1080p50
- 1080p
- 360p
- 720p50
- 720p
To invoke one of these (assuming the program has been installed via ’make install’ so that the presets are in the right place) :
ffmpeg -i input_file -vcodec libvpx_vp8 -vpre 720p output_file.webm
This will use a set of parameters that are known to do well when encoding a 720p video.
Code Paths
One of goals with this post was to visualize a call graph after I got the decoder hooked up to FFmpeg. Fortunately, this recon is greatly simplified by libvpx’s simple_decoder utility. Steps :- Build libvpx with
--enable-gprof
- Run simple_decoder on an IVF file
- Get the pl_from_gprof.pl and dot_from_pl.pl scripts frome Graphviz’s gprof filters
- gprof simple_decoder | ./pl_from_gprof.pl | ./dot_from_pl.pl > 001.dot
- Remove the 2 [graph] and 1 [node] modifiers from the dot file (they only make the resulting graph very hard to read)
- dot -Tpng 001.dot > 001.png
Here are call graphs generated from decoding test vectors 001 and 017.
It’s funny to see several functions calling an empty bubble. Probably nothing to worry about. More interesting is the fact that a lot of function_c() functions are called. The ’_c’ at the end is important— that generally indicates that there are (or could be) SIMD-optimized versions. I know this codebase has plenty of assembly. All of the x86 ASM files appear to be written such that they could be compiled with NASM.
Leftovers
One interesting item in the code was vpx_scale/leapster. Is this in reference to the Leapster handheld educational gaming unit ? Based on this item from 2005 (archive.org copy), some Leapster titles probably used VP6. This reminds me of finding references to the PlayStation in Duck/On2’s original VpVision source release. I don’t know of any PlayStation games that used Duck’s original codecs but with thousands to choose from, it’s possible that we may find a few some day. -
ffmpeg error "Could not write header for output file #0 (incorrect codec parameters ?) : Operation not permitted Error initializing output stream 0:0"
27 juillet 2022, par DevSharmaI am running FFmpeg in my app and specifically in "Android 11" I am getting this error from several users


I have researched a lot but no solution found.


I thought there is something wrong with the codec parameter that is being passed since it is saying "incorrect codec parameters" but most of the parameters looks good.


also verified if all the required file permission are granted and those are good too


now I m unable to find the problem,


please help, thanks


Command:
/data/app/~~hyrHVcslcfdQcguX0rauRA==/<apppackage>-QbDCul7FXU4tVniSDeP1Sg==/lib/arm64/libffmpeg.so -i /storage/emulated/0/Android/media/com.whatsapp/WhatsApp/Media/WhatsApp Video/VID-20220414-WA0010.mp4 -c:v libx264 -crf 23 -map 0:V -map 0:a? -map 0:s? -c:s mov_text -segment_time 26 -g 26 -sc_threshold 0 -force_key_frames expr:gte(t,n_forced*26) -reset_timestamps 1 -f segment -preset ultrafast /storage/emulated/0/Movies/splitVideoFolder/split_video%03d.mp4

Error:
ffmpeg version v4.4-dev-416 Copyright (c) 2000-2020 the FFmpeg developers
 built with Android (6454773 based on r365631c2) clang version 9.0.8 (https://android.googlesource.com/toolchain/llvm-project 98c855489587874b2a325e7a516b99d838599c6f) (based on LLVM 9.0.8svn)
 configuration: --cross-prefix=aarch64-linux-android- --sysroot=/Users/admin/AndroidStudioProjects/android-ndk-r21d/toolchains/llvm/prebuilt/darwin-x86_64/sysroot --prefix=/Users/admin/AndroidStudioProjects/Tanner/mobile-ffmpeg/prebuilt/android-arm64/ffmpeg --pkg-config=/usr/local/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --cc=aarch64-linux-android21-clang --cxx=aarch64-linux-android21-clang++ --extra-libs='-L/Users/admin/AndroidStudioProjects/Tanner/mobile-ffmpeg/prebuilt/android-arm64/cpu-features/lib -lndk_compat' --target-os=android --enable-neon --enable-asm --enable-inline-asm --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --disable-shared --disable-ffplay --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-openssl --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --enable-static --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-libmp3lame --enable-libass --enable-iconv --enable-libx264 --enable-gpl --disable-sdl2 --enable-zlib --enable-mediacodec
 libavutil 56. 55.100 / 56. 55.100
 libavcodec 58. 96.100 / 58. 96.100
 libavformat 58. 48.100 / 58. 48.100
 libavdevice 58. 11.101 / 58. 11.101
 libavfilter 7. 87.100 / 7. 87.100
 libswscale 5. 8.100 / 5. 8.100
 libswresample 3. 8.100 / 3. 8.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/Android/media/com.whatsapp/WhatsApp/Media/WhatsApp Video/VID-20220414-WA0010.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: mp42isom
 Duration: 00:01:30.53, start: 0.000000, bitrate: 671 kb/s
 Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/smpte170m), 576x1024 [SAR 1:1 DAR 9:16], 539 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
 Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
 Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0xb400007727c64800] using SAR=1/1
[libx264 @ 0xb400007727c64800] using cpu capabilities: ARMv8 NEON
[libx264 @ 0xb400007727c64800] profile Constrained Baseline, level 3.1, 4:2:0, 8-bit
[libx264 @ 0xb400007727c64800] 264 - core 160 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - 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=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=26 keyint_min=2 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
[segment @ 0xb400007727c28800] Opening '/storage/emulated/0/Movies/splitVideoFolder/split_video000.mp4' for writing
[segment @ 0xb400007727c28800] Failed to open segment '/storage/emulated/0/Movies/splitVideoFolder/split_video000.mp4'
Could not write header for output file #0 (incorrect codec parameters ?): Operation not permitted
Error initializing output stream 0:0 --
[aac @ 0xb400007727c65700] Qavg: 18220.703
[aac @ 0xb400007727c65700] 2 frames left in the queue on closing
Conversion failed!
</apppackage>


-
Using ffmpeg to read mp4 file from stdin and extract image is failing with "Invalid data found when processing input"
16 mars 2023, par jsindosUsing ffmpeg, I'm trying to read an mp4 file from stdin, and save the last frame of the file to jpg.


cat PXL_20221118_051057924.TS.mp4 | ffmpeg -sseof -3 -i - -f mp4 -update 1 -q:v 1 last.jpg



The command works fine when not running from stdin.


When running from stdin, an empty file is created, with the following error message :


[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fcb4d0041c0] stream 1, offset 0x2eaee0d: partial file
pipe:: Invalid data found when processing input



I've posted the full output below.


—


ffmpeg version 5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
 built with Apple clang version 14.0.0 (clang-1400.0.29.202)
 configuration: --prefix=/usr/local/Cellar/ffmpeg/5.1.2_5 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --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
 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
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fcb4d0041c0] stream 2, offset 0x2c: partial file
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'pipe:':
 Metadata:
 major_brand : isom
 minor_version : 131072
 compatible_brands: isomiso2mp41
 creation_time : 2022-11-18T05:11:23.000000Z
 com.android.capture.fps: 30.000000
 Duration: 00:00:23.74, start: 0.000000, bitrate: N/A
 Stream #0:0[0x1](eng): Data: none (mett / 0x7474656D), 45 kb/s (default)
 Metadata:
 creation_time : 2022-11-18T05:11:23.000000Z
 handler_name : MetaHandle
 Stream #0:1[0x2](eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
 Metadata:
 creation_time : 2022-11-18T05:11:23.000000Z
 handler_name : SoundHandle
 vendor_id : [0][0][0][0]
 Stream #0:2[0x3](eng): Video: hevc (Main) (hvc1 / 0x31637668), yuvj420p(pc, bt709), 1920x1080, 19524 kb/s, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 90k tbn (default)
 Metadata:
 creation_time : 2022-11-18T05:11:23.000000Z
 handler_name : VideoHandle
 vendor_id : [0][0][0][0]
 Side data:
 displaymatrix: rotation of -90.00 degrees
 Stream #0:3[0x4](eng): Data: none (mett / 0x7474656D) (default)
 Metadata:
 creation_time : 2022-11-18T05:11:23.000000Z
 handler_name : MetaHandle
Stream mapping:
 Stream #0:2 -> #0:0 (hevc (native) -> h264 (libx264))
 Stream #0:1 -> #0:1 (aac (native) -> aac (native))
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fcb4d0041c0] stream 1, offset 0x2eaee0d: partial file
pipe:: Invalid data found when processing input
[libx264 @ 0x7fcb4d10b500] -qscale is ignored, -crf is recommended.
[libx264 @ 0x7fcb4d10b500] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7fcb4d10b500] profile High, level 4.0, 4:2:0, 8-bit
[libx264 @ 0x7fcb4d10b500] 264 - core 164 r3095 baee400 - H.264/MPEG-4 AVC codec - Copyleft 2003-2022 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=18 lookahead_threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/Users/josephtsindos/Downloads/last2.jpg':
 Metadata:
 major_brand : isom
 minor_version : 131072
 compatible_brands: isomiso2mp41
 com.android.capture.fps: 30.000000
 encoder : Lavf59.27.100
 Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), yuvj420p(pc), 1080x1920, q=2-31, 30 fps, 15360 tbn (default)
 Metadata:
 creation_time : 2022-11-18T05:11:23.000000Z
 handler_name : VideoHandle
 vendor_id : [0][0][0][0]
 encoder : Lavc59.37.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
 displaymatrix: rotation of -0.00 degrees
 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
 Metadata:
 creation_time : 2022-11-18T05:11:23.000000Z
 handler_name : SoundHandle
 vendor_id : [0][0][0][0]
 encoder : Lavc59.37.100 aac
frame= 0 fps=0.0 q=0.0 Lsize= 0kB time=00:00:00.00 bitrate=N/A speed= 0x 
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[aac @ 0x7fcb4d10c840] Qavg: nan