
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (13)
-
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...) -
Submit enhancements and plugins
13 avril 2011If you have developed a new extension to add one or more useful features to MediaSPIP, let us know and its integration into the core MedisSPIP functionality will be considered.
You can use the development discussion list to request for help with creating a plugin. As MediaSPIP is based on SPIP - or you can use the SPIP discussion list SPIP-Zone. -
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 (...)
Sur d’autres sites (4056)
-
TTML subtitle missing in HLS
6 juillet 2020, par playmaker420I tried to inject a ttml subtitle into a mp4 file using the following command.


docker run --rm -v `pwd`:/work sambaiz/mp4box -add my.ttml input.mp4


ffmpeg -i input.mp4 
ffmpeg version 3.4 Copyright (c) 2000-2017 the FFmpeg developers
 built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.4)
 configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --disable-ffserver --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libtheora --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab --enable-libwavpack --enable-nvenc --enable-libzimg
 libavutil 55. 78.100 / 55. 78.100
 libavcodec 57.107.100 / 57.107.100
 libavformat 57. 83.100 / 57. 83.100
 libavdevice 57. 10.100 / 57. 10.100
 libavfilter 6.107.100 / 6.107.100
 libavresample 3. 7. 0 / 3. 7. 0
 libswscale 4. 8.100 / 4. 8.100
 libswresample 2. 9.100 / 2. 9.100
 libpostproc 54. 7.100 / 54. 7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: isommp42
 creation_time : 2017-07-06T10:21:17.000000Z
 Duration: 00:03:46.77, start: 0.000000, bitrate: 1900 kb/s
 Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 1770 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
 Metadata:
 creation_time : 2017-07-06T10:21:17.000000Z
 handler_name : ISO Media file produced by Google Inc.
 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
 Metadata:
 creation_time : 2017-07-06T10:21:17.000000Z
 handler_name : ISO Media file produced by Google Inc.
 Stream #0:2(und): Data: none (stpp / 0x70707473), 3 kb/s (default)
 Metadata:
 creation_time : 2020-07-06T09:17:16.000000Z
 handler_name : ***ttml@GPAC0.6.1-rev14-g8eb0297-master**



On playing the input.mp4 with exo player i was able to see the injected ttml subtitle.


Now im trying to conver this mp4 file in to hls using the following command


ffmpeg -i input.mp4 -profile:v baseline -level 3.0 -s 640x360 -start_number 0 -hls_time 10 -hls_list_size 0 -f hls index.m3u8


ffmpeg -i input.mp4 -profile:v baseline -level 3.0 -s 640x360 -start_number 0 -hls_time 10 -hls_list_size 0 -f hls index.m3u8
ffmpeg version 3.4 Copyright (c) 2000-2017 the FFmpeg developers
 built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.4)
 configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --disable-ffserver --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libtheora --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab --enable-libwavpack --enable-nvenc --enable-libzimg
 libavutil 55. 78.100 / 55. 78.100
 libavcodec 57.107.100 / 57.107.100
 libavformat 57. 83.100 / 57. 83.100
 libavdevice 57. 10.100 / 57. 10.100
 libavfilter 6.107.100 / 6.107.100
 libavresample 3. 7. 0 / 3. 7. 0
 libswscale 4. 8.100 / 4. 8.100
 libswresample 2. 9.100 / 2. 9.100
 libpostproc 54. 7.100 / 54. 7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: isommp42
 creation_time : 2017-07-06T10:21:17.000000Z
 Duration: 00:03:46.77, start: 0.000000, bitrate: 1900 kb/s
 Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 1770 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
 Metadata:
 creation_time : 2017-07-06T10:21:17.000000Z
 handler_name : ISO Media file produced by Google Inc.
 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
 Metadata:
 creation_time : 2017-07-06T10:21:17.000000Z
 handler_name : ISO Media file produced by Google Inc.
 Stream #0:2(und): Data: none (stpp / 0x70707473), 3 kb/s (default)
 Metadata:
 creation_time : 2020-07-06T09:17:16.000000Z
 handler_name : *ttml@GPAC0.6.1-rev14-g8eb0297-master
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 @ 0x2270e20] using SAR=1/1
[libx264 @ 0x2270e20] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x2270e20] profile Constrained Baseline, level 3.0
[libx264 @ 0x2270e20] 264 - core 148 r2795 aaa9aa8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=0 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=11 lookahead_threads=1 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=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
[hls @ 0x226d6a0] Opening 'index0.ts' for writing
Output #0, hls, to 'index.m3u8':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: isommp42
 encoder : Lavf57.83.100
 Stream #0:0(und): Video: h264 (libx264), yuv420p(progressive), 640x360 [SAR 1:1 DAR 16:9], q=-1--1, 29.97 fps, 90k tbn, 29.97 tbc (default)
 Metadata:
 creation_time : 2017-07-06T10:21:17.000000Z
 handler_name : ISO Media file produced by Google Inc.
 encoder : Lavc57.107.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
 Stream #0:1(und): Audio: aac (LC), 44100 Hz, stereo, fltp, 128 kb/s (default)
 Metadata:
 creation_time : 2017-07-06T10:21:17.000000Z
 handler_name : ISO Media file produced by Google Inc.
 encoder : Lavc57.107.100 aac
[hls @ 0x226d6a0] Opening 'index1.ts' for writing.16 bitrate=N/A speed=12.1x 
[hls @ 0x226d6a0] Opening 'index.m3u8.tmp' for writing
[hls @ 0x226d6a0] Opening 'index2.ts' for writing.45 bitrate=N/A speed=11.2x 
[hls @ 0x226d6a0] Opening 'index.m3u8.tmp' for writing
[hls @ 0x226d6a0] Opening 'index3.ts' for writing.78 bitrate=N/A speed=10.6x 
[hls @ 0x226d6a0] Opening 'index.m3u8.tmp' for writing
[hls @ 0x226d6a0] Opening 'index4.ts' for writing.72 bitrate=N/A speed=9.91x 
[hls @ 0x226d6a0] Opening 'index.m3u8.tmp' for writing
[hls @ 0x226d6a0] Opening 'index5.ts' for writing.07 bitrate=N/A speed=9.32x 
[hls @ 0x226d6a0] Opening 'index.m3u8.tmp' for writing
[hls @ 0x226d6a0] Opening 'index6.ts' for writing.55 bitrate=N/A speed=9.05x 
[hls @ 0x226d6a0] Opening 'index.m3u8.tmp' for writing
[hls @ 0x226d6a0] Opening 'index7.ts' for writing.72 bitrate=N/A speed=9.27x 
[hls @ 0x226d6a0] Opening 'index.m3u8.tmp' for writing
[hls @ 0x226d6a0] Opening 'index8.ts' for writing.75 bitrate=N/A speed=9.39x 
[hls @ 0x226d6a0] Opening 'index.m3u8.tmp' for writing
[hls @ 0x226d6a0] Opening 'index9.ts' for writing.78 bitrate=N/A speed= 9.1x 
[hls @ 0x226d6a0] Opening 'index.m3u8.tmp' for writing
[hls @ 0x226d6a0] Opening 'index10.ts' for writing25 bitrate=N/A speed=8.95x 
[hls @ 0x226d6a0] Opening 'index.m3u8.tmp' for writing
[hls @ 0x226d6a0] Opening 'index11.ts' for writing47 bitrate=N/A speed=8.77x 
[hls @ 0x226d6a0] Opening 'index.m3u8.tmp' for writing
[hls @ 0x226d6a0] Opening 'index12.ts' for writing99 bitrate=N/A speed=8.61x 
[hls @ 0x226d6a0] Opening 'index.m3u8.tmp' for writing
[hls @ 0x226d6a0] Opening 'index13.ts' for writing83 bitrate=N/A speed=8.32x 
[hls @ 0x226d6a0] Opening 'index.m3u8.tmp' for writing
[hls @ 0x226d6a0] Opening 'index14.ts' for writing89 bitrate=N/A speed=8.43x 
[hls @ 0x226d6a0] Opening 'index.m3u8.tmp' for writing
[hls @ 0x226d6a0] Opening 'index15.ts' for writing25 bitrate=N/A speed= 8.5x 
[hls @ 0x226d6a0] Opening 'index.m3u8.tmp' for writing
[hls @ 0x226d6a0] Opening 'index16.ts' for writing84 bitrate=N/A speed=8.56x 
[hls @ 0x226d6a0] Opening 'index.m3u8.tmp' for writing
[hls @ 0x226d6a0] Opening 'index17.ts' for writing43 bitrate=N/A speed=8.71x 
[hls @ 0x226d6a0] Opening 'index.m3u8.tmp' for writing
[hls @ 0x226d6a0] Opening 'index18.ts' for writing67 bitrate=N/A speed=8.88x 
[hls @ 0x226d6a0] Opening 'index.m3u8.tmp' for writing
[hls @ 0x226d6a0] Opening 'index19.ts' for writing88 bitrate=N/A speed=8.99x 
[hls @ 0x226d6a0] Opening 'index.m3u8.tmp' for writing
[hls @ 0x226d6a0] Opening 'index20.ts' for writing87 bitrate=N/A speed=9.03x 
[hls @ 0x226d6a0] Opening 'index.m3u8.tmp' for writing
[hls @ 0x226d6a0] Opening 'index21.ts' for writing67 bitrate=N/A speed=9.06x 
[hls @ 0x226d6a0] Opening 'index.m3u8.tmp' for writing
[hls @ 0x226d6a0] Opening 'index22.ts' for writing63 bitrate=N/A speed=9.08x 
[hls @ 0x226d6a0] Opening 'index.m3u8.tmp' for writing
[hls @ 0x226d6a0] Opening 'index.m3u8.tmp' for writingitrate=N/A speed=9.12x 
frame= 6796 fps=272 q=-1.0 Lsize=N/A time=00:03:46.76 bitrate=N/A speed=9.08x 
video:25157kB audio:3473kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[libx264 @ 0x2270e20] frame I:44 Avg QP:20.35 size: 33397
[libx264 @ 0x2270e20] frame P:6752 Avg QP:23.97 size: 3598
[libx264 @ 0x2270e20] mb I I16..4: 28.8% 0.0% 71.2%
[libx264 @ 0x2270e20] mb P I16..4: 1.6% 0.0% 0.7% P16..4: 30.3% 13.5% 5.6% 0.0% 0.0% skip:48.3%
[libx264 @ 0x2270e20] coded y,uvDC,uvAC intra: 33.6% 62.8% 24.4% inter: 14.8% 21.2% 5.5%
[libx264 @ 0x2270e20] i16 v,h,dc,p: 25% 47% 12% 16%
[libx264 @ 0x2270e20] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 23% 21% 5% 7% 6% 8% 4% 6%
[libx264 @ 0x2270e20] i8c dc,h,v,p: 54% 30% 13% 4%
[libx264 @ 0x2270e20] ref P L0: 75.4% 14.1% 10.5%
[libx264 @ 0x2270e20] kb/s:908.80
[aac @ 0x221e760] Qavg: 2866.916



Now on playing these segments in exo player i could see the subtitle option listed in exo player but the subtitle is not showing. Can someone help me to figure out the issue


Thanks in advance


-
FFMPEG fade in/out expressed in milliseconds
22 juillet 2020, par orestinoI working on a programmatic sketch to cut, crop and fade in/out audio from a single input video file.
Everything works pretty well except for the audio fade in fade out.


Everything work fine if I set a fade in and fade out time of 1 (or more) seconds. Here's my command :


ffmpeg -ss 0:1:11.10 -i INPUT_FILE.mp4 -filter:a afade=t=in:st=0:d=1.0,afade=t=out:st=55.867:d=1.0 -filter:v crop=720:720:138:0 -to 0:0:56.86 OUTPUT_FILE.mp4



Fade filter stop working if I set time less than 1 secs (say 100ms like the following example).


ffmpeg -ss 0:1:11.10 -i INPUT_FILE.mp4 -filter:a afade=t=in:st=0:d=0.1,afade=t=out:st=56.767:d=0.1 -filter:v crop=720:720:138:0 -to 0:0:56.86 OUTPUT_FILE.mov



I mean, ffmpeg is not complaining about any error but the output video file simply has no fade in or fade out.


Why ?
What I'm doing wrong ?


Thank you so much for your support


Edit 22/07/2020 :
here's the output from the second command :


ffmpeg -ss 0:1:11.10 -i 2020-07-20_00-13-35.mkv -filter:a afade=t=in:st=0:d=0.1,afade=t=out:st=56.767:d=0.1 -filter:v crop=720:720:138:0 -to 0:0:56.86 ./_selections/2020-07-20_00-13-35_R1_crop2_w_fadein_fadeout_0:1:11.10.mov
ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
 built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
 configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
 WARNING: library configuration mismatch
 avcodec configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc
 libavutil 55. 78.100 / 55. 78.100
 libavcodec 57.107.100 / 57.107.100
 libavformat 57. 83.100 / 57. 83.100
 libavdevice 57. 10.100 / 57. 10.100
 libavfilter 6.107.100 / 6.107.100
 libavresample 3. 7. 0 / 3. 7. 0
 libswscale 4. 8.100 / 4. 8.100
 libswresample 2. 9.100 / 2. 9.100
 libpostproc 54. 7.100 / 54. 7.100
Input #0, matroska,webm, from '2020-07-20_00-13-35.mkv':
 Metadata:
 ENCODER : Lavf57.83.100
 Duration: 00:03:19.23, start: 0.000000, bitrate: 2661 kb/s
 Stream #0:0: Video: h264 (High), yuv420p(progressive), 1440x900, 30 fps, 30 tbr, 1k tbn, 60 tbc (default)
 Metadata:
 DURATION : 00:03:19.233000000
 Stream #0:1: Audio: aac (LC), 44100 Hz, stereo, fltp (default)
 Metadata:
 title : audio desktop
 DURATION : 00:03:19.065000000
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 @ 0x564dad2f9680] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x564dad2f9680] profile High, level 3.1
[libx264 @ 0x564dad2f9680] 264 - core 152 r2854 e9a5903 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - 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=6 lookahead_threads=1 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, mov, to './_selections/2020-07-20_00-13-35_R1_crop2_w_fadein_fadeout_0:1:11.10.mov':
 Metadata:
 encoder : Lavf57.83.100
 Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 720x720, q=-1--1, 30 fps, 15360 tbn, 30 tbc (default)
 Metadata:
 DURATION : 00:03:19.233000000
 encoder : Lavc57.107.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
 Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
 Metadata:
 title : audio desktop
 DURATION : 00:03:19.065000000
 encoder : Lavc57.107.100 aac
frame= 1706 fps=140 q=-1.0 Lsize= 2685kB time=00:00:56.86 bitrate= 386.7kbits/s speed=4.67x 
video:1681kB audio:942kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.351145%
[libx264 @ 0x564dad2f9680] frame I:7 Avg QP:15.76 size: 60653
[libx264 @ 0x564dad2f9680] frame P:448 Avg QP:23.13 size: 1372
[libx264 @ 0x564dad2f9680] frame B:1251 Avg QP:31.17 size: 545
[libx264 @ 0x564dad2f9680] consecutive B-frames: 1.3% 2.3% 1.4% 95.0%
[libx264 @ 0x564dad2f9680] mb I I16..4: 29.2% 37.7% 33.1%
[libx264 @ 0x564dad2f9680] mb P I16..4: 0.1% 0.4% 0.5% P16..4: 2.1% 0.2% 0.2% 0.0% 0.0% skip:96.4%
[libx264 @ 0x564dad2f9680] mb B I16..4: 0.0% 0.3% 0.2% B16..8: 1.5% 0.1% 0.1% direct: 0.0% skip:97.8% L0:51.7% L1:46.3% BI: 2.0%
[libx264 @ 0x564dad2f9680] 8x8 transform intra:43.2% inter:27.7%
[libx264 @ 0x564dad2f9680] coded y,uvDC,uvAC intra: 35.4% 42.2% 40.1% inter: 0.3% 0.5% 0.3%
[libx264 @ 0x564dad2f9680] i16 v,h,dc,p: 61% 37% 2% 0%
[libx264 @ 0x564dad2f9680] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 30% 7% 59% 2% 0% 0% 0% 1% 1%
[libx264 @ 0x564dad2f9680] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 17% 25% 10% 4% 5% 5% 7% 7%
[libx264 @ 0x564dad2f9680] i8c dc,h,v,p: 66% 19% 7% 7%
[libx264 @ 0x564dad2f9680] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x564dad2f9680] ref P L0: 65.1% 15.3% 13.6% 5.9%
[libx264 @ 0x564dad2f9680] ref B L0: 68.1% 27.1% 4.8%
[libx264 @ 0x564dad2f9680] ref B L1: 95.3% 4.7%
[libx264 @ 0x564dad2f9680] kb/s:242.09
[aac @ 0x564dad2f25a0] Qavg: 606.451



-
How to overlay 2 videos, one is main second one is overlaying it, and play sound simultaneously. using FFMPEG in ANDROID STUDIO
6 août 2020, par Dusan Lilicas title say I'm trying to overlay 2 videos and play sound simultaneously. So far i managed to put 1 video over another using this command :


String[] command = {"-i", mainVideoPath, "-vf",
 "movie=" + overlayVideo + ", scale=300:-1[inner]; [in][inner]overlay=10:10[out]" ,combinedVideoOutput};



and this works but I have 3 problems here.
First, video is rotated by 90 degrees (overlay video), second Audio is played only from main video (I want to play sound from both videos simultaneously), and third overlay video is longer (for example : overlayVideo duration is 10 seconds and main video last 7 seconds) then mainVideo, so i want to final video last as long as mainVideo, as soon as mainVideo finish, overlayVideo should also stop (need to cut it prolly ?)


String[] command = {"-i", mainVideoPath, "-i", overlayVideo ,
 "-filter_complex", "[1:v][0:v]scale2ref=(256/256)*ih/8/sar:ih/8[wm][base];[base][wm]overlay=10:10" ,combinedVideoOutput};



Using this command i have 2 problems same as above except video is not rotated here.
I have to say that I'm not very familiar with ffmpeg commands. I was trying to figure it out from documentation link to documentation but without any success.
I know that I'm missing some filters like -map merge or something but can't figure it out.
Thanks in advance !


EDIT1 :
This is logcat from second commad as asked


D/LISKO: ffmpeg version n4.0-39-gda39990 Copyright (c) 2000-2018 the FFmpeg developers
 built with gcc 4.9.x (GCC) 20150123 (prerelease)
D/LISKO: configuration: --target-os=linux --cross-prefix=/root/bravobit/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/root/bravobit/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-ffprobe --enable-libopus --enable-libvorbis --enable-libfdk-aac --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-libvpx --enable-libass --enable-yasm --enable-pthreads --disable-debug --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-linux-perf --disable-doc --disable-shared --enable-static --enable-runtime-cpudetect --enable-nonfree --enable-network --enable-avresample --enable-avformat --enable-avcodec --enable-indev=lavfi --enable-hwaccels --enable-ffmpeg --enable-zlib --enable-gpl --enable-small --enable-nonfree --pkg-config=pkg-config --pkg-config-flags=--static --prefix=/root/bravobit/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/root/bravobit/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/root/bravobit/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-cxxflags=
D/LISKO: libavutil 56. 14.100 / 56. 14.100
 libavcodec 58. 18.100 / 58. 18.100
 libavformat 58. 12.100 / 58. 12.100
 libavdevice 58. 3.100 / 58. 3.100
 libavfilter 7. 16.100 / 7. 16.100
D/LISKO: libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 1.100 / 5. 1.100
D/LISKO: libswresample 3. 1.100 / 3. 1.100
 libpostproc 55. 1.100 / 55. 1.100
D/LISKO: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/mainVideo.mp4':
 Metadata:
 major_brand : iso6
 minor_version : 1
 compatible_brands: mp42iso6avc1isom
 creation_time : 2020-08-03T13:20:11.000000Z
 Duration: 00:00:07.04, start: 0.000000, bitrate: 1380 kb/s
 Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 140 kb/s (default)
 Metadata:
 creation_time : 2020-07-28T08:11:36.000000Z
 Stream #0:1(und): Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 81:256 DAR 9:16], 1264 kb/s, 30 fps, 30 tbr, 90k tbn, 180k tbc (default)
 Metadata:
 creation_time : 2020-07-28T08:11:36.000000Z
D/LISKO: Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/overlayVideo.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: isommp42
 creation_time : 2020-08-04T07:27:47.000000Z
 com.android.version: 10
 Duration: 00:00:11.19, start: 0.000000, bitrate: 9993 kb/s
D/LISKO: Stream #1:0(eng): Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 9238 kb/s, SAR 1:1 DAR 16:9, 28.38 fps, 29.75 tbr, 90k tbn, 180k tbc (default)
 Metadata:
 rotate : 270
 creation_time : 2020-08-04T07:27:47.000000Z
 handler_name : VideoHandle
 Side data:
 displaymatrix: rotation of 90.00 degrees
 Stream #1:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
 Metadata:
 creation_time : 2020-08-04T07:27:47.000000Z
 handler_name : SoundHandle
 Stream mapping:
 Stream #0:1 (h264) -> scale2ref:ref (graph 0)
 Stream #1:0 (h264) -> scale2ref:default (graph 0)
 overlay (graph 0) -> Stream #0:0 (libx264)
 Stream #0:0 -> #0:1 (aac (native) -> aac (native))
 Press [q] to stop, [?] for help
D/LISKO: [libx264 @ 0xee986100] using SAR=81/256
D/LISKO: [libx264 @ 0xee986100] using cpu capabilities: ARMv6 NEON
 [libx264 @ 0xee986100] profile High, level 3.1
D/LISKO: [libx264 @ 0xee986100] 264 - core 152 r2851M ba24899 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - 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=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
D/LISKO: Output #0, mp4, to '/storage/emulated/0/outputVideo.mp4':
D/LISKO: Metadata:
 major_brand : iso6
D/LISKO: minor_version : 1
D/LISKO: compatible_brands: mp42iso6avc1isom
D/LISKO: encoder : Lavf58.12.100
 Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 81:256 DAR 9:16], q=-1--1, 30 fps, 15360 tbn, 30 tbc (default)
D/LISKO: Metadata:
 encoder : Lavc58.18.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
D/LISKO: Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
 Metadata:
 creation_time : 2020-07-28T08:11:36.000000Z
D/LISKO: encoder : Lavc58.18.100 aac
D/LISKO: frame= 26 fps=0.0 q=0.0 size= 0kB time=00:00:00.09 bitrate= 4.1kbits/s dup=2 drop=0 speed=0.185x 
D/LISKO: frame= 41 fps= 41 q=0.0 size= 0kB time=00:00:00.58 bitrate= 0.7kbits/s dup=2 drop=0 speed=0.574x 
D/LISKO: frame= 49 fps= 32 q=0.0 size= 0kB time=00:00:00.92 bitrate= 0.4kbits/s dup=2 drop=0 speed=0.613x 
D/LISKO: frame= 59 fps= 29 q=29.0 size= 0kB time=00:00:01.97 bitrate= 0.2kbits/s dup=2 drop=0 speed=0.974x 
D/LISKO: frame= 75 fps= 29 q=29.0 size= 0kB time=00:00:01.97 bitrate= 0.2kbits/s dup=2 drop=0 speed=0.762x 



EDIT2 :
After adding "-shortest" to command i managed to cut overlay video to be the same length as main video (because overlay video is always longer then mainVideo, "-shortest" take short one duration. So now, command looks like this :


String[] command = {"-i", mainVideoPath, "-i", overlayVideo ,"-filter_complex", 
"[1:v][0:v]scale2ref=(256/256)*ih/8/sar:ih/8[wm][base];[base][wm]overlay=10:10", "-shortest", combinedVideoOutput};



Rotation is good so only need to merge their audios. For now, only mainVideo audio is playing, overlay video audio isn't


EDIT 3 :


String[] command = {"-i", mainVideoPath, "-i", overlayVideo ,
 "-strict", "experimental",
 "-filter_complex",
 "[1:v][0:v]scale2ref=(256/256)*ih/8/sar:ih/8[wm][base];" +
 "[base][wm]overlay=10:10; " +
 "pan=stereo|c0=2*c0|c1=3*c0[a0];[1:a]pan=stereo|c0=1*c0|c1=4*c0[a1];[a0][a1]amix=inputs=2:duration=first:dropout_transition=2",
 "-shortest" ,combinedVideoOutput};



With this command i managed to overlay videos, and play sound from both of them, rotation is good, but -shortest doesn't work now. Only existing problem now is to make them to last as shorter one (mainVideo is always shorter) ???


EDIT 4 :


This is finally working command


String[] command = {"-i", mainVideoPath, "-i", overlayVideo,
 "-filter_complex",
 "[1:v][0:v]scale2ref=(256/256)*ih/8/sar:ih/8[wm][base];" +
 "[base][wm]overlay=10:10:shortest=1;" +
 "pan=stereo|c0=2*c0|c1=3*c0[a0];[1:a]pan=stereo|c0=1*c0|c1=4*c0[a1];" +
 "[a0][a1]amix=inputs=2:duration=first:dropout_transition=2",
 combinedVideoOutput};



Thanks