
Recherche avancée
Autres articles (97)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Déploiements possibles
31 janvier 2010, parDeux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
Version mono serveur
La version mono serveur consiste à n’utiliser qu’une (...) -
Configuration spécifique pour PHP5
4 février 2011, parPHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
Modules spécifiques
Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...)
Sur d’autres sites (6960)
-
Why ffmpeg concat with 2 videos is losing the 2nd audio ?
24 janvier 2016, par Damian Marcosi am trying to merge videos (with their respective audios), but when trying to concatenate 2 different video sources, the second audio is not played.
(videos.txt has the 2 videos im trying to concat)
shell_exec('ffmpeg -f concat -i videos.txt -crf 30 -c:a aac -strict experimental output.mp4');
Any help will be appreciated !
Thanks !!
FFPROBE FOR BOTH FILES :
ffprobe version N-76417-gee20354 Copyright (c) 2007-2015 the FFmpeg developers
built with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
configuration: --prefix=/home/dmarcos89/ffmpeg_build --extra-cflags=-I/home/dmarcos89/ffmpeg_build/include --extra-ldflags=-L/home/dmarcos89/ffmpeg_build/lib --bindir=/usr/local/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265
libavutil 55. 5.100 / 55. 5.100
libavcodec 57. 13.102 / 57. 13.102
libavformat 57. 13.100 / 57. 13.100
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 14.101 / 6. 14.101
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.100 / 2. 0.100
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 't1.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.13.100
Duration: 00:00:10.14, start: 0.042667, bitrate: 1343 kb/s
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1183 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 161 kb/s (default)
Metadata:
handler_name : SoundHandler
ffprobe version N-76417-gee20354 Copyright (c) 2007-2015 the FFmpeg developers
built with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
configuration: --prefix=/home/dmarcos89/ffmpeg_build --extra-cflags=-I/home/dmarcos89/ffmpeg_build/include --extra-ldflags=-L/home/dmarcos89/ffmpeg_build/lib --bindir=/usr/local/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265
libavutil 55. 5.100 / 55. 5.100
libavcodec 57. 13.102 / 57. 13.102
libavformat 57. 13.100 / 57. 13.100
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 14.101 / 6. 14.101
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.100 / 2. 0.100
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 't2.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.13.100
Duration: 00:00:07.32, start: 0.042667, bitrate: 3616 kb/s
Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 3487 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s (default)
Metadata:
handler_name : SoundHandlerAnd this is the start of the output message after trying to concat (the entire output is very large and repeats ’Error while decoding stream #0:1 : Invalid data...’ :
`
Input #0, concat, from 'videos.txt':
Duration: N/A, start: 0.000000, bitrate: 1129 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 639 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 490 kb/s
Metadata:
handler_name : SoundHandler
[libx264 @ 0x2dd3540] using SAR=1/1
[libx264 @ 0x2dd3540] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX XOP FMA4 SSEMisalign LZCNT
[libx264 @ 0x2dd3540] profile High, level 3.1
[libx264 @ 0x2dd3540] 264 - core 120 r2151 a3f4407 - H.264/MPEG-4 AVC codec - Copyleft 2003-2011 - 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=24 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=30.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
Metadata:
encoder : Lavf57.13.100
Stream #0:0(und): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc
Metadata:
handler_name : VideoHandler
encoder : Lavc57.13.102 libx264
Stream #0:1(und): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, 5.1, fltp, 128 kb/s
Metadata:
handler_name : SoundHandler
encoder : Lavc57.13.102 aac
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
frame= 43 fps=0.0 q=0.0 size= 0kB time=00:00:02.28 bitrate= 0.2kbits/s dup=1 drop=0
frame= 80 fps= 80 q=35.0 size= 44kB time=00:00:03.75 bitrate= 96.0kbits/s dup=1 drop=0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xa559a80] Auto-inserting h264_mp4toannexb bitstream filter
[aac @ 0x2daa540] channel element 1.0 is not allocated
Error while decoding stream #0:1: Invalid data found when processing input`
-
fastest ffmpeg without caring about quality
31 mai 2019, par RedDeathI would like to convert any video into .mp4 as fast as possible without caring about quality loss. I have used the next commands with which I have been able to finish the process in 37 seconds for a 10 second video.
-vcodec h264
-crf 32
-preset ultrafastHowever 37 seconds is still too long for a 10 seconds video. Is there any improvements that I can do to the command in order to reduce the execution time ?
Edit (Extra info) :
I’m using FFmpeg Android (
implementation 'com.writingminds:FFmpegAndroid:0.3.2'
) even though commands usually work for any FFmpeg (with a few variants depending on the FFmpeg version).The command used in my case which gave me the fastest result so far is :
mFfmpeg.execute(
arrayOf(
"-i" , videoCopy?.path,
"-vcodec", "h264",
"-crf", "32",
"-preset", "ultrafast",
"-y", uploadFile?.path),
object : ExecuteBinaryResponseHandler() { ... }Which for regular FFmpeg command would be
"-ffmpeg -i {video?.path} -vcodec h264 -crf 32 -preset ultrafast -y {uploadFile?.path}"
Where
video
is my original videoFile
anduploadFile
is theFile
where I want to save the result into.In a Samsung J3 (SM-J320M, you can find its specifications online) such command takes the aforementioned 37 seconds.
After executing such command the first onProgress message returned by FFmpeg prints :
ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 4.8 (GCC)
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=
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
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/DCIM/Yakatak/656.mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: isommp42 creation_time : 2019-05-29 11:27:56 location : +51.5202-000.1435/ location-eng : +51.5202-000.1435/ Duration: 00:00:09.47, start: 0.000000, bitrate: 12147 kb/s Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x720, 11899 kb/s, 30.02 fps, 30 tbr, 90k tbn, 180k tbc (default) Metadata: rotate : 90 creation_time : 2019-05-29 11:27:56 handler_name : VideoHandle Side data: displaymatrix: rotation of -90.00 degrees Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 256 kb/s (default) Metadata: creation_time : 2019-05-29 11:27:56 handler_name : SoundHandle[libx264 @ 0xb5428800] using cpu capabilities: none![libx264 @ 0xb5428800] profile Constrained Baseline, level 3.1[libx264 @ 0xb5428800] 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=6 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=0 intra_refresh=0 rc=crf mbtree=0 crf=32.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
Output #0, mp4, to '/storage/emulated/0/DCIM/Yakatak/uploadFile.mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: isommp42 location-eng : +51.5202-000.1435/ location : +51.5202-000.1435/ encoder : Lavf57.25.100 Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 720x1280, q=-1--1, 30 fps, 15360 tbn, 30 tbc (default) Metadata: handler_name : VideoHandle creation_time : 2019-05-29 11:27:56 encoder : Lavc57.24.102 libx264 Side data: unknown side data type 10 (24 bytes) Stream #0:1(eng): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, fltp, 128 kb/s (default) Metadata: creation_time : 2019-05-29 11:27:56 handler_name : SoundHandle encoder : Lavc57.24.102 aacStream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Stream #0:1 -> #0:1 (aac (native) -> aac (native))Press [q] to stop, [?] for helpframe= 0 fps=0.0 -
FFMPEG encrypted HLS single file is unplayable
17 septembre 2019, par 3bodyZZi use this command to generate the byterange segments
ffmpeg -i test.mp4 -hls_time 20 -hls_flags single_file -hls_key_info_file key_info out.m3u8
here is the output m3u8#EXTM3U
#EXT-X-VERSION:4
#EXT-X-TARGETDURATION:24
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-KEY:METHOD=AES-128,URI="key.bin"
#EXTINF:23.933333,
#EXT-X-BYTERANGE:1016328@0
out.ts
#EXTINF:19.200000,
#EXT-X-BYTERANGE:824192@1016328
out.ts
#EXTINF:16.866667,
#EXT-X-BYTERANGE:714024@1840520
out.ts
#EXT-X-ENDLISTand it does output incorrect byte range m3u8 file that is unplayable, i have tried the multiple segments and it works just fine but i need the single file, any one knows how to fix this ?
here is the logs from ffmpeg
ffmpeg version N-94167-ga514244319 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9.1.1 (GCC) 20190621
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
libavutil 56. 30.100 / 56. 30.100
libavcodec 58. 53.101 / 58. 53.101
libavformat 58. 28.101 / 58. 28.101
libavdevice 58. 7.100 / 58. 7.100
libavfilter 7. 56.100 / 7. 56.100
libswscale 5. 4.101 / 5. 4.101
libswresample 3. 4.100 / 3. 4.100
libpostproc 55. 4.100 / 55. 4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'ttt.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.40.101
Duration: 00:01:00.16, start: 0.000000, bitrate: 227 kb/s
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 480x320, 157 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s (default)
Metadata:
handler_name : SoundHandler
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 @ 000001df1e25dd80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 000001df1e25dd80] profile Progressive High, level 2.1, 4:2:0, 8-bit
[libx264 @ 000001df1e25dd80] 264 - core 157 r2970 5493be8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - 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
[hls @ 000001df1e25ac80] Opening 'key_info' for reading
[hls @ 000001df1e25ac80] Opening 'key.bin' for reading
[hls @ 000001df1e25ac80] Opening 'crypto:out.ts' for writing
Output #0, hls, to 'out.m3u8':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.28.101
Stream #0:0(und): Video: h264 (libx264), yuv420p, 480x320, q=-1--1, 30 fps, 90k tbn, 30 tbc (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc58.53.101 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:
handler_name : SoundHandler
encoder : Lavc58.53.101 aac
[hls @ 000001df1e25ac80] Opening 'out.m3u8.tmp' for writinge=N/A speed=25.4x
[hls @ 000001df1e25ac80] Opening 'out.m3u8.tmp' for writinge=N/A speed=23.8x
[hls @ 000001df1e25ac80] Opening 'out.m3u8.tmp' for writinge=N/A speed=23.7x
frame= 1800 fps=723 q=-1.0 Lsize=N/A time=00:01:00.11 bitrate=N/A speed=24.1x
video:1196kB audio:947kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[libx264 @ 000001df1e25dd80] frame I:25 Avg QP:18.20 size: 18883
[libx264 @ 000001df1e25dd80] frame P:524 Avg QP:21.64 size: 1174
[libx264 @ 000001df1e25dd80] frame B:1251 Avg QP:30.70 size: 109
[libx264 @ 000001df1e25dd80] consecutive B-frames: 4.2% 7.6% 5.8% 82.4%
[libx264 @ 000001df1e25dd80] mb I I16..4: 29.1% 8.6% 62.3%
[libx264 @ 000001df1e25dd80] mb P I16..4: 1.1% 0.8% 1.1% P16..4: 14.6% 3.7% 2.2% 0.0% 0.0% skip:76.5%
[libx264 @ 000001df1e25dd80] mb B I16..4: 0.0% 0.0% 0.1% B16..8: 7.1% 0.5% 0.1% direct: 0.2% skip:92.0% L0:47.1% L1:51.6% BI: 1.3%
[libx264 @ 000001df1e25dd80] 8x8 transform intra:15.8% inter:36.0%
[libx264 @ 000001df1e25dd80] coded y,uvDC,uvAC intra: 47.5% 75.5% 54.9% inter: 1.7% 4.4% 0.7%
[libx264 @ 000001df1e25dd80] i16 v,h,dc,p: 48% 45% 5% 2%
[libx264 @ 000001df1e25dd80] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 20% 48% 2% 2% 1% 2% 2% 3%
[libx264 @ 000001df1e25dd80] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 26% 27% 12% 7% 6% 5% 6% 5% 6%
[libx264 @ 000001df1e25dd80] i8c dc,h,v,p: 34% 37% 21% 7%
[libx264 @ 000001df1e25dd80] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 000001df1e25dd80] ref P L0: 83.5% 4.4% 9.5% 2.6%
[libx264 @ 000001df1e25dd80] ref B L0: 90.1% 8.9% 1.0%
[libx264 @ 000001df1e25dd80] ref B L1: 95.4% 4.6%
[libx264 @ 000001df1e25dd80] kb/s:163.19
[aac @ 000001df1e2138c0] Qavg: 357.178i have also tried different videos, and i have tried ffmpeg on windows and linux , i have tried compiling it myself and nothing seems to work the segments keeps repeating after reaching a certain point in the video