
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (39)
-
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 (...) -
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" ; -
Selection of projects using MediaSPIP
2 mai 2011, parThe examples below are representative elements of MediaSPIP specific uses for specific projects.
MediaSPIP farm @ Infini
The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)
Sur d’autres sites (5720)
-
FFMPEG Converted Video Not Working In HTML5
27 novembre 2015, par Suprabhat BiswalConverted Avi to Mp4 using FFMPEG, Converted video not working in html
5I have a section in my web page where user can upload any types of videos of any format , currently only restricted to .mp4 and .avi. After successfull upload i have displayed the same video to the user. I have bind the path in HTML5 video so that the user can view the content he/she has uploded. Video with extension .mp4 no doubt are working properly as HTML5 support them. Tricky part is it don’t support Avi files. Now here what the problem has arised. In order to display avi videos i have used FFMPEG to convert videos with extension .avi to .mp4. With lots of googling and reading forum, i have succesfully converted avi videos to mp4 . Here’s what i have used :-
-
ffmpeg -i input.avi -acodec libfaac -b:a 128k -vcodec mpeg4 -b:v 1200k -flags +aic+mv4 output.mp4
-
ffmpeg -i input.avi -c:v libx264 -b:a 128k -vcodec mpeg4 -b:v 1200k -flags +aic+mv4 output.mp4
Above two are working perfectly, they have succesfully converted the video. But when i run them on browser in HTML5 and in new tab (Flash Player Plugin Installed), HTML5 doesn’t play it and flash player return an error message "Video can’t be played because the file is corrupt". But when i played them on KMplayer and in Window media player they are running perfectly.
I have been to various threads in stackoverflow related to convert avi to mp4 and here i found following in one of the forum. where one of user has accepted this a correct answer but it ain’t worked out for me.
ffmpeg -y -i sample.avi -b:v 1500k -vcodec libx264 -vpre slow -vpre baseline -g 30 sample.mp4
Above argument returned me following error "File for preset ’slow’ not found".
Following my futher searches i came across this thread ffmpeg convert mov file to mp4 for HTML5 video tag IE9. Here following argument worked perfectly and it able to convert video in such way that it is playble on browser.
ffmpeg -y -i input.avi -vcodec libx264 -vprofile high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=-1:480 -threads 0 -acodec libvo_aacenc -b:a 128k -pix_fmt yuv420p output.mp4
.
Problem i faced here was video is converted to 420p reso which quality is noty upto mark. Smaller resolution videos are been enlarged and seems pixelated
Thus, i had to finally put up a question. I will be very obliged if someone can give a solution for above problem. I need to convert an avi video to mp4 supported by HTML5 video tag. It should able to play it on browser and during conversion of video it should maintain original audio and video quality plus resolution.
Thanks
My C# Code :
public void Create(string input, string output, string parametri, string ThumbnailPhysicalPath, int ConvertType)
{
ffmpeg = new Process();
if (ConvertType == Convert.ToInt32(ConversionType.Thumbnail))
ffmpeg.StartInfo.Arguments = " -i \"" + input + "\" -vframes 1 \"" + output + "\"";
else if (ConvertType == Convert.ToInt32(ConversionType.AviToMp4))
ffmpeg.StartInfo.Arguments = " -i \"" + input + "\" -c:v libx264 -b:a 128k -vcodec mpeg4 -b:v 1200k -flags +aic+mv4 \"" + output + "\"";
//ffmpeg.StartInfo.Arguments = " -i \"" + input + "\" -vcodec libx264 -vprofile high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=-1:480 -threads 0 -acodec libvo_aacenc -b:a 128k -pix_fmt yuv420p \"" + output + "\"";
ffmpeg.StartInfo.FileName = ThumbnailPhysicalPath + @"ffmpeg.exe";
ffmpeg.StartInfo.UseShellExecute = false;
ffmpeg.StartInfo.RedirectStandardOutput = true;
ffmpeg.StartInfo.RedirectStandardError = true;
ffmpeg.StartInfo.CreateNoWindow = true;
try
{
ffmpeg.Start();
ffmpeg.WaitForExit();
string error = ffmpeg.StandardError.ReadToEnd();
}
catch (Exception Ex)
{
Common.WriteLog("Exception occurred during conversion. Error Message :- " + Ex.Message + "\n Input Parameter :- " + input+ "\n Output Paramenter :- "+ output);
}
finally
{
ffmpeg.Close();
if (ConvertType == Convert.ToInt32(ConversionType.AviToMp4))
UpdateConvertedVideoDetails(input,output);
}
}Command Prompt FFMPEG Output :-
Sample 3 Result :-
D:\Client\WebSite\Converter_Tools>ffmpeg -y -i sample.avi -b:v 1500k -vcodec libx264 -vpre slow -vpre baseline -g 30 sample.mp4
ffmpeg version N-70239-g111d79a Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libblu
ray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --
enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enab
le-zlib
libavutil 54. 19.100 / 54. 19.100
libavcodec 56. 26.100 / 56. 26.100
libavformat 56. 23.105 / 56. 23.105
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.101 / 5. 11.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
[avi @ 037c8480] non-interleaved AVI
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, avi, from 'sample.avi':
Duration: 00:00:34.00, start: 0.000000, bitrate: 1433 kb/s
Stream #0:0: Video: cinepak (cvid / 0x64697663), rgb24, 320x240, 15 fps, 15 tbr, 15 tbn, 15 tbc
Stream #0:1: Audio: pcm_u8 ([1][0][0][0] / 0x0001), 22050 Hz, 1 channels, u8, 176 kb/s
File for preset 'slow' not foundSample 4 Result :-
D:\Client\WebSite\Converter_Tools>ffmpeg -y -i input.avi -vcodec libx264 -vprofile high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=-1:480 -threads 0 -acodec libvo_
aacenc -b:a 128k -pix_fmt yuv420p output.mp4
ffmpeg version N-70239-g111d79a Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libblu
ray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --
enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enab
le-zlib
libavutil 54. 19.100 / 54. 19.100
libavcodec 56. 26.100 / 56. 26.100
libavformat 56. 23.105 / 56. 23.105
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.101 / 5. 11.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, avi, from 'input.avi':
Duration: 00:00:03.93, start: 0.000000, bitrate: 3255 kb/s
Stream #0:0: Video: msrle ([1][0][0][0] / 0x0001), pal8, 300x250, 3301 kb/s, 15 fps, 15 tbr, 15 tbn, 15 tbc
[libx264 @ 002ec860] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 002ec860] profile High, level 2.2
[libx264 @ 002ec860] 264 - core 144 r2525 40bb568 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=umh subm
e=8 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 i
nterlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=15 scenecut=40 intra_refresh=0 rc_lookahead=50 rc
=cbr mbtree=1 bitrate=500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=500 vbv_bufsize=1000 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
Metadata:
encoder : Lavf56.23.105
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 576x480, q=-1--1, 500 kb/s, 15 fps, 15360 tbn, 15 tbc
Metadata:
encoder : Lavc56.26.100 libx264
Stream mapping:
Stream #0:0 -> #0:0 (msrle (native) -> h264 (libx264))
Press [q] to stop, [?] for help
frame= 59 fps= 30 q=-1.0 Lsize= 229kB time=00:00:03.80 bitrate= 493.5kbits/s
video:227kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.637976%
[libx264 @ 002ec860] frame I:3 Avg QP:26.53 size: 10657
[libx264 @ 002ec860] frame P:25 Avg QP:30.49 size: 5608
[libx264 @ 002ec860] frame B:31 Avg QP:32.26 size: 1935
[libx264 @ 002ec860] consecutive B-frames: 22.0% 16.9% 20.3% 40.7%
[libx264 @ 002ec860] mb I I16..4: 16.7% 69.0% 14.4%
[libx264 @ 002ec860] mb P I16..4: 11.1% 29.9% 3.8% P16..4: 21.3% 6.8% 2.6% 0.0% 0.0% skip:24.6%
[libx264 @ 002ec860] mb B I16..4: 1.7% 3.0% 0.3% B16..8: 29.7% 5.6% 0.8% direct: 2.1% skip:56.8% L0:50.5% L1:45.6% BI: 3.9%
[libx264 @ 002ec860] 8x8 transform intra:66.5% inter:79.4%
[libx264 @ 002ec860] direct mvs spatial:93.5% temporal:6.5%
[libx264 @ 002ec860] coded y,uvDC,uvAC intra: 40.3% 48.8% 25.7% inter: 12.4% 8.4% 1.4%
[libx264 @ 002ec860] i16 v,h,dc,p: 19% 59% 6% 17%
[libx264 @ 002ec860] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 25% 16% 7% 8% 6% 11% 7% 10%
[libx264 @ 002ec860] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 21% 9% 7% 9% 8% 10% 7% 10%
[libx264 @ 002ec860] i8c dc,h,v,p: 41% 33% 13% 13%
[libx264 @ 002ec860] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 002ec860] ref P L0: 67.6% 8.1% 9.6% 5.4% 6.6% 2.8%
[libx264 @ 002ec860] ref B L0: 84.6% 10.5% 3.9% 1.0%
[libx264 @ 002ec860] ref B L1: 95.9% 4.1%
[libx264 @ 002ec860] kb/s:472.20 -
-
ffmpeg mp4 x264 encoding -> playback causes "pending" in both Chrome and IE causing 10+ seconds delay
26 novembre 2015, par user1978645After encoding a video to mp4(x264 with aac) ; I have the following weird behaviour in both crome and IE :
Im serving the content from https with spdy enables.
It takes up to 30 seconds before the video is actually played, in the mean time i cannot reload the page it shows up as "pending". (even after i have visual on the video sometimes it takes 10-20 seconds before i can actually reload the page, or navigate to another url on the same domain)
After looking at the "network" tab in developer tools, i see the following requests for 1 page/video :
Path Method Status Type Initiator Size/content Time/latency
video.mp4 GET 206 OK video/mp4 other 32.3KB/32.0kb 600ms/339MS
video.mp4 GET 206 OK video/mp4 other 123kb/123b 21.85s/21.46s
video.mp4 GET 206 OK video/mp4 other 7.1MB/7.2MB 1.4min/2msI tried to isolate the problem, When i use an mp4 video from the internet (for example the demo video of jplayer) and load it from my server, it loads rapidly, without delays.
So it makes me think the problem lies within the encoding. I tried various things.
FFmpeg :-
csr 69 (low quality)
-
various options
HTML :
-
preload="none"
-
javascript loading/playing of the movie
-
type=’mp4/video’
-
no posterimage
But i cannot resolve the problem. Does anyone have a clue what is causing this ?
I have a download speed of 300kb/s and the movie is 6MB.
After the video starts, the video isn’t fully buffered, so i wonder : What is the html5 videoplayer doing all this time ?
The problem also blocks the connections. When i press "F5" in both chrome and IE the page beeing reloaded comes up in the network tab as "pending" and it can take 10 to 20 seconds before the page actually reloads.
ffmpeg command : (i used various commands but this is just 1 example which causes the problem)
/root/bin/ffmpeg -threads 1 -y -i /home/flirtzo/public_html//userfiles/files/94e76a18a7838e62ecb23cf0c374b1b798e7b936 -threads 0 -codec:a libfdk_aac -b:a 128k -vf "scale=-2:320" -preset veryslow -vcodec h264 -acodec aac -strict -2 /home/flirtzo/public_html/userfiles/files/b2/72/695f4eba95169a3f29564bf9571c703b05f1b5974f5156da633eb139c80a1575452e2858dfc61cc82bfca02d2b156aa64d4503695756481dc2a5d1c673a4cdea-94e76a18a7838e62ecb23cf0c374b1b798e7b936.mp4
Output :
ffmpeg version git-2014-04-16-c150e2c Copyright (c) 2000-2014 the FFmpeg developers
built on Sep 28 2014 21:08:17 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-4)
configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra- ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --extra-libs=-ldl --enable-gpl --enable-nonfree - -enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable- libx264
libavutil 52. 76.100 / 52. 76.100
libavcodec 55. 58.103 / 55. 58.103
libavformat 55. 37.100 / 55. 37.100
libavdevice 55. 13.100 / 55. 13.100
libavfilter 4. 4.100 / 4. 4.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, mpeg, from '/home/flirtzo/public_html//userfiles/files/94e76a18a7838e62ecb23cf0c374b1b798e7b936':
Duration: 00:00:25.97, start: 0.340078, bitrate: 29004 kb/s
Stream #0:0[0x1e0]: Video: mpeg1video, yuv420p(tv), 352x240 [SAR 200:219 DAR 880:657], 1150 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 29.97 tbc
Stream #0:1[0x1c0]: Audio: mp2, 44100 Hz, stereo, s16p, 224 kb/s
[libx264 @ 0x2b189c0] using SAR=1199/1314
[libx264 @ 0x2b189c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x2b189c0] profile High, level 1.3
[libx264 @ 0x2b189c0] 264 - core 142 r2 d6b4e63 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=2 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=4 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 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=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=20 rc=crf mbtree=1 crf=51.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/home/flirtzo/public_html/userfiles/files/b2/72/695f4eba95169a3f29564bf9571c703b05f1b5974f5156da633e b139c80a1575452e2858dfc61cc82bfca02d2b156aa64d4503695756481dc2a5d1c673a4cdea- 94e76a18a7838e62ecb23cf0c374b1b798e7b936.mp4':
Metadata:
encoder : Lavf55.37.100
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 320x218 [SAR 1199:1314 DAR 880:657], q=-1--1, 30k tbn, 29.97 tbc
Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp, 128 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mpeg1video -> libx264)
Stream #0:1 -> #0:1 (mp2 -> aac)
Press [q] to stop, [?] for help
frame=16127 fps=786 q=-1.0 Lsize= 10559kB time=00:08:58.12 bitrate= 160.7kbits/s dup=12 drop=0
video:1586kB audio:8410kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 5.638589%
[libx264 @ 0x2b189c0] frame I:109 Avg QP:50.58 size: 494
[libx264 @ 0x2b189c0] frame P:9537 Avg QP:51.00 size: 138
[libx264 @ 0x2b189c0] frame B:6481 Avg QP:51.00 size: 40
[libx264 @ 0x2b189c0] consecutive B-frames: 21.8% 72.1% 5.4% 0.7%
[libx264 @ 0x2b189c0] mb I I16..4: 46.1% 53.9% 0.0%
[libx264 @ 0x2b189c0] mb P I16..4: 6.0% 6.1% 0.0% P16..4: 12.7% 1.1% 0.1% 0.0% 0.0% skip:74.1%
[libx264 @ 0x2b189c0] mb B I16..4: 0.1% 0.1% 0.0% B16..8: 6.3% 0.0% 0.0% direct: 0.7% skip:92.9% L0:38.6% L1:61.2% BI: 0.2%
[libx264 @ 0x2b189c0] 8x8 transform intra:50.8% inter:85.6%
[libx264 @ 0x2b189c0] coded y,uvDC,uvAC intra: 5.9% 39.5% 0.1% inter: 0.1% 1.0% 0.0%
[libx264 @ 0x2b189c0] i16 v,h,dc,p: 56% 30% 7% 7%
[libx264 @ 0x2b189c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 11% 62% 3% 3% 3% 3% 2% 2%
[libx264 @ 0x2b189c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 5% 73% 2% 0% 0% 0% 0% 2%
[libx264 @ 0x2b189c0] i8c dc,h,v,p: 97% 1% 2% 0%
[libx264 @ 0x2b189c0] Weighted P-Frames: Y:5.5% UV:2.7%
[libx264 @ 0x2b189c0] ref P L0: 64.8% 35.2%
[libx264 @ 0x2b189c0] ref B L0: 75.2% 24.8%
[libx264 @ 0x2b189c0] ref B L1: 99.3% 0.7%
[libx264 @ 0x2b189c0] kb/s:24.13
ffmpeg version git-2014-04-16-c150e2c Copyright (c) 2000-2014 the FFmpeg developers
built on Sep 28 2014 21:08:17 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-4)
configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra- ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --extra-libs=-ldl --enable-gpl --enable-nonfree - -enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable- libx264
libavutil 52. 76.100 / 52. 76.100
libavcodec 55. 58.103 / 55. 58.103
libavformat 55. 37.100 / 55. 37.100
libavdevice 55. 13.100 / 55. 13.100
libavfilter 4. 4.100 / 4. 4.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, mpeg, from '/home/flirtzo/public_html//userfiles/files/94e76a18a7838e62ecb23cf0c374b1b798e7b936':
Duration: 00:00:25.97, start: 0.340078, bitrate: 29004 kb/s
Stream #0:0[0x1e0]: Video: mpeg1video, yuv420p(tv), 352x240 [SAR 200:219 DAR 880:657], 1150 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 29.97 tbc
Stream #0:1[0x1c0]: Audio: mp2, 44100 Hz, stereo, s16p, 224 kb/s
[libx264 @ 0x300d9c0] using SAR=200/219
[libx264 @ 0x300d9c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x300d9c0] profile High, level 2.2
[libx264 @ 0x300d9c0] 264 - core 142 r2 d6b4e63 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=16 deblock=1:0:0 analyse=0x3:0x133 me=umh subme=10 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=24 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=8 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=60 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 '/home/flirtzo/public_html/userfiles/files/b2/72/73d4a3245c0b0e174ab7ce0f872ba3f649f8b93f73a6deeab364 4a994009d73638ce61aecc7dc2e0250c4e74ff2d9a4d479ed35cef26b3f6e1a77e8bf5938518- 94e76a18a7838e62ecb23cf0c374b1b798e7b936.mp4':
Metadata:
encoder : Lavf55.37.100
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 352x240 [SAR 200:219 DAR 880:657], q=-1--1, 30k tbn, 29.97 tbc
Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp, 128 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mpeg1video -> libx264)
Stream #0:1 -> #0:1 (mp2 -> aac)
Press [q] to stop, [?] for help
frame=16127 fps= 88 q=-1.0 Lsize= 29190kB time=00:08:58.12 bitrate= 444.4kbits/s dup=12 drop=0
video:20221kB audio:8410kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.954086%
[libx264 @ 0x300d9c0] frame I:73 Avg QP:24.31 size: 8024
[libx264 @ 0x300d9c0] frame P:4399 Avg QP:26.97 size: 2600
[libx264 @ 0x300d9c0] frame B:11655 Avg QP:32.51 size: 745
[libx264 @ 0x300d9c0] consecutive B-frames: 3.8% 5.0% 27.2% 18.4% 8.4% 33.9% 1.7% 0.7% 0.9%
[libx264 @ 0x300d9c0] mb I I16..4: 10.8% 68.5% 20.7%
[libx264 @ 0x300d9c0] mb P I16..4: 2.9% 7.5% 0.8% P16..4: 45.1% 18.4% 12.4% 0.5% 0.1% skip:12.3%
[libx264 @ 0x300d9c0] mb B I16..4: 0.6% 1.3% 0.1% B16..8: 40.1% 8.7% 1.7% direct: 2.1% skip:45.5% L0:47.2% L1:41.7% BI:11.1%
[libx264 @ 0x300d9c0] 8x8 transform intra:66.7% inter:76.7%
[libx264 @ 0x300d9c0] direct mvs spatial:99.9% temporal:0.1%
[libx264 @ 0x300d9c0] coded y,uvDC,uvAC intra: 60.3% 75.8% 16.4% inter: 17.3% 16.8% 0.6%
[libx264 @ 0x300d9c0] i16 v,h,dc,p: 16% 27% 11% 47%
[libx264 @ 0x300d9c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 13% 18% 6% 9% 9% 11% 9% 11%
[libx264 @ 0x300d9c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 15% 7% 7% 14% 14% 13% 8% 10%
[libx264 @ 0x300d9c0] i8c dc,h,v,p: 26% 32% 20% 22%
[libx264 @ 0x300d9c0] Weighted P-Frames: Y:10.1% UV:6.9%
[libx264 @ 0x300d9c0] ref P L0: 40.6% 12.1% 10.0% 5.2% 5.2% 4.7% 4.6% 3.0% 2.5% 2.1% 1.9% 1.8% 1.7% 1.7% 1.6% 1.3%
[libx264 @ 0x300d9c0] ref B L0: 71.4% 5.6% 3.2% 3.0% 3.1% 2.8% 2.5% 1.8% 1.3% 1.0% 1.1% 1.2% 1.0% 0.7% 0.5%
[libx264 @ 0x300d9c0] ref B L1: 96.3% 3.7%
[libx264 @ 0x300d9c0] kb/s:307.82 -
-
FFMPEG android is processing slow
23 novembre 2015, par jpcI’m using https://github.com/WritingMinds/ffmpeg-android-java as my framework for FFMPEG
I’m trying to convert an image to a video using this command
ffmpeg -y -loop 1 -i input.jpg -strict -2 -vcodec mpeg4 -t 5 -pix_fmt yuv420p out.mp4
It took about 32 seconds to finish the process which is very slow for my requirements.
Is there a way to speed this up ? I’m thinking of something around 5 seconds, perhaps approximately equal to the specified length of the video
here’s the log btw
11-23 12:12:13.587 4228-4228/com.lo.and.dev W/com.lo.and.util: WARNING: linker: /data/data/com.lo.and.dev/files/ffmpeg has text relocations. This is wasting memory and prevents security hardening. Please fix.
11-23 12:12:13.607 4228-4228/com.lo.and.dev W/com.lo.and.util: ffmpeg version n2.4.2 Copyright (c) 2000-2014 the FFmpeg developers
11-23 12:12:13.607 4228-4228/com.lo.and.dev W/com.lo.and.util: built on Oct 7 2014 15:08:46 with gcc 4.8 (GCC)
11-23 12:12:13.607 4228-4228/com.lo.and.dev W/com.lo.and.util: configuration: --target-os=linux --cross-prefix=/home/sb/Source-Code/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/sb/Source-Code/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --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/sb/Source-Code/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/sb/Source-Code/ffmpeg-android/build/armeabi-v7a-neon --extra-cflags='-I/home/sb/Source-Code/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all -mfpu=neon' --extra-ldflags='-L/home/sb/Source-Code/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
11-23 12:12:13.607 4228-4228/com.lo.and.dev W/com.lo.and.util: libavutil 54. 7.100 / 54. 7.100
11-23 12:12:13.607 4228-4228/com.lo.and.dev W/com.lo.and.util: libavcodec 56. 1.100 / 56. 1.100
11-23 12:12:13.607 4228-4228/com.lo.and.dev W/com.lo.and.util: libavformat 56. 4.101 / 56. 4.101
11-23 12:12:13.607 4228-4228/com.lo.and.dev W/com.lo.and.util: libavdevice 56. 0.100 / 56. 0.100
11-23 12:12:13.607 4228-4228/com.lo.and.dev W/com.lo.and.util: libavfilter 5. 1.100 / 5. 1.100
11-23 12:12:13.617 4228-4228/com.lo.and.dev W/com.lo.and.util: libswscale 3. 0.100 / 3. 0.100
11-23 12:12:13.617 4228-4228/com.lo.and.dev W/com.lo.and.util: libswresample 1. 1.100 / 1. 1.100
11-23 12:12:13.617 4228-4228/com.lo.and.dev W/com.lo.and.util: libpostproc 53. 0.100 / 53. 0.100
11-23 12:12:13.707 4228-4228/com.lo.and.dev W/com.lo.and.util: Input #0, image2, from '/storage/emulated/0/DCIM/Camera/20151122_172809.jpg':
11-23 12:12:13.707 4228-4228/com.lo.and.dev W/com.lo.and.util: Duration: 00:00:00.04, start: 0.000000, bitrate: 95165 kb/s
11-23 12:12:13.717 4228-4228/com.lo.and.dev W/com.lo.and.util: Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
11-23 12:12:13.727 4228-4228/com.lo.and.dev W/com.lo.and.util: [swscaler @ 0xb5d89000] deprecated pixel format used, make sure you did set range correctly
11-23 12:12:13.777 4228-4228/com.lo.and.dev W/com.lo.and.util: Output #0, mp4, to '/storage/emulated/0/DCIM/out.mp4':
11-23 12:12:13.777 4228-4228/com.lo.and.dev W/com.lo.and.util: Metadata:
11-23 12:12:13.777 4228-4228/com.lo.and.dev W/com.lo.and.util: encoder : Lavf56.4.101
11-23 12:12:13.777 4228-4228/com.lo.and.dev W/com.lo.and.util: Stream #0:0: Video: mpeg4 ( [0][0][0] / 0x0020), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 12800 tbn, 25 tbc
11-23 12:12:13.777 4228-4228/com.lo.and.dev W/com.lo.and.util: Metadata:
11-23 12:12:13.777 4228-4228/com.lo.and.dev W/com.lo.and.util: encoder : Lavc56.1.100 mpeg4
11-23 12:12:13.777 4228-4228/com.lo.and.dev W/com.lo.and.util: Stream mapping:
11-23 12:12:13.777 4228-4228/com.lo.and.dev W/com.lo.and.util: Stream #0:0 -> #0:0 (mjpeg (native) -> mpeg4 (native))
11-23 12:12:13.777 4228-4228/com.lo.and.dev W/com.lo.and.util: Press [q] to stop, [?] for help
11-23 12:12:14.707 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 3 fps=0.0 q=2.0 size= 343kB time=00:00:00.12 bitrate=23400.5kbits/s
11-23 12:12:15.247 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 5 fps=4.2 q=4.9 size= 345kB time=00:00:00.20 bitrate=14125.9kbits/s
11-23 12:12:15.737 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 7 fps=4.0 q=10.2 size= 347kB time=00:00:00.28 bitrate=10149.8kbits/s
11-23 12:12:16.467 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 10 fps=4.1 q=18.9 size= 350kB time=00:00:00.40 bitrate=7167.7kbits/s
11-23 12:12:17.037 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 12 fps=4.0 q=24.8 size= 352kB time=00:00:00.48 bitrate=6007.9kbits/s
11-23 12:12:17.567 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 14 fps=3.9 q=27.8 size= 403kB time=00:00:00.56 bitrate=5893.7kbits/s
11-23 12:12:18.337 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 17 fps=4.0 q=31.0 size= 406kB time=00:00:00.68 bitrate=4891.5kbits/s
11-23 12:12:18.847 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 19 fps=3.9 q=31.0 size= 408kB time=00:00:00.76 bitrate=4398.6kbits/s
11-23 12:12:19.607 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 22 fps=3.9 q=31.0 size= 411kB time=00:00:00.88 bitrate=3827.4kbits/s
11-23 12:12:20.107 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 24 fps=3.9 q=31.0 size= 413kB time=00:00:00.96 bitrate=3525.9kbits/s
11-23 12:12:20.637 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 26 fps=3.9 q=31.0 size= 460kB time=00:00:01.04 bitrate=3624.3kbits/s
11-23 12:12:21.157 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 28 fps=3.9 q=31.0 size= 462kB time=00:00:01.12 bitrate=3381.1kbits/s
11-23 12:12:21.667 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 30 fps=3.9 q=31.0 size= 464kB time=00:00:01.20 bitrate=3169.7kbits/s
11-23 12:12:22.167 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 32 fps=3.9 q=31.0 size= 466kB time=00:00:01.28 bitrate=2984.6kbits/s
11-23 12:12:22.897 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 35 fps=3.9 q=31.0 size= 469kB time=00:00:01.40 bitrate=2746.8kbits/s
11-23 12:12:23.657 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 38 fps=3.9 q=31.0 size= 517kB time=00:00:01.52 bitrate=2788.3kbits/s
11-23 12:12:24.387 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 41 fps=4.0 q=31.0 size= 521kB time=00:00:01.64 bitrate=2600.1kbits/s
11-23 12:12:24.887 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 43 fps=3.9 q=31.0 size= 523kB time=00:00:01.72 bitrate=2488.9kbits/s
11-23 12:12:25.417 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 45 fps=3.9 q=31.0 size= 525kB time=00:00:01.80 bitrate=2387.6kbits/s
11-23 12:12:25.967 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 47 fps=3.9 q=31.0 size= 527kB time=00:00:01.88 bitrate=2294.9kbits/s
11-23 12:12:26.477 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 49 fps=3.9 q=24.8 size= 572kB time=00:00:01.96 bitrate=2390.0kbits/s
11-23 12:12:27.297 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 52 fps=3.9 q=31.0 size= 577kB time=00:00:02.08 bitrate=2271.5kbits/s
11-23 12:12:27.987 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 55 fps=3.9 q=31.0 size= 580kB time=00:00:02.20 bitrate=2159.1kbits/s
11-23 12:12:28.737 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 58 fps=3.9 q=31.0 size= 583kB time=00:00:02.32 bitrate=2058.2kbits/s
11-23 12:12:29.247 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 60 fps=3.9 q=31.0 size= 585kB time=00:00:02.40 bitrate=1996.6kbits/s
11-23 12:12:30.017 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 63 fps=3.9 q=31.0 size= 633kB time=00:00:02.52 bitrate=2057.7kbits/s
11-23 12:12:30.557 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 65 fps=3.9 q=31.0 size= 635kB time=00:00:02.60 bitrate=2000.8kbits/s
11-23 12:12:31.057 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 67 fps=3.9 q=31.0 size= 637kB time=00:00:02.68 bitrate=1947.4kbits/s
11-23 12:12:31.627 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 69 fps=3.9 q=31.0 size= 639kB time=00:00:02.76 bitrate=1897.0kbits/s
11-23 12:12:32.167 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 71 fps=3.9 q=31.0 size= 641kB time=00:00:02.84 bitrate=1849.5kbits/s
11-23 12:12:32.927 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 74 fps=3.9 q=31.0 size= 689kB time=00:00:02.96 bitrate=1907.2kbits/s
11-23 12:12:33.407 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 76 fps=3.9 q=31.0 size= 691kB time=00:00:03.04 bitrate=1862.8kbits/s
11-23 12:12:34.157 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 79 fps=3.9 q=31.0 size= 694kB time=00:00:03.16 bitrate=1800.0kbits/s
11-23 12:12:34.657 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 81 fps=3.9 q=31.0 size= 696kB time=00:00:03.24 bitrate=1760.7kbits/s
11-23 12:12:35.217 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 83 fps=3.9 q=31.0 size= 698kB time=00:00:03.32 bitrate=1723.3kbits/s
11-23 12:12:35.777 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 85 fps=3.9 q=24.8 size= 744kB time=00:00:03.40 bitrate=1791.6kbits/s
11-23 12:12:36.297 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 87 fps=3.9 q=31.0 size= 747kB time=00:00:03.48 bitrate=1759.6kbits/s
11-23 12:12:36.827 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 89 fps=3.9 q=31.0 size= 750kB time=00:00:03.56 bitrate=1724.8kbits/s
11-23 12:12:37.547 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 92 fps=3.9 q=31.0 size= 753kB time=00:00:03.68 bitrate=1675.4kbits/s
11-23 12:12:38.297 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 95 fps=3.9 q=31.0 size= 756kB time=00:00:03.80 bitrate=1629.1kbits/s
11-23 12:12:38.797 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 97 fps=3.9 q=24.8 size= 801kB time=00:00:03.88 bitrate=1690.8kbits/s
11-23 12:12:39.547 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 100 fps=3.9 q=31.0 size= 806kB time=00:00:04.00 bitrate=1650.2kbits/s
11-23 12:12:40.047 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 102 fps=3.9 q=31.0 size= 808kB time=00:00:04.08 bitrate=1621.9kbits/s
11-23 12:12:40.807 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 105 fps=3.9 q=31.0 size= 811kB time=00:00:04.20 bitrate=1581.6kbits/s
11-23 12:12:41.267 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 107 fps=3.9 q=31.0 size= 813kB time=00:00:04.28 bitrate=1555.9kbits/s
11-23 12:12:42.057 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 110 fps=3.9 q=31.0 size= 861kB time=00:00:04.40 bitrate=1602.8kbits/s
11-23 12:12:42.557 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 112 fps=3.9 q=31.0 size= 863kB time=00:00:04.48 bitrate=1578.1kbits/s
11-23 12:12:43.307 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 115 fps=3.9 q=31.0 size= 866kB time=00:00:04.60 bitrate=1542.4kbits/s
11-23 12:12:43.817 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 117 fps=3.9 q=31.0 size= 868kB time=00:00:04.68 bitrate=1519.6kbits/s
11-23 12:12:44.517 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 120 fps=3.9 q=31.0 size= 871kB time=00:00:04.80 bitrate=1486.8kbits/s
11-23 12:12:45.277 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 123 fps=3.9 q=31.0 size= 919kB time=00:00:04.92 bitrate=1530.6kbits/s
11-23 12:12:45.987 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 125 fps=3.9 q=31.0 size= 921kB time=00:00:05.00 bitrate=1509.4kbits/s
11-23 12:12:45.987 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 125 fps=3.9 q=31.0 Lsize= 923kB time=00:00:05.00 bitrate=1511.6kbits/s
11-23 12:12:45.987 4228-4228/com.lo.and.dev W/com.lo.and.util: video:921kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.148301%