
Recherche avancée
Médias (1)
-
Sintel MP4 Surround 5.1 Full
13 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
Autres articles (48)
-
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 (...) -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (7031)
-
FFmpeg using png with tranparency and exclusion blending mode
27 août 2016, par moorejI’m trying to use the exclusion blending mode to blend together a video and a png with transparency. I’ve looked around quite a bit but I can’t find a solution that works for me. Here’s the ffmpeg command :
ffmpeg -i movie.mkv -i text_white_bg_trans.png -filter_complex\
"[1:v]setsar=sar=1,format=rgba[txt]; [0:v]format=rgba[mo]; [mo][txt]blend=all_mode='exclusion'" out_exclusion.mkvEdit : and the console output :
ffmpeg version 3.0.2 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libsoxr --enable-libspeex --enable-libass --enable-libbluray --enable-lzma --enable-gnutls --enable-fontconfig --enable-libfreetype --enable-libfribidi --disable-indev=jack --disable-outdev=xv --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --enable-vda --enable-videotoolbox --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, matroska,webm, from 'movie.mkv':
Metadata:
ENCODER : Lavf57.25.100
Duration: 00:00:11.88, start: 0.000000, bitrate: 5143 kb/s
Stream #0:0: Video: h264 (High), yuv420p, 1640x1232, SAR 1:1 DAR 205:154, 25 fps, 25 tbr, 1k tbn, 50 tbc (default)
Metadata:
ENCODER : Lavc57.24.102 libx264
DURATION : 00:00:11.880000000
Input #1, png_pipe, from 'text_white_bg_trans.png':
Duration: N/A, bitrate: N/A
Stream #1:0: Video: png, rgba(pc), 1640x1232, 25 tbr, 25 tbn, 25 tbc
File 'out_exclusion.mkv' already exists. Overwrite ? [y/N] y
No pixel format specified, yuv444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x7fb10a01e200] using SAR=1/1
[libx264 @ 0x7fb10a01e200] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x7fb10a01e200] profile High 4:4:4 Predictive, level 4.0, 4:4:4 8-bit
[libx264 @ 0x7fb10a01e200] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - 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=4 threads=12 lookahead_threads=2 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, matroska, to 'out_exclusion.mkv':
Metadata:
encoder : Lavf57.25.100
Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv444p, 1640x1232 [SAR 1:1 DAR 205:154], q=-1--1, 25 fps, 1k tbn, 25 tbc (default)
Metadata:
encoder : Lavc57.24.102 libx264
Side data:
unknown side data type 10 (24 bytes)
Stream mapping:
Stream #0:0 (h264) -> format
Stream #1:0 (png) -> setsar
blend -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
frame= 24 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= frame= 47 fps= 40 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= frame= 61 fps= 36 q=28.0 size= 96kB time=00:00:00.12 bitrate=6567.3kbitsframe= 70 fps= 32 q=28.0 size= 264kB time=00:00:00.48 bitrate=4513.9kbitsframe= 83 fps= 30 q=28.0 size= 498kB time=00:00:01.00 bitrate=4079.5kbitsframe= 95 fps= 29 q=28.0 size= 691kB time=00:00:01.48 bitrate=3827.5kbitsframe= 106 fps= 28 q=28.0 size= 896kB time=00:00:01.92 bitrate=3823.7kbitsframe= 118 fps= 27 q=28.0 size= 1132kB time=00:00:02.40 bitrate=3863.7kbitsframe= 130 fps= 26 q=28.0 size= 1338kB time=00:00:02.88 bitrate=3806.1kbitsframe= 142 fps= 26 q=28.0 size= 1588kB time=00:00:03.36 bitrate=3871.7kbitsframe= 154 fps= 25 q=28.0 size= 1808kB time=00:00:03.84 bitrate=3856.9kbitsframe= 166 fps= 25 q=28.0 size= 2062kB time=00:00:04.32 bitrate=3910.9kbitsframe= 178 fps= 24 q=28.0 size= 2328kB time=00:00:04.80 bitrate=3972.8kbitsframe= 190 fps= 24 q=28.0 size= 2620kB time=00:00:05.28 bitrate=4064.7kbitsframe= 203 fps= 24 q=28.0 size= 2886kB time=00:00:05.80 bitrate=4076.0kbitsframe= 215 fps= 24 q=28.0 size= 3132kB time=00:00:06.28 bitrate=4085.9kbitsframe= 226 fps= 24 q=28.0 size= 3357kB time=00:00:06.72 bitrate=4092.5kbitsframe= 238 fps= 24 q=28.0 size= 3589kB time=00:00:07.20 bitrate=4083.9kbitsframe= 250 fps= 23 q=28.0 size= 3794kB time=00:00:07.68 bitrate=4047.3kbitsframe= 260 fps= 23 q=28.0 size= 3978kB time=00:00:08.08 bitrate=4032.7kbitsframe= 272 fps= 23 q=28.0 size= 4212kB time=00:00:08.56 bitrate=4031.0kbitsframe= 284 fps= 23 q=28.0 size= 4453kB time=00:00:09.04 bitrate=4035.3kbitsframe= 295 fps= 23 q=28.0 size= 4632kB time=00:00:09.48 bitrate=4002.9kbitsframe= 297 fps= 20 q=-1.0 Lsize= 5559kB time=00:00:11.80 bitrate=3859.4kbits/s speed=0.808x
video:5556kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.053747%
[libx264 @ 0x7fb10a01e200] frame I:2 Avg QP:21.70 size: 56001
[libx264 @ 0x7fb10a01e200] frame P:178 Avg QP:23.12 size: 24833
[libx264 @ 0x7fb10a01e200] frame B:117 Avg QP:25.78 size: 9886
[libx264 @ 0x7fb10a01e200] consecutive B-frames: 29.3% 49.8% 14.1% 6.7%
[libx264 @ 0x7fb10a01e200] mb I I16..4: 9.5% 75.0% 15.5%
[libx264 @ 0x7fb10a01e200] mb P I16..4: 4.0% 14.8% 1.0% P16..4: 43.3% 12.0% 4.5% 0.0% 0.0% skip:20.4%
[libx264 @ 0x7fb10a01e200] mb B I16..4: 0.6% 1.9% 0.1% B16..8: 48.5% 4.2% 0.3% direct: 0.6% skip:43.8% L0:42.5% L1:55.6% BI: 1.9%
[libx264 @ 0x7fb10a01e200] 8x8 transform intra:74.8% inter:85.5%
[libx264 @ 0x7fb10a01e200] coded y,u,v intra: 31.3% 0.0% 0.0% inter: 15.0% 0.0% 0.0%
[libx264 @ 0x7fb10a01e200] i16 v,h,dc,p: 30% 32% 13% 25%
[libx264 @ 0x7fb10a01e200] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 22% 32% 3% 4% 3% 6% 3% 3%
[libx264 @ 0x7fb10a01e200] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 33% 16% 3% 4% 3% 9% 4% 2%
[libx264 @ 0x7fb10a01e200] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x7fb10a01e200] ref P L0: 72.2% 17.9% 7.5% 2.5%
[libx264 @ 0x7fb10a01e200] ref B L0: 90.9% 8.6% 0.5%
[libx264 @ 0x7fb10a01e200] ref B L1: 98.6% 1.4%
[libx264 @ 0x7fb10a01e200] kb/s:3830.94Edit : Here’s a frame from the output.
The output video is B&W rather than the original color (not sure why). The rectangle in the image is located where there is a block of text on a png with a transparent background. The png is the same size as the video.I’m expecting something more like this :
@Mulvya suggestion fixed the issue with color but I’m still seeing some problems with transparency being handled. I’m attaching a few different images below that each create different problems. All created in Photoshop CC (therein may lie the problem).
A transparent background with a separate text layer that is then exported by Save->png, Photoshop appears to merge these two layers but differently than when "merge layers" is chosen before export. The exported image looks like the B&W image I posted above but with color.
The in the second I merge the layers before exporting. It appears the entire image is treated as white.
In the third I draw "hello" on a transparent layer with a "soft" brush using different grays then export. Transparent areas are rendered as white, gray or translucent areas opaque or with a strange dithering "effect."
It seems I’m moving outside the realm of StackOverflow, but I’m not sure where this post would be better suited.
1
2
3
-
ffmpeg command for faster encoding at a decent bitrate with smaller file size
14 septembre 2016, par Blair HolmesI’m currently using an implementation of ffmpeg on my android app. I’m allowing users to take short videos within my app and then when they upload them to the server, I’m crunching them down with ffmpeg to decrease file size so they’re not passing huge amounts of data over the wire.
the problem is, it’s taking forever to encode the videos on the android device. These videos usually aren’t longer than 45 seconds and can take 20 minutes to encode. I’ve done some playing around with different switches / parameters on the ffmpeg command line and I now have it at a more comfortable time, but the file sizes are significantly bigger. I’m just not sure what codec I should use (fastest encoding but with decent quality output), how ffmpeg handles changing size (aspect ratio) in terms of speed of encoding etc.
Here are the two commands I’ve been using. This first one outputs the file size / quality that I want, but it just takes way too long to encode, not to mention it makes my device get really hot while it’s encoding for so long :
ffmpeg -i input.mp4 -b:v 1024k -c:a copy -vf scale=960:540 output.mp4
I’ve tweaked the bitrate some on that as well as changed the scale to a smaller size, but I don’t want to have to make the videos really small (in terms of scale) to accomplish a faster encoding. this second command goes a lot faster but makes the file size significantly bigger :
ffmpeg -i input.mp4 -vcodec libx264 -preset fast -c:a copy -s 960x540 output.mp4
I’d like to find a happy medium (smaller file size but faster encoding) keeping the video scale size close to the original. ffmpeg just has so many different parameters / switches that it’s difficult to wrap my head around what I should be doing.
EDIT : adding ffmpeg output.
ffmpeg -i input.mp4 -vcodec libx264 -crf 30 -preset veryfast -c:a copy -s 960x540 output.mp4
09-13 11:06:28.330 10881-10881/someapp D/home: ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
09-13 11:06:28.330 10881-10881/someapp D/home: built with gcc 4.8 (GCC)
09-13 11:06:28.331 10881-10881/someapp D/home: configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
09-13 11:06:28.331 10881-10881/someapp D/home: libavutil 55. 17.103 / 55. 17.103
09-13 11:06:28.331 10881-10881/someapp D/home: libavcodec 57. 24.102 / 57. 24.102
09-13 11:06:28.331 10881-10881/someapp D/home: libavformat 57. 25.100 / 57. 25.100
09-13 11:06:28.331 10881-10881/someapp D/home: libavdevice 57. 0.101 / 57. 0.101
09-13 11:06:28.331 10881-10881/someapp D/home: libavfilter 6. 31.100 / 6. 31.100
09-13 11:06:28.331 10881-10881/someapp D/home: libswscale 4. 0.100 / 4. 0.100
09-13 11:06:28.331 10881-10881/someapp D/home: libswresample 2. 0.101 / 2. 0.101
09-13 11:06:28.331 10881-10881/someapp D/home: libpostproc 54. 0.100 / 54. 0.100
09-13 11:06:28.430 10881-10881/someapp D/home: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/ExpeditionSpot/Videos/20160913110411.mp4':
09-13 11:06:28.430 10881-10881/someapp D/home: Metadata:
09-13 11:06:28.430 10881-10881/someapp D/home: major_brand : mp42
09-13 11:06:28.430 10881-10881/someapp D/home: minor_version : 0
09-13 11:06:28.430 10881-10881/someapp D/home: compatible_brands: isommp42
09-13 11:06:28.430 10881-10881/someapp D/home: creation_time : 2016-09-13 17:04:33
09-13 11:06:28.430 10881-10881/someapp D/home: com.android.version: 6.0.1
09-13 11:06:28.430 10881-10881/someapp D/home: Duration: 00:00:19.41, start: 0.000000, bitrate: 20222 kb/s
09-13 11:06:28.430 10881-10881/someapp D/home: Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 1920x1080, 19963 kb/s, SAR 1:1 DAR 16:9, 30.03 fps, 30 tbr, 90k tbn, 180k tbc (default)
09-13 11:06:28.430 10881-10881/someapp D/home: Metadata:
09-13 11:06:28.430 10881-10881/someapp D/home: creation_time : 2016-09-13 17:04:33
09-13 11:06:28.430 10881-10881/someapp D/home: handler_name : VideoHandle
09-13 11:06:28.431 10881-10881/someapp D/home: Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 96 kb/s (default)
09-13 11:06:28.431 10881-10881/someapp D/home: Metadata:
09-13 11:06:28.431 10881-10881/someapp D/home: creation_time : 2016-09-13 17:04:33
09-13 11:06:28.431 10881-10881/someapp D/home: handler_name : SoundHandle
09-13 11:06:28.448 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] using SAR=1/1
09-13 11:06:28.448 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] using cpu capabilities: none!
09-13 11:06:28.516 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] profile High, level 3.1
09-13 11:06:28.516 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 lookahead_threads=4 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=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=crf mbtree=1 crf=27.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
09-13 11:06:28.532 10881-10881/someapp D/home: Output #0, mp4, to '/storage/emulated/0/ExpeditionSpot/.tmp/small-20160913110411.mp4':
09-13 11:06:28.532 10881-10881/someapp D/home: Metadata:
09-13 11:06:28.532 10881-10881/someapp D/home: major_brand : mp42
09-13 11:06:28.533 10881-10881/someapp D/home: minor_version : 0
09-13 11:06:28.533 10881-10881/someapp D/home: compatible_brands: isommp42
09-13 11:06:28.533 10881-10881/someapp D/home: com.android.version: 6.0.1
09-13 11:06:28.533 10881-10881/someapp D/home: encoder : Lavf57.25.100
09-13 11:06:28.533 10881-10881/someapp D/home: Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 960x540 [SAR 1:1 DAR 16:9], q=-1--1, 30 fps, 15360 tbn, 30 tbc (default)
09-13 11:06:28.533 10881-10881/someapp D/home: Metadata:
09-13 11:06:28.533 10881-10881/someapp D/home: creation_time : 2016-09-13 17:04:33
09-13 11:06:28.533 10881-10881/someapp D/home: handler_name : VideoHandle
09-13 11:06:28.533 10881-10881/someapp D/home: encoder : Lavc57.24.102 libx264
09-13 11:06:28.533 10881-10881/someapp D/home: Side data:
09-13 11:06:28.533 10881-10881/someapp D/home: unknown side data type 10 (24 bytes)
09-13 11:06:28.533 10881-10881/someapp D/home: Stream #0:1(eng): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 96 kb/s (default)
09-13 11:06:28.533 10881-10881/someapp D/home: Metadata:
09-13 11:06:28.533 10881-10881/someapp D/home: creation_time : 2016-09-13 17:04:33
09-13 11:06:28.533 10881-10881/someapp D/home: handler_name : SoundHandle
09-13 11:06:28.533 10881-10881/someapp D/home: Stream mapping:
09-13 11:06:28.533 10881-10881/someapp D/home: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
09-13 11:06:28.533 10881-10881/someapp D/home: Stream #0:1 -> #0:1 (copy)
09-13 11:06:28.533 10881-10881/someapp D/home: Press [q] to stop, [?] for help
09-13 11:06:29.102 10881-10881/someapp D/home: frame= 7 fps=0.0 q=0.0 size= 0kB time=00:00:01.04 bitrate= 0.4kbits/s speed=2.08x
09-13 11:06:29.699 10881-10881/someapp D/home: frame= 16 fps= 15 q=0.0 size= 0kB time=00:00:01.04 bitrate= 0.4kbits/s speed=0.998x
....
09-13 11:07:12.674 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] frame I:3 Avg QP:26.83 size: 21896
09-13 11:07:12.674 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] frame P:279 Avg QP:28.76 size: 5859
09-13 11:07:12.674 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] frame B:296 Avg QP:29.93 size: 863
09-13 11:07:12.674 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] consecutive B-frames: 18.3% 32.2% 23.9% 25.6%
09-13 11:07:12.674 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] mb I I16..4: 16.9% 54.2% 28.9%
09-13 11:07:12.674 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] mb P I16..4: 7.7% 9.1% 0.4% P16..4: 27.5% 11.1% 4.0% 0.0% 0.0% skip:40.1%
09-13 11:07:12.674 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] mb B I16..4: 0.8% 0.6% 0.0% B16..8: 10.9% 2.4% 0.1% direct: 1.8% skip:83.5% L0:35.8% L1:54.2% BI:10.0%
09-13 11:07:12.675 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] 8x8 transform intra:52.0% inter:41.3%
09-13 11:07:12.675 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] coded y,uvDC,uvAC intra: 28.9% 26.0% 2.1% inter: 6.4% 5.0% 0.0%
09-13 11:07:12.675 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] i16 v,h,dc,p: 57% 20% 17% 6%
09-13 11:07:12.675 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 33% 23% 34% 1% 2% 1% 3% 2% 2%
09-13 11:07:12.675 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 21% 17% 2% 7% 4% 6% 4% 4%
09-13 11:07:12.675 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] i8c dc,h,v,p: 59% 16% 23% 2%
09-13 11:07:12.675 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] Weighted P-Frames: Y:16.8% UV:4.7%
09-13 11:07:12.675 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] kb/s:812.09 -
FFmpeg Android Video cropping speed and perfomance [duplicate]
5 octobre 2016, par kishore jethavaThis question already has an answer here :
-
Fast Video Compression on Android
2 answers
FFmpeg
15 seconds video takes 15 seconds to crop.
How can we reduce this cropping time with command or some other tricks ?I have refereed this question but didn’t helped.
Here is code
final FFmpeg ffmpeg = FFmpeg.getInstance(getActivity());
try {
ffmpeg.loadBinary(new LoadBinaryResponseHandler() {
@Override
public void onStart() {}
@Override
public void onFailure() {}
@Override
public void onSuccess() {
Log.i(TAG, "FFMPEG Success ");
try {
/*Logic for cropping the original video to a square video depending of the orientation of the original video*/
//Command for cropping square video
String[] cmd = {"-i", "path/source.mp4", "-vf", "scale=720:ih*720/iw, crop="720:720:0:0, "-preset","ultrafast","-strict","experimental","-vcodec","libx264","-preset","ultrafast","path/destination.mp4"};
// Execute cropping of video
ffmpeg.execute(cmd, new ExecuteBinaryResponseHandler() {
@Override
public void onStart() {
}
@Override
public void onProgress(String message) {
Log.i("Square", "progress : " +message);
}
@Override
public void onFailure(String message) {
Log.i("Square", "total fail : " + message);
}
@Override
public void onSuccess(String message) {
Log.i("Square", "Cropped video created.");
}
@Override
public void onFinish() {
}
});
} catch (FFmpegCommandAlreadyRunningException e) {
// Handle if FFmpeg is already running
}
}
});
} catch (FFmpegNotSupportedException e) {
// Handle if FFmpeg is not supported by device
}Logcat
D/FFmpeg: Running publishing updates method
I/Square: progress : ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
I/Square: progress : built with gcc 4.8 (GCC)
I/Square: progress : configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
I/Square: progress : libavutil 55. 17.103 / 55. 17.103
I/Square: progress : libavcodec 57. 24.102 / 57. 24.102
I/Square: progress : libavformat 57. 25.100 / 57. 25.100
I/Square: progress : libavdevice 57. 0.101 / 57. 0.101
I/Square: progress : libavfilter 6. 31.100 / 6. 31.100
I/Square: progress : libswscale 4. 0.100 / 4. 0.100
I/Square: progress : libswresample 2. 0.101 / 2. 0.101
I/Square: progress : libpostproc 54. 0.100 / 54. 0.100
I/Square: progress : Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/Content/source.mp4':
I/Square: progress : Metadata:
I/Square: progress : major_brand : mp42
I/Square: progress : minor_version : 0
I/Square: progress : compatible_brands: isommp42
I/Square: progress : creation_time : 2016-10-05 05:19:12
I/Square: progress : com.android.version: 6.0.1
I/Square: progress : Duration: 00:00:15.91, start: 0.000000, bitrate: 6174 kb/s
I/Square: progress : Stream #0:0(eng): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 326 kb/s, 1.59 fps, 30 tbr, 90k tbn, 15 tbc (default)
I/Square: progress : Metadata:
I/Square: progress : rotate : 90
I/Square: progress : creation_time : 2016-10-05 05:19:12
I/Square: progress : handler_name : VideoHandle
I/Square: progress : Side data:
I/Square: progress : displaymatrix: rotation of -90.00 degrees
I/Square: progress : Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 8000 Hz, mono, fltp, 12 kb/s (default)
I/Square: progress : Metadata:
I/Square: progress : creation_time : 2016-10-05 05:19:12
I/Square: progress : handler_name : SoundHandle
I/Square: progress : [libx264 @ 0xf7544400] using SAR=1/1
I/Square: progress : [libx264 @ 0xf7544400] using cpu capabilities: none!
I/Square: progress : [libx264 @ 0xf7544400] profile Constrained Baseline, level 3.1
I/Square: progress : [libx264 @ 0xf7544400] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - 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=250 keyint_min=25 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
I/Square: progress : [aac @ 0xf7544c00] Too many bits 8832.000000 > 6144 per frame requested, clamping to max
I/Square: progress : Output #0, mp4, to '/storage/emulated/0/Content/destination.mp4':
I/Square: progress : Metadata:
I/Square: progress : major_brand : mp42
I/Square: progress : minor_version : 0
I/Square: progress : compatible_brands: isommp42
I/Square: progress : com.android.version: 6.0.1
I/Square: progress : encoder : Lavf57.25.100
I/Square: progress : Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 638x638 [SAR 1:1 DAR 1:1], q=-1--1, 30 fps, 15360 tbn, 30 tbc (default)
I/Square: progress : Metadata:
I/Square: progress : handler_name : VideoHandle
I/Square: progress : creation_time : 2016-10-05 05:19:12
I/Square: progress : encoder : Lavc57.24.102 libx264
I/Square: progress : Side data:
I/Square: progress : unknown side data type 10 (24 bytes)
I/Square: progress : Stream #0:1(eng): Audio: aac (LC) ([64][0][0][0] / 0x0040), 8000 Hz, mono, fltp, 48 kb/s (default)
I/Square: progress : Metadata:
I/Square: progress : creation_time : 2016-10-05 05:19:12
I/Square: progress : handler_name : SoundHandle
I/Square: progress : encoder : Lavc57.24.102 aac
I/Square: progress : Stream mapping:
I/Square: progress : Stream #0:0 -> #0:0 (mpeg4 (native) -> h264 (libx264))
I/Square: progress : Stream #0:1 -> #0:1 (aac (native) -> aac (native))
I/Square: progress : Press [q] to stop, [?] for help
I/Square: progress : frame= 0 fps=0.0 q=0.0 size= 0kB time=00:00:05.24 bitrate= 0.1kbits/s speed=10.2x
I/Square: progress : frame= 0 fps=0.0 q=0.0 size= 0kB time=00:00:10.24 bitrate= 0.1kbits/s speed= 10x
I/Square: progress : frame= 0 fps=0.0 q=0.0 size= 19kB time=00:00:14.84 bitrate= 10.5kbits/s speed=9.73x
I/Square: progress : frame= 8519 fps=205 q=23.0 size= 3734kB time=00:04:43.53 bitrate= 107.9kbits/s dup=8516 drop=0 speed=6.84x
I/Square: progress : frame= 8537 fps=203 q=25.0 size= 3734kB time=00:04:44.13 bitrate= 107.7kbits/s dup=8516 drop=0 speed=6.77x
I/Square: progress : frame= 8556 fps=201 q=25.0 size= 3735kB time=00:04:44.76 bitrate= 107.4kbits/s dup=8516 drop=0 speed= 6.7x
I/Square: progress : frame= 8575 fps=199 q=25.0 size= 3843kB time=00:04:45.40 bitrate= 110.3kbits/s dup=8516 drop=0 speed=6.64x
I/Square: progress : frame= 8594 fps=198 q=25.0 size= 3844kB time=00:04:46.03 bitrate= 110.1kbits/s dup=8516 drop=0 speed=6.58x
I/Square: progress : frame= 8614 fps=196 q=25.0 size= 3844kB time=00:04:46.70 bitrate= 109.8kbits/s dup=8516 drop=0 speed=6.52x
I/Square: progress : frame= 8633 fps=194 q=25.0 size= 3844kB time=00:04:47.33 bitrate= 109.6kbits/s dup=8516 drop=0 speed=6.45x
I/Square: progress : frame= 8652 fps=192 q=25.0 size= 3844kB time=00:04:47.96 bitrate= 109.4kbits/s dup=8516 drop=0 speed= 6.4x
I/Square: progress : frame= 8672 fps=190 q=26.0 size= 3844kB time=00:04:48.63 bitrate= 109.1kbits/s dup=8516 drop=0 speed=6.34x
I/Square: progress : frame= 8691 fps=189 q=25.0 size= 3845kB time=00:04:49.26 bitrate= 108.9kbits/s dup=8516 drop=0 speed=6.28x
I/Square: progress : frame= 8711 fps=187 q=26.0 size= 3845kB time=00:04:49.93 bitrate= 108.6kbits/s dup=8516 drop=0 speed=6.23x
I/Square: progress : frame= 8731 fps=185 q=26.0 size= 3845kB time=00:04:50.60 bitrate= 108.4kbits/s dup=8516 drop=0 speed=6.17x
I/Square: progress : frame= 8750 fps=184 q=26.0 size= 3845kB time=00:04:51.23 bitrate= 108.2kbits/s dup=8516 drop=0 speed=6.12x
I/Square: progress : frame= 8770 fps=182 q=26.0 size= 3846kB time=00:04:51.90 bitrate= 107.9kbits/s dup=8516 drop=0 speed=6.07x
I/Square: progress : frame= 8791 fps=181 q=26.0 size= 3846kB time=00:04:52.60 bitrate= 107.7kbits/s dup=8516 drop=0 speed=6.02x
I/Square: progress : frame= 8811 fps=179 q=26.0 size= 3846kB time=00:04:53.26 bitrate= 107.4kbits/s dup=8516 drop=0 speed=5.97x
I/Square: progress : frame= 8831 fps=178 q=26.0 size= 3971kB time=00:04:53.93 bitrate= 110.7kbits/s dup=8516 drop=0 speed=5.92x
I/Square: progress : frame= 8851 fps=177 q=26.0 size= 4214kB time=00:04:54.60 bitrate= 117.2kbits/s dup=8516 drop=0 speed=5.88x
I/Square: progress : frame= 8871 fps=175 q=25.0 size= 4451kB time=00:04:55.26 bitrate= 123.5kbits/s dup=8516 drop=0 speed=5.83x
I/Square: progress : frame= 8891 fps=174 q=26.0 size= 4705kB time=00:04:55.93 bitrate= 130.2kbits/s dup=8516 drop=0 speed=5.78x
I/Square: progress : frame= 8911 fps=172 q=26.0 size= 4963kB time=00:04:56.60 bitrate= 137.1kbits/s dup=8516 drop=0 speed=5.74x
I/Square: progress : frame= 8932 fps=171 q=26.0 size= 5226kB time=00:04:57.30 bitrate= 144.0kbits/s dup=8516 drop=0 speed= 5.7x
I/Square: progress : frame= 8952 fps=170 q=26.0 size= 5475kB time=00:04:57.96 bitrate= 150.5kbits/s dup=8516 drop=0 speed=5.65x
I/Square: progress : frame= 8972 fps=169 q=26.0 size= 5730kB time=00:04:58.63 bitrate= 157.2kbits/s dup=8516 drop=0 speed=5.61x
I/Square: progress : frame= 8992 fps=167 q=26.0 size= 5970kB time=00:04:59.30 bitrate= 163.4kbits/s dup=8516 drop=0 speed=5.57x
I/Square: progress : frame= 8993 fps=167 q=-1.0 Lsize= 9456kB time=00:04:59.76 bitrate= 258.4kbits/s dup=8516 drop=0 speed=5.56x
I/Square: progress : video:9350kB audio:68kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.404826%
I/Square: progress : [libx264 @ 0xf7544400] frame I:36 Avg QP:10.64 size:107101
I/Square: progress : [libx264 @ 0xf7544400] frame P:8957 Avg QP:13.80 size: 638
I/Square: progress : [libx264 @ 0xf7544400] mb I I16..4: 100.0% 0.0% 0.0%
I/Square: progress : [libx264 @ 0xf7544400] mb P I16..4: 0.4% 0.0% 0.0% P16..4: 4.3% 0.0% 0.0% 0.0% 0.0% skip:95.3%
I/Square: progress : [libx264 @ 0xf7544400] coded y,uvDC,uvAC intra: 78.5% 24.5% 12.4% inter: 2.6% 0.2% 0.0%
I/Square: progress : [libx264 @ 0xf7544400] i16 v,h,dc,p: 28% 12% 42% 18%
I/Square: progress : [libx264 @ 0xf7544400] i8c dc,h,v,p: 59% 15% 22% 4%
I/Square: progress : [libx264 @ 0xf7544400] kb/s:255.50
I/Square: progress : [aac @ 0xf7544c00] Qavg: 65536.000
I/Square: Cropped video created.
I/Square: finished -
Fast Video Compression on Android