
Recherche avancée
Médias (91)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
-
Les Miserables
4 juin 2012, par
Mis à jour : Février 2013
Langue : English
Type : Texte
-
Ne pas afficher certaines informations : page d’accueil
23 novembre 2011, par
Mis à jour : Novembre 2011
Langue : français
Type : Image
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Richard Stallman et la révolution du logiciel libre - Une biographie autorisée (version epub)
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (97)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Mise à disposition des fichiers
14 avril 2011, parPar défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)
Sur d’autres sites (4812)
-
Video rotating to left by 90 degree when converted using ffmpeg
15 juillet 2017, par Herdesh VermaI developed a below code :
extern "C"
{
#include <libavutil></libavutil>imgutils.h>
#include <libavutil></libavutil>opt.h>
#include <libavcodec></libavcodec>avcodec.h>
#include <libavutil></libavutil>mathematics.h>
#include <libavutil></libavutil>samplefmt.h>
#include <libavutil></libavutil>timestamp.h>
#include <libavformat></libavformat>avformat.h>
#include <libavfilter></libavfilter>avfiltergraph.h>
#include <libswscale></libswscale>swscale.h>
}
#include
static AVFormatContext *fmt_ctx = NULL;
static int frame_index = 0;
static int j = 0, nbytes=0;
uint8_t *video_outbuf = NULL;
static AVPacket *pAVPacket=NULL;
static int value=0;
static AVFrame *pAVFrame=NULL;
static AVFrame *outFrame=NULL;
static AVStream *video_st=NULL;
static AVFormatContext *outAVFormatContext=NULL;
static AVCodec *outAVCodec=NULL;
static AVOutputFormat *output_format=NULL;
static AVCodecContext *video_dec_ctx = NULL, *audio_dec_ctx;
static AVCodecContext *outAVCodecContext=NULL;
static int width, height;
static enum AVPixelFormat pix_fmt;
static AVStream *video_stream = NULL, *audio_stream = NULL;
static const char *src_filename = NULL;
static const char *video_dst_filename = NULL;
static const char *audio_dst_filename = NULL;
static FILE *video_dst_file = NULL;
static FILE *audio_dst_file = NULL;
static uint8_t *video_dst_data[4] = {NULL};
static int video_dst_linesize[4];
static int video_dst_bufsize;
static int video_stream_idx = -1, audio_stream_idx = -1;
static AVPacket *pkt=NULL;
static AVPacket *pkt1=NULL;
static AVFrame *frame = NULL;
//static AVPacket pkt;
static int video_frame_count = 0;
static int audio_frame_count = 0;
static int refcount = 0;
AVCodec *codec;
static struct SwsContext *sws_ctx;
AVCodecContext *c= NULL;
int i, out_size, size, x, y, outbuf_size;
AVFrame *picture;
uint8_t *outbuf, *picture_buf;
int video_outbuf_size;
int w, h;
AVPixelFormat pixFmt;
uint8_t *data[4];
int linesize[4];
static int open_codec_context(int *stream_idx,
AVCodecContext **dec_ctx, AVFormatContext
*fmt_ctx, enum AVMediaType type)
{
int ret, stream_index;
AVStream *st;
AVCodec *dec = NULL;
AVDictionary *opts = NULL;
ret = av_find_best_stream(fmt_ctx, type, -1, -1, NULL, 0);
if (ret < 0) {
printf("Could not find %s stream in input file '%s'\n",
av_get_media_type_string(type), src_filename);
return ret;
} else {
stream_index = ret;
st = fmt_ctx->streams[stream_index];
/* find decoder for the stream */
dec = avcodec_find_decoder(st->codecpar->codec_id);
if (!dec) {
printf("Failed to find %s codec\n",
av_get_media_type_string(type));
return AVERROR(EINVAL);
}
/* Allocate a codec context for the decoder */
*dec_ctx = avcodec_alloc_context3(dec);
if (!*dec_ctx) {
printf("Failed to allocate the %s codec context\n",
av_get_media_type_string(type));
return AVERROR(ENOMEM);
}
/* Copy codec parameters from input stream to output codec context */
if ((ret = avcodec_parameters_to_context(*dec_ctx, st->codecpar)) < 0) {
printf("Failed to copy %s codec parameters to decoder context\n",
av_get_media_type_string(type));
return ret;
}
/* Init the decoders, with or without reference counting */
av_dict_set(&opts, "refcounted_frames", refcount ? "1" : "0", 0);
if ((ret = avcodec_open2(*dec_ctx, dec, &opts)) < 0) {
printf("Failed to open %s codec\n",
av_get_media_type_string(type));
return ret;
}
*stream_idx = stream_index;
}
return 0;
}
int main (int argc, char **argv)
{
int ret = 0, got_frame;
src_filename = argv[1];
video_dst_filename = argv[2];
audio_dst_filename = argv[3];
av_register_all();
avcodec_register_all();
printf("Registered all\n");
/* open input file, and allocate format context */
if (avformat_open_input(&fmt_ctx, src_filename, NULL, NULL) < 0) {
printf("Could not open source file %s\n", src_filename);
exit(1);
}
/* retrieve stream information */
if (avformat_find_stream_info(fmt_ctx, NULL) < 0) {
printf("Could not find stream information\n");
exit(1);
}
if (open_codec_context(&video_stream_idx, &video_dec_ctx, fmt_ctx,
AVMEDIA_TYPE_VIDEO) >= 0) {
video_stream = fmt_ctx->streams[video_stream_idx];
avformat_alloc_output_context2(&outAVFormatContext, NULL, NULL,
video_dst_filename);
if (!outAVFormatContext)
{
printf("\n\nError : avformat_alloc_output_context2()");
return -1;
}
}
if (open_codec_context(&audio_stream_idx, &audio_dec_ctx, fmt_ctx,
AVMEDIA_TYPE_AUDIO) >= 0) {
audio_stream = fmt_ctx->streams[audio_stream_idx];
audio_dst_file = fopen(audio_dst_filename, "wb");
if (!audio_dst_file) {
printf("Could not open destination file %s\n", audio_dst_filename);
ret = 1;
goto end;
}
}
/* dump input information to stderr */
av_dump_format(fmt_ctx, 0, src_filename, 0);
if (!audio_stream && !video_stream) {
printf("Could not find audio or video stream in the input, aborting\n");
ret = 1;
goto end;
}
output_format = av_guess_format(NULL, video_dst_filename, NULL);
if( !output_format )
{
printf("\n\nError : av_guess_format()");
return -1;
}
video_st = avformat_new_stream(outAVFormatContext ,NULL);
if( !video_st )
{
printf("\n\nError : avformat_new_stream()");
return -1;
}
outAVCodecContext = avcodec_alloc_context3(outAVCodec);
if( !outAVCodecContext )
{
printf("\n\nError : avcodec_alloc_context3()");
return -1;
}
outAVCodecContext = video_st->codec;
outAVCodecContext->codec_id = AV_CODEC_ID_MPEG4;// AV_CODEC_ID_MPEG4; //
AV_CODEC_ID_H264 // AV_CODEC_ID_MPEG1VIDEO
outAVCodecContext->codec_type = AVMEDIA_TYPE_VIDEO;
outAVCodecContext->pix_fmt = AV_PIX_FMT_YUV420P;
outAVCodecContext->bit_rate = 400000; // 2500000
outAVCodecContext->width = 1920;
//outAVCodecContext->width = 500;
outAVCodecContext->height = 1080;
//outAVCodecContext->height = 500;
outAVCodecContext->gop_size = 3;
outAVCodecContext->max_b_frames = 2;
outAVCodecContext->time_base.num = 1;
outAVCodecContext->time_base.den = 30; // 15fps
if (outAVCodecContext->codec_id == AV_CODEC_ID_H264)
{
av_opt_set(outAVCodecContext->priv_data, "preset", "slow", 0);
}
outAVCodec = avcodec_find_encoder(AV_CODEC_ID_MPEG4);
if( !outAVCodec )
{
printf("\n\nError : avcodec_find_encoder()");
return -1;
}
/* Some container formats (like MP4) require global headers to be
present
Mark the encoder so that it behaves accordingly. */
if ( outAVFormatContext->oformat->flags & AVFMT_GLOBALHEADER)
{
outAVCodecContext->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
}
value = avcodec_open2(outAVCodecContext, outAVCodec, NULL);
if( value < 0)
{
printf("\n\nError : avcodec_open2()");
return -1;
}
/* create empty video file */
if ( !(outAVFormatContext->flags & AVFMT_NOFILE) )
{
if( avio_open2(&outAVFormatContext->pb , video_dst_filename,
AVIO_FLAG_WRITE ,NULL, NULL) < 0 )
{
printf("\n\nError : avio_open2()");
}
}
if(!outAVFormatContext->nb_streams)
{
printf("\n\nError : Output file dose not contain any stream");
return -1;
}
/* imp: mp4 container or some advanced container file required header
information*/
value = avformat_write_header(outAVFormatContext , NULL);
if(value < 0)
{
printf("\n\nError : avformat_write_header()");
return -1;
}
printf("\n\nOutput file information :\n\n");
av_dump_format(outAVFormatContext , 0 ,video_dst_filename ,1);
int flag;
int frameFinished;
value = 0;
pAVPacket = (AVPacket *)av_malloc(sizeof(AVPacket));
av_init_packet(pAVPacket);
pAVFrame = av_frame_alloc();
if( !pAVFrame )
{
printf("\n\nError : av_frame_alloc()");
return -1;
}
outFrame = av_frame_alloc();//Allocate an AVFrame and set its fields to
default values.
if( !outFrame )
{
printf("\n\nError : av_frame_alloc()");
return -1;
}
nbytes = av_image_get_buffer_size(outAVCodecContext-
>pix_fmt,outAVCodecContext->width,outAVCodecContext->height,32);
video_outbuf = (uint8_t*)av_malloc(nbytes);
if( video_outbuf == NULL )
{
printf("\n\nError : av_malloc()");
}
value = av_image_fill_arrays( outFrame->data, outFrame->linesize,
video_outbuf , AV_PIX_FMT_YUV420P, outAVCodecContext-
>width,outAVCodecContext->height,1 ); // returns : the size in bytes
required for src
if(value < 0)
{
printf("\n\nError : av_image_fill_arrays()");
}
SwsContext* swsCtx_ ;
// Allocate and return swsContext.
// a pointer to an allocated context, or NULL in case of error
// Deprecated : Use sws_getCachedContext() instead.
swsCtx_ = sws_getContext(video_dec_ctx->width,
video_dec_ctx->height,
video_dec_ctx->pix_fmt,
video_dec_ctx->width,
video_dec_ctx->height,
video_dec_ctx->pix_fmt,
SWS_BICUBIC, NULL, NULL, NULL);
AVPacket outPacket;
int got_picture;
while( av_read_frame( fmt_ctx , pAVPacket ) >= 0 )
{
if(pAVPacket->stream_index == video_stream_idx)
{
value = avcodec_decode_video2(video_dec_ctx , pAVFrame ,
&frameFinished , pAVPacket );
if( value < 0)
{
printf("Error : avcodec_decode_video2()");
}
if(frameFinished)// Frame successfully decoded :)
{
sws_scale(swsCtx_, pAVFrame->data, pAVFrame-
>linesize,0, video_dec_ctx->height, outFrame->data,outFrame->linesize);
// sws_scale(swsCtx_, pAVFrame->data, pAVFrame-
>linesize,0, video_dec_ctx->height, outFrame->data,outFrame->linesize);
av_init_packet(&outPacket);
outPacket.data = NULL; // packet data will be
allocated by the encoder
outPacket.size = 0;
avcodec_encode_video2(outAVCodecContext ,
&outPacket ,outFrame , &got_picture);
if(got_picture)
{
if(outPacket.pts != AV_NOPTS_VALUE)
outPacket.pts =
av_rescale_q(outPacket.pts, video_st->codec->time_base, video_st-
>time_base);
if(outPacket.dts != AV_NOPTS_VALUE)
outPacket.dts =
av_rescale_q(outPacket.dts, video_st->codec->time_base, video_st-
>time_base);
printf("Write frame %3d (size= %2d)\n",
j++, outPacket.size/1000);
if(av_write_frame(outAVFormatContext ,
&outPacket) != 0)
{
printf("\n\nError :
av_write_frame()");
}
av_packet_unref(&outPacket);
} // got_picture
av_packet_unref(&outPacket);
} // frameFinished
}
}// End of while-loop
value = av_write_trailer(outAVFormatContext);
if( value < 0)
{
printf("\n\nError : av_write_trailer()");
}
//THIS WAS ADDED LATER
av_free(video_outbuf);
end:
avcodec_free_context(&video_dec_ctx);
avcodec_free_context(&audio_dec_ctx);
avformat_close_input(&fmt_ctx);
if (video_dst_file)
fclose(video_dst_file);
if (audio_dst_file)
fclose(audio_dst_file);
//av_frame_free(&frame);
av_free(video_dst_data[0]);
return ret < 0;
}Problem with above code is that it rotates a video to left by 90 degree.
Snapshot of video given as input to above program
Snapshot of output video. It is rotated by 90 degree to left.
I compiled program using below command :
g++ -D__STDC_CONSTANT_MACROS -Wall -g ScreenRecorder.cpp -I/home/harry/Documents/compressor/ffmpeg-3.3/ -I/root/android-ndk-r14b/platforms/android-21/arch-x86_64/usr/include/ -c -o ScreenRecorder.o -w
And linked it using below command :
g++ -Wall -g ScreenRecorder.o -I/home/harry/Documents/compressor/ffmpeg-3.3/ -I/root/android-ndk-r14b/platforms/android-21/arch-x86_64/usr/include/ -L/usr/lib64 -L/lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7/ -L/home/harry/Documents/compressor/ffmpeg-3.3/ffmpeg-build -L/root/android-ndk-r14b/platforms/android-21/arch-x86_64/usr/lib64 -o ScreenRecorder.exe -lavformat -lavcodec -lavutil -lavdevice -lavfilter -lswscale -lx264 -lswresample -lm -lpthread -ldl -lstdc++ -lc -lrt
Program is being run using below command :
./ScreenRecorder.exe vertical.MOV videoH.mp4 audioH.mp3
Note :
- Source video is taken from iphone and is of .mov format.
- Output video is being stored in .mp4 file.Can anyone please tell me why it is rotating video by 90 degree ?
One thing i noticed in dump is shown below :
Duration: 00:00:06.04, start: 0.000000, bitrate: 17087 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 17014 kb/s, 29.98 fps, 29.97 tbr, 600 tbn, 1200 tbc (default)
Metadata:
rotate : 90
creation_time : 2017-07-09T10:56:42.000000Z
handler_name : Core Media Data Handler
encoder : H.264
Side data:
displaymatrix: rotation of -90.00 degreesit says
displaymatrix: rotation of -90.00 degrees
. Is it responsible for rotating video by 90 degree ? -
Speeding up/slowing down video ffmpeg
4 avril 2021, par BahaaIddin Al SharqawiI want to change video speed using ffmpeg framework. I used this command for that :



ffmpeg -y -i /storage/extSdCard/Video/1.avi -filter_complex [0:v]fps=50.0, setpts=0.5*PTS[v];[0:a]atempo=2.0[a] -map [v] -map [a] -preset ultrafast /storage/emulated/0/VID-20170716-VidRotate1.mp4



How can I guess the duration of the resulting video after slowing down or speeding up video ?



This is my whole log in console :



ffmpeg -y -i /storage/extSdCard/Video/1.avi -filter_complex [0:v]fps=50.0, setpts=0.5*PTS[v];[0:a]atempo=2.0[a] -map [v] -map [a] -preset ultrafast /storage/emulated/0/VID-20170716-VidRotate1.mp4 
 07-16 15:07:15.112: ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
 07-16 15:07:15.112: built with gcc 4.8 (GCC)
 07-16 15:07:15.112: 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=
 07-16 15:07:15.122: libavutil 55. 17.103 / 55. 17.103
 07-16 15:07:15.122: libavcodec 57. 24.102 / 57. 24.102
 07-16 15:07:15.122: libavformat 57. 25.100 / 57. 25.100
 07-16 15:07:15.132: libavdevice 57. 0.101 / 57. 0.101
 07-16 15:07:15.132: libavfilter 6. 31.100 / 6. 31.100
 07-16 15:07:15.132: libswscale 4. 0.100 / 4. 0.100
 07-16 15:07:15.132: libswresample 2. 0.101 / 2. 0.101
 07-16 15:07:15.142: libpostproc 54. 0.100 / 54. 0.100
 07-16 15:07:15.232: Input #0, avi, from '/storage/extSdCard/Video/1.avi':
 07-16 15:07:15.232: Metadata:
 07-16 15:07:15.232: encoder : Lavf52.104.0
 07-16 15:07:15.232: Duration: 00:02:03.96, start: 0.000000, bitrate: 773 kb/s
 07-16 15:07:15.242: Stream #0:0: Video: mpeg4 (Simple Profile) (xvid / 0x64697678), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 632 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc
 07-16 15:07:15.242: Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, s16p, 128 kb/s
 07-16 15:07:15.262 750-781/? W/ActivityManager: mDVFSHelper.release()
 07-16 15:07:15.282: [libx264 @ 0xb5428800] using SAR=1/1
 07-16 15:07:15.312: [libx264 @ 0xb5428800] using cpu capabilities: none!
 07-16 15:07:15.422: [libx264 @ 0xb5428800] profile Constrained Baseline, level 3.1
 07-16 15:07:15.422: [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=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
 07-16 15:07:15.462: Output #0, mp4, to '/storage/emulated/0/VID-20170716-VidRotate1.mp4':
 07-16 15:07:15.462: Metadata:
 07-16 15:07:15.462: encoder : Lavf57.25.100
 07-16 15:07:15.462: Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 50 fps, 12800 tbn, 50 tbc (default)
 07-16 15:07:15.462: Metadata:
 07-16 15:07:15.462: encoder : Lavc57.24.102 libx264
 07-16 15:07:15.462: Side data:
 07-16 15:07:15.462: unknown side data type 10 (24 bytes)
 07-16 15:07:15.472: Stream #0:1: Audio: aac (LC) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp, 128 kb/s (default)
 07-16 15:07:15.472: Metadata:
 07-16 15:07:15.472: encoder : Lavc57.24.102 aac
 07-16 15:07:15.472: Stream mapping:
 07-16 15:07:15.472: Stream #0:0 (mpeg4) -> fps
 07-16 15:07:15.472: Stream #0:1 (mp3) -> atempo
 07-16 15:07:15.472: setpts -> Stream #0:0 (libx264)
 07-16 15:07:15.472: atempo -> Stream #0:1 (aac)
 07-16 15:07:15.472: Press [q] to stop, [?] for help
 07-16 15:07:15.532: Past duration 0.999992 too large
 07-16 15:07:15.972: frame= 24 fps=0.0 q=15.0 size= 62kB time=00:00:00.39 bitrate=1296.2kbits/s dup=0 drop=19 speed=0.781x 
 07-16 15:07:16.483: frame= 45 fps= 44 q=15.0 size= 63kB time=00:00:00.83 bitrate= 617.2kbits/s dup=0 drop=40 speed=0.827x 
 07-16 15:07:16.983: frame= 72 fps= 48 q=20.0 size= 104kB time=00:00:01.36 bitrate= 621.9kbits/s dup=0 drop=67 speed=0.906x 
 07-16 15:07:17.484: frame= 99 fps= 49 q=17.0 size= 171kB time=00:00:01.90 bitrate= 734.8kbits/s dup=0 drop=94 speed=0.942x 
 07-16 15:07:18.004: frame= 125 fps= 49 q=22.0 size= 208kB time=00:00:02.41 bitrate= 704.8kbits/s dup=0 drop=120 speed=0.953x 
 07-16 15:07:18.515: frame= 152 fps= 50 q=18.0 size= 334kB time=00:00:02.97 bitrate= 919.6kbits/s dup=0 drop=147 speed=0.979x 
 07-16 15:07:19.015: frame= 181 fps= 51 q=18.0 size= 407kB time=00:00:03.55 bitrate= 938.9kbits/s dup=0 drop=176 speed= 1x 
 07-16 15:07:19.516: frame= 209 fps= 52 q=16.0 size= 465kB time=00:00:04.13 bitrate= 921.3kbits/s dup=0 drop=204 speed=1.02x 
 07-16 15:07:20.026: frame= 234 fps= 51 q=15.0 size= 483kB time=00:00:04.59 bitrate= 860.0kbits/s dup=0 drop=229 speed=1.01x 
 07-16 15:07:20.527: frame= 258 fps= 51 q=20.0 size= 606kB time=00:00:05.08 bitrate= 975.7kbits/s dup=0 drop=253 speed=1.01x 
 07-16 15:07:21.047: frame= 291 fps= 52 q=15.0 size= 606kB time=00:00:05.73 bitrate= 866.0kbits/s dup=0 drop=286 speed=1.03x 
 07-16 15:07:21.558: frame= 317 fps= 52 q=23.0 size= 716kB time=00:00:06.24 bitrate= 938.8kbits/s dup=0 drop=312 speed=1.03x 
 07-16 15:07:22.048: frame= 342 fps= 52 q=17.0 size= 781kB time=00:00:06.75 bitrate= 947.1kbits/s dup=0 drop=337 speed=1.03x 
 07-16 15:07:22.549: frame= 367 fps= 52 q=20.0 size= 823kB time=00:00:07.26 bitrate= 927.7kbits/s dup=0 drop=362 speed=1.03x 
 07-16 15:07:23.049: frame= 393 fps= 52 q=19.0 size= 903kB time=00:00:07.77 bitrate= 951.0kbits/s dup=0 drop=388 speed=1.03x 
 07-16 15:07:23.560: frame= 421 fps= 52 q=17.0 size= 992kB time=00:00:08.33 bitrate= 974.6kbits/s dup=0 drop=416 speed=1.03x 
 07-16 15:07:24.060: frame= 448 fps= 52 q=15.0 size= 1016kB time=00:00:08.87 bitrate= 938.7kbits/s dup=0 drop=443 speed=1.03x 
 07-16 15:07:24.551: frame= 474 fps= 52 q=15.0 size= 1029kB time=00:00:09.40 bitrate= 896.0kbits/s dup=0 drop=469 speed=1.04x 
 07-16 15:07:25.061: frame= 500 fps= 52 q=15.0 size= 1029kB time=00:00:09.91 bitrate= 850.1kbits/s dup=0 drop=495 speed=1.03x 
 07-16 15:07:25.562: frame= 528 fps= 52 q=15.0 size= 1110kB time=00:00:10.49 bitrate= 866.8kbits/s dup=0 drop=523 speed=1.04x 
 07-16 15:07:26.052: frame= 560 fps= 53 q=15.0 size= 1114kB time=00:00:11.12 bitrate= 820.6kbits/s dup=0 drop=555 speed=1.05x 
 07-16 15:07:26.563: frame= 591 fps= 53 q=15.0 size= 1117kB time=00:00:11.74 bitrate= 779.1kbits/s dup=0 drop=586 speed=1.06x 
 07-16 15:07:27.063: frame= 621 fps= 54 q=18.0 size= 1154kB time=00:00:12.35 bitrate= 765.2kbits/s dup=0 drop=616 speed=1.07x 
 07-16 15:07:27.574: frame= 648 fps= 54 q=20.0 size= 1200kB time=00:00:12.91 bitrate= 761.2kbits/s dup=0 drop=643 speed=1.07x 
 07-16 15:07:28.084: frame= 675 fps= 54 q=20.0 size= 1292kB time=00:00:13.42 bitrate= 788.6kbits/s dup=0 drop=670 speed=1.06x 
 07-16 15:07:28.585: frame= 701 fps= 53 q=16.0 size= 1346kB time=00:00:13.95 bitrate= 790.4kbits/s dup=0 drop=696 speed=1.06x 
 07-16 15:07:29.085: frame= 729 fps= 54 q=15.0 size= 1380kB time=00:00:14.48 bitrate= 780.0kbits/s dup=0 drop=724 speed=1.06x 
 07-16 15:07:29.616: frame= 753 fps= 53 q=12.0 size= 1380kB time=00:00:15.00 bitrate= 753.6kbits/s dup=0 drop=748 speed=1.06x 
 07-16 15:07:30.116: frame= 780 fps= 53 q=15.0 size= 1459kB time=00:00:15.51 bitrate= 770.4kbits/s dup=0 drop=775 speed=1.06x 
 07-16 15:07:30.627: frame= 812 fps= 54 q=15.0 size= 1464kB time=00:00:16.16 bitrate= 742.1kbits/s dup=0 drop=807 speed=1.07x 
 07-16 15:07:31.127: frame= 843 fps= 54 q=15.0 size= 1465kB time=00:00:16.78 bitrate= 715.0kbits/s dup=0 drop=838 speed=1.07x 
 07-16 15:07:31.638: frame= 875 fps= 54 q=15.0 size= 1469kB time=00:00:17.41 bitrate= 691.0kbits/s dup=0 drop=870 speed=1.08x 
 07-16 15:07:32.138: frame= 906 fps= 54 q=18.0 size= 1507kB time=00:00:18.04 bitrate= 684.1kbits/s dup=0 drop=901 speed=1.08x 
 07-16 15:07:32.649: frame= 932 fps= 54 q=21.0 size= 1555kB time=00:00:18.55 bitrate= 686.8kbits/s dup=0 drop=927 speed=1.08x 
 07-16 15:07:33.159: frame= 960 fps= 54 q=23.0 size= 1614kB time=00:00:19.13 bitrate= 691.1kbits/s dup=0 drop=955 speed=1.08x 
 07-16 15:07:33.670: frame= 988 fps= 54 q=20.0 size= 1737kB time=00:00:19.66 bitrate= 723.7kbits/s dup=0 drop=983 speed=1.08x 
 07-16 15:07:34.180: frame= 1014 fps= 54 q=16.0 size= 1876kB time=00:00:20.22 bitrate= 759.9kbits/s dup=0 drop=1009 speed=1.08x 
 07-16 15:07:34.671: frame= 1042 fps= 54 q=15.0 size= 1897kB time=00:00:20.75 bitrate= 748.6kbits/s dup=0 drop=1037 speed=1.08x 
 07-16 15:07:35.181: frame= 1069 fps= 54 q=15.0 size= 1911kB time=00:00:21.29 bitrate= 735.3kbits/s dup=0 drop=1064 speed=1.08x 
 07-16 15:07:35.692: frame= 1098 fps= 54 q=15.0 size= 1912kB time=00:00:21.89 bitrate= 715.2kbits/s dup=0 drop=1093 speed=1.08x 
 07-16 15:07:36.182: frame= 1126 fps= 54 q=15.0 size= 1918kB time=00:00:22.43 bitrate= 700.3kbits/s dup=0 drop=1121 speed=1.08x 
 07-16 15:07:36.703: frame= 1154 fps= 54 q=15.0 size= 1918kB time=00:00:23.01 bitrate= 682.8kbits/s dup=0 drop=1149 speed=1.08x 
 07-16 15:07:37.203: frame= 1182 fps= 54 q=15.0 size= 1952kB time=00:00:23.56 bitrate= 678.4kbits/s dup=0 drop=1177 speed=1.08x 
 07-16 15:07:37.724: frame= 1212 fps= 54 q=21.0 size= 1990kB time=00:00:24.19 bitrate= 673.6kbits/s dup=0 drop=1207 speed=1.09x 
 07-16 15:07:38.224: frame= 1240 fps= 55 q=20.0 size= 2085kB time=00:00:24.72 bitrate= 690.5kbits/s dup=0 drop=1235 speed=1.09x 
 07-16 15:07:38.725: frame= 1267 fps= 54 q=16.0 size= 2227kB time=00:00:25.28 bitrate= 721.3kbits/s dup=0 drop=1262 speed=1.09x 
 07-16 15:07:39.235: frame= 1296 fps= 55 q=15.0 size= 2266kB time=00:00:25.86 bitrate= 717.8kbits/s dup=0 drop=1291 speed=1.09x 
 07-16 15:07:39.736: frame= 1321 fps= 54 q=15.0 size= 2279kB time=00:00:26.35 bitrate= 708.3kbits/s dup=0 drop=1316 speed=1.09x 
 07-16 15:07:40.236: frame= 1348 fps= 54 q=15.0 size= 2279kB time=00:00:26.91 bitrate= 693.8kbits/s dup=0 drop=1343 speed=1.09x 
 07-16 15:07:40.747: frame= 1375 fps= 54 q=15.0 size= 2288kB time=00:00:27.42 bitrate= 683.6kbits/s dup=0 drop=1370 speed=1.09x 
 07-16 15:07:41.237: frame= 1402 fps= 54 q=15.0 size= 2289kB time=00:00:27.95 bitrate= 670.6kbits/s dup=0 drop=1397 speed=1.08x 
 07-16 15:07:41.768: frame= 1430 fps= 54 q=15.0 size= 2294kB time=00:00:28.53 bitrate= 658.4kbits/s dup=0 drop=1425 speed=1.09x 
 07-16 15:07:42.278: frame= 1456 fps= 54 q=22.0 size= 2296kB time=00:00:29.04 bitrate= 647.4kbits/s dup=0 drop=1451 speed=1.08x 
 07-16 15:07:42.779: frame= 1485 fps= 54 q=21.0 size= 2350kB time=00:00:29.62 bitrate= 649.6kbits/s dup=0 drop=1480 speed=1.09x 
 07-16 15:07:43.279: frame= 1512 fps= 54 q=20.0 size= 2492kB time=00:00:30.16 bitrate= 676.9kbits/s dup=0 drop=1507 speed=1.08x 
 07-16 15:07:43.790: frame= 1539 fps= 54 q=16.0 size= 2562kB time=00:00:30.72 bitrate= 683.1kbits/s dup=0 drop=1534 speed=1.09x 
 07-16 15:07:44.290: frame= 1566 fps= 54 q=15.0 size= 2581kB time=00:00:31.25 bitrate= 676.4kbits/s dup=0 drop=1561 speed=1.08x 
 07-16 15:07:44.801: frame= 1592 fps= 54 q=15.0 size= 2581kB time=00:00:31.76 bitrate= 665.7kbits/s dup=0 drop=1587 speed=1.08x 
 07-16 15:07:45.301: frame= 1619 fps= 54 q=15.0 size= 2589kB time=00:00:32.29 bitrate= 656.5kbits/s dup=0 drop=1614 speed=1.08x 
 07-16 15:07:45.802: frame= 1646 fps= 54 q=15.0 size= 2589kB time=00:00:32.83 bitrate= 646.0kbits/s dup=0 drop=1641 speed=1.08x 
 07-16 15:07:46.332: frame= 1672 fps= 54 q=15.0 size= 2593kB time=00:00:33.39 bitrate= 636.2kbits/s dup=0 drop=1667 speed=1.08x 
 07-16 15:07:46.823: frame= 1698 fps= 54 q=15.0 size= 2594kB time=00:00:33.87 bitrate= 627.2kbits/s dup=0 drop=1693 speed=1.08x 
 07-16 15:07:47.333: frame= 1724 fps= 54 q=15.0 size= 2597kB time=00:00:34.43 bitrate= 617.9kbits/s dup=0 drop=1719 speed=1.08x 
 07-16 15:07:47.844: frame= 1748 fps= 54 q=17.0 size= 2661kB time=00:00:34.89 bitrate= 624.7kbits/s dup=0 drop=1743 speed=1.08x 
 07-16 15:07:48.344: frame= 1775 fps= 54 q=22.0 size= 2731kB time=00:00:35.43 bitrate= 631.4kbits/s dup=0 drop=1770 speed=1.08x 
 07-16 15:07:48.865: frame= 1800 fps= 54 q=19.0 size= 2867kB time=00:00:35.92 bitrate= 653.8kbits/s dup=0 drop=1795 speed=1.08x 
 07-16 15:07:49.375: frame= 1826 fps= 54 q=17.0 size= 2968kB time=00:00:36.43 bitrate= 667.3kbits/s dup=0 drop=1821 speed=1.07x 
 07-16 15:07:49.876: frame= 1854 fps= 54 q=15.0 size= 3014kB time=00:00:36.98 bitrate= 667.5kbits/s dup=0 drop=1849 speed=1.08x 
 07-16 15:07:50.366: frame= 1878 fps= 54 q=15.0 size= 3041kB time=00:00:37.47 bitrate= 664.7kbits/s dup=0 drop=1873 speed=1.07x 
 07-16 15:07:50.877: frame= 1904 fps= 54 q=15.0 size= 3052kB time=00:00:38.01 bitrate= 657.7kbits/s dup=0 drop=1899 speed=1.07x 
 07-16 15:07:51.387: frame= 1929 fps= 54 q=15.0 size= 3056kB time=00:00:38.49 bitrate= 650.3kbits/s dup=0 drop=1924 speed=1.07x 
 07-16 15:07:51.888: frame= 1955 fps= 54 q=17.0 size= 3060kB time=00:00:39.03 bitrate= 642.2kbits/s dup=0 drop=1950 speed=1.07x 
 07-16 15:07:52.388: frame= 1981 fps= 54 q=17.0 size= 3062kB time=00:00:39.54 bitrate= 634.3kbits/s dup=0 drop=1976 speed=1.07x 
 07-16 15:07:52.899: frame= 2007 fps= 54 q=25.0 size= 3064kB time=00:00:40.07 bitrate= 626.4kbits/s dup=0 drop=2002 speed=1.07x 
 07-16 15:07:53.419: frame= 2036 fps= 54 q=20.0 size= 3255kB time=00:00:40.63 bitrate= 656.1kbits/s dup=0 drop=2031 speed=1.07x 
 07-16 15:07:53.920: frame= 2061 fps= 54 q=21.0 size= 3306kB time=00:00:41.14 bitrate= 658.2kbits/s dup=0 drop=2056 speed=1.07x 
 07-16 15:07:54.420: frame= 2089 fps= 54 q=17.0 size= 3371kB time=00:00:41.70 bitrate= 662.2kbits/s dup=0 drop=2084 speed=1.07x 
 07-16 15:07:54.910: frame= 2116 fps= 54 q=15.0 size= 3438kB time=00:00:42.23 bitrate= 666.8kbits/s dup=0 drop=2111 speed=1.07x 
 07-16 15:07:55.421: frame= 2139 fps= 54 q=15.0 size= 3460kB time=00:00:42.70 bitrate= 663.7kbits/s dup=0 drop=2134 speed=1.07x 
 07-16 15:07:55.921: frame= 2164 fps= 53 q=15.0 size= 3467kB time=00:00:43.21 bitrate= 657.2kbits/s dup=0 drop=2159 speed=1.07x 
 07-16 15:07:56.422: frame= 2189 fps= 53 q=15.0 size= 3470kB time=00:00:43.69 bitrate= 650.6kbits/s dup=0 drop=2184 speed=1.07x 
 07-16 15:07:56.932: frame= 2214 fps= 53 q=15.0 size= 3472kB time=00:00:44.21 bitrate= 643.4kbits/s dup=0 drop=2209 speed=1.07x 
 07-16 15:07:57.433: frame= 2235 fps= 53 q=15.0 size= 3474kB time=00:00:44.60 bitrate= 637.9kbits/s dup=0 drop=2230 speed=1.06x 
 07-16 15:07:57.943: frame= 2260 fps= 53 q=16.0 size= 3547kB time=00:00:45.13 bitrate= 643.7kbits/s dup=0 drop=2255 speed=1.06x 
 07-16 15:07:58.454: frame= 2292 fps= 53 q=24.0 size= 3555kB time=00:00:45.76 bitrate= 636.3kbits/s dup=0 drop=2287 speed=1.06x 
 07-16 15:07:58.964: frame= 2320 fps= 53 q=21.0 size= 3643kB time=00:00:46.34 bitrate= 643.9kbits/s dup=0 drop=2315 speed=1.07x 
 07-16 15:07:59.475: frame= 2348 fps= 53 q=16.0 size= 3700kB time=00:00:46.88 bitrate= 646.6kbits/s dup=0 drop=2343 speed=1.07x 
 07-16 15:07:59.985: frame= 2375 fps= 53 q=22.0 size= 3755kB time=00:00:47.43 bitrate= 648.5kbits/s dup=0 drop=2370 speed=1.07x 
 07-16 15:08:00.486: frame= 2400 fps= 53 q=22.0 size= 3880kB time=00:00:47.92 bitrate= 663.3kbits/s dup=0 drop=2395 speed=1.06x 
 07-16 15:08:00.996: frame= 2427 fps= 53 q=15.0 size= 3977kB time=00:00:48.46 bitrate= 672.2kbits/s dup=0 drop=2422 speed=1.06x 
 07-16 15:08:01.497: frame= 2456 fps= 53 q=18.0 size= 4012kB time=00:00:49.06 bitrate= 669.9kbits/s dup=0 drop=2451 speed=1.07x 
 07-16 15:08:01.997: frame= 2481 fps= 53 q=16.0 size= 4029kB time=00:00:49.55 bitrate= 666.1kbits/s dup=0 drop=2476 speed=1.06x 
 07-16 15:08:02.498: frame= 2507 fps= 53 q=20.0 size= 4036kB time=00:00:50.06 bitrate= 660.4kbits/s dup=0 drop=2502 speed=1.06x 
 07-16 15:08:03.008: frame= 2538 fps= 53 q=15.0 size= 4113kB time=00:00:50.68 bitrate= 664.7kbits/s dup=0 drop=2533 speed=1.07x 
 07-16 15:08:03.529: frame= 2568 fps= 53 q=22.0 size= 4132kB time=00:00:51.26 bitrate= 660.2kbits/s dup=0 drop=2563 speed=1.07x 
 07-16 15:08:04.039: frame= 2596 fps= 53 q=22.0 size= 4184kB time=00:00:51.85 bitrate= 661.1kbits/s dup=0 drop=2591 speed=1.07x 
 07-16 15:08:04.560: frame= 2623 fps= 53 q=23.0 size= 4276kB time=00:00:52.40 bitrate= 668.4kbits/s dup=0 drop=2618 speed=1.07x 
 07-16 15:08:05.060: frame= 2647 fps= 53 q=16.0 size= 4379kB time=00:00:52.87 bitrate= 678.5kbits/s dup=0 drop=2642 speed=1.07x 
 07-16 15:08:05.571: frame= 2671 fps= 53 q=19.0 size= 4425kB time=00:00:53.33 bitrate= 679.6kbits/s dup=0 drop=2666 speed=1.06x 
 07-16 15:08:06.071: frame= 2696 fps= 53 q=15.0 size= 4452kB time=00:00:53.87 bitrate= 677.0kbits/s dup=0 drop=2691 speed=1.06x 
 07-16 15:08:06.582: frame= 2723 fps= 53 q=15.0 size= 4478kB time=00:00:54.38 bitrate= 674.5kbits/s dup=0 drop=2718 speed=1.06x 
 07-16 15:08:07.102: frame= 2750 fps= 53 q=15.0 size= 4479kB time=00:00:54.91 bitrate= 668.1kbits/s dup=0 drop=2745 speed=1.06x 
 07-16 15:08:07.593: frame= 2779 fps= 53 q=15.0 size= 4558kB time=00:00:55.49 bitrate= 672.8kbits/s dup=0 drop=2774 speed=1.06x 
 07-16 15:08:08.093: frame= 2810 fps= 53 q=16.0 size= 4560kB time=00:00:56.12 bitrate= 665.5kbits/s dup=0 drop=2805 speed=1.07x 
 07-16 15:08:08.594: frame= 2841 fps= 53 q=21.0 size= 4565kB time=00:00:56.74 bitrate= 658.9kbits/s dup=0 drop=2836 speed=1.07x 
 07-16 15:08:09.104: frame= 2871 fps= 54 q=21.0 size= 4616kB time=00:00:57.33 bitrate= 659.5kbits/s dup=0 drop=2866 speed=1.07x 
 07-16 15:08:09.615: frame= 2897 fps= 54 q=22.0 size= 4673kB time=00:00:57.88 bitrate= 661.3kbits/s dup=0 drop=2892 speed=1.07x 
 07-16 15:08:10.115: frame= 2925 fps= 54 q=16.0 size= 4779kB time=00:00:58.42 bitrate= 670.1kbits/s dup=0 drop=2920 speed=1.07x 
 07-16 15:08:10.616: frame= 2951 fps= 54 q=15.0 size= 4817kB time=00:00:58.95 bitrate= 669.4kbits/s dup=0 drop=2946 speed=1.07x 
 07-16 15:08:11.146: frame= 2978 fps= 54 q=15.0 size= 4851kB time=00:00:59.51 bitrate= 667.8kbits/s dup=0 drop=2973 speed=1.07x 
 07-16 15:08:11.667: frame= 3007 fps= 54 q=21.0 size= 4852kB time=00:01:00.04 bitrate= 661.9kbits/s dup=0 drop=3002 speed=1.07x 
 07-16 15:08:12.157: frame= 3037 fps= 54 q=15.0 size= 4933kB time=00:01:00.65 bitrate= 666.3kbits/s dup=0 drop=3032 speed=1.07x 
 07-16 15:08:12.648: frame= 3069 fps= 54 q=15.0 size= 4939kB time=00:01:01.30 bitrate= 660.0kbits/s dup=0 drop=3064 speed=1.07x 
 07-16 15:08:13.148: frame= 3101 fps= 54 q=15.0 size= 4939kB time=00:01:01.88 bitrate= 653.9kbits/s dup=0 drop=3096 speed=1.07x 
 07-16 15:08:13.238: frame= 3101 fps= 54 q=-1.0 Lsize= 4994kB time=00:01:02.02 bitrate= 659.6kbits/s dup=0 drop=3096 speed=1.07x 
 07-16 15:08:13.238: video:4923kB audio:16kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.108781%
 07-16 15:08:13.248: [libx264 @ 0xb5428800] frame I:13 Avg QP:14.15 size: 72152
 07-16 15:08:13.248: [libx264 @ 0xb5428800] frame P:3088 Avg QP:17.25 size: 1329
 07-16 15:08:13.248: [libx264 @ 0xb5428800] mb I I16..4: 100.0% 0.0% 0.0%
 07-16 15:08:13.248: [libx264 @ 0xb5428800] mb P I16..4: 0.8% 0.0% 0.0% P16..4: 7.0% 0.0% 0.0% 0.0% 0.0% skip:92.2%
 07-16 15:08:13.248: [libx264 @ 0xb5428800] coded y,uvDC,uvAC intra: 49.6% 59.6% 45.8% inter: 2.5% 4.8% 1.9%
 07-16 15:08:13.248: [libx264 @ 0xb5428800] i16 v,h,dc,p: 50% 26% 13% 10%
 07-16 15:08:13.248: [libx264 @ 0xb5428800] i8c dc,h,v,p: 45% 24% 21% 10%
 07-16 15:08:13.248: [libx264 @ 0xb5428800] kb/s:650.25
 07-16 15:08:13.258: [aac @ 0xb5429000] Qavg: 65536.000



-
FFMpeg is slow on Android [duplicate]
28 juin 2017, par Oleg FilimonovThis question already has an answer here :
I’m using this library : https://github.com/WritingMinds/ffmpeg-android
Executing this command :
ffmpeg -y -i video.mp4 -ignore_loop 0 -i overlay.gif -filter_complex `
>> "[0][1]overlay=x=mod((1080/4 + sin(t)*1080/4)\,1920):y=mod(t*300\,1080):shortest=1[res];`
>> [res][1]overlay=x=mod((200*1 + 1080/4 - sin(2*t)*1080/4)\,1920):y=mod(100 + t*300\,1080):shortest=1[res];`
>> [res][1]overlay=x=mod((200*2 + 1080/4 - sin(-90 + t/2)*1080/4)\,1920):y=mod(150 + t*250\,1080):shortest=1[res];`
>> [res][1]overlay=x=mod((200*3 + 1080/4 - sin(90 + 3*t)*1080/4)\,1920):y=mod(200 + t*100\,1080):shortest=1[res];`
>> [res][1]overlay=x=mod((200*4 + 1080/4 - sin(180 + t)*1080/4)\,1920):y=mod(t*250\,1080):shortest=1[res];`
>> [res][1]overlay=x=mod((200*5 + 1080/4 - sin(-180 + t)*1080/4)\,1920):y=mod(t*100\,1080):shortest=1[res];`
>> [res][1]overlay=x=mod((200*6 + 1080/4 - sin(2*t)*1080/4)\,1920):y=100 + mod(100 + t*300\,1080):shortest=1[res]`
>> " -map "[res]" -preset ultrafast out.mp4(Basically add a bunch of animated overlays to the video)
On PC this command takes about a second to execute (render speed is about 278 fps). But on Android device with Snapdragon 821 it takes about 10 seconds (about 30 fps).
The curious thing is that whenever command is executing on PC, CPU load is around 90%, but on Android it’s less than 1% (see screenshot : initial spike is UI stuff plus loading binaries, afterwards ffmpeg was executing until 10 second mark)
I tried executing the same command, but writing to /dev/null
instead of the file :ffmpeg -y -i video.mp4 -ignore_loop 0 -i overlay.gif -filter_complex `
>> "[0][1]overlay=x=mod((1080/4 + sin(t)*1080/4)\,1920):y=mod(t*300\,1080):shortest=1[res];`
>> [res][1]overlay=x=mod((200*1 + 1080/4 - sin(2*t)*1080/4)\,1920):y=mod(100 + t*300\,1080):shortest=1[res];`
>> [res][1]overlay=x=mod((200*2 + 1080/4 - sin(-90 + t/2)*1080/4)\,1920):y=mod(150 + t*250\,1080):shortest=1[res];`
>> [res][1]overlay=x=mod((200*3 + 1080/4 - sin(90 + 3*t)*1080/4)\,1920):y=mod(200 + t*100\,1080):shortest=1[res];`
>> [res][1]overlay=x=mod((200*4 + 1080/4 - sin(180 + t)*1080/4)\,1920):y=mod(t*250\,1080):shortest=1[res];`
>> [res][1]overlay=x=mod((200*5 + 1080/4 - sin(-180 + t)*1080/4)\,1920):y=mod(t*100\,1080):shortest=1[res];`
>> [res][1]overlay=x=mod((200*6 + 1080/4 - sin(2*t)*1080/4)\,1920):y=100 + mod(100 + t*300\,1080):shortest=1[res]`
>> " -map "[res]" -preset ultrafast -f null /dev/nullThis reduced time by 3 seconds.
I also tried replacing gif overlay with png overlay, but speed didn’t improve significantly.
Here’s log of the command execution on Android :
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 '/data/user/0/com.example.user.proofofconcept/files/in_10s.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 2017-06-27 18:07:54
Duration: 00:00:10.47, start: 0.000000, bitrate: 14043 kb/s
Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuvj420p(pc, smpte170m), 1280x720, 13971 kb/s, 29.86 fps, 30.01 tbr, 90k tbn, 180k tbc (default)
Metadata:
creation_time : 2017-06-27 18:07:53
handler_name : VideoHandle
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 96 kb/s (default)
Metadata:
creation_time : 2017-06-27 18:07:54
handler_name : SoundHandle
Input #1, gif, from '/data/user/0/com.example.user.proofofconcept/files/overlay.gif':
Duration: N/A, bitrate: N/A
Stream #1:0: Video: gif, bgra, 130x98, 6.17 fps, 4.92 tbr, 100 tbn, 100 tbc
[swscaler @ 0xeddb3000] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0xee1fdc00] using cpu capabilities: none!
[libx264 @ 0xee1fdc00] profile Constrained Baseline, level 3.2
[libx264 @ 0xee1fdc00] 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=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
Output #0, mp4, to '/storage/emulated/0/temp/out.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.25.100
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x720, q=-1--1, 30.01 fps, 90k tbn, 30.01 tbc (default)
Metadata:
encoder : Lavc57.24.102 libx264
Side data:
unknown side data type 10 (24 bytes)
Stream mapping:
Stream #0:0 (h264) -> overlay:main
Stream #1:0 (gif) -> overlay:overlay
Stream #1:0 (gif) -> overlay:overlay
Stream #1:0 (gif) -> overlay:overlay
Stream #1:0 (gif) -> overlay:overlay
Stream #1:0 (gif) -> overlay:overlay
Stream #1:0 (gif) -> overlay:overlay
Stream #1:0 (gif) -> overlay:overlay
overlay -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
frame= 16 fps=0.0 q=24.0 size= 227kB time=00:00:00.29 bitrate=6210.2kbits/s dup=2 drop=0 speed=0.56x
frame= 29 fps= 28 q=24.0 size= 451kB time=00:00:00.73 bitrate=5042.1kbits/s dup=2 drop=0 speed=0.707x
frame= 40 fps= 26 q=24.0 size= 637kB time=00:00:01.09 bitrate=4744.5kbits/s dup=2 drop=0 speed=0.71x
frame= 57 fps= 28 q=24.0 size= 903kB time=00:00:01.66 bitrate=4441.3kbits/s dup=2 drop=0 speed=0.812x
frame= 75 fps= 29 q=24.0 size= 1186kB time=00:00:02.26 bitrate=4288.0kbits/s dup=2 drop=0 speed=0.885x
frame= 94 fps= 31 q=24.0 size= 1456kB time=00:00:02.89 bitrate=4113.4kbits/s dup=2 drop=0 speed=0.945x
frame= 113 fps= 32 q=25.0 size= 1780kB time=00:00:03.53 bitrate=4127.3kbits/s dup=2 drop=0 speed=0.985x
frame= 131 fps= 32 q=24.0 size= 2101kB time=00:00:04.13 bitrate=4165.9kbits/s dup=2 drop=0 speed=1.01x
frame= 150 fps= 33 q=24.0 size= 2461kB time=00:00:04.76 bitrate=4231.2kbits/s dup=2 drop=0 speed=1.03x
frame= 165 fps= 32 q=24.0 size= 2721kB time=00:00:05.26 bitrate=4234.1kbits/s dup=2 drop=0 speed=1.03x
frame= 185 fps= 33 q=24.0 size= 3028kB time=00:00:05.93 bitrate=4182.4kbits/s dup=2 drop=0 speed=1.05x
frame= 205 fps= 33 q=24.0 size= 3329kB time=00:00:06.59 bitrate=4133.3kbits/s dup=2 drop=0 speed=1.07x
frame= 224 fps= 34 q=24.0 size= 3610kB time=00:00:07.23 bitrate=4089.7kbits/s dup=2 drop=0 speed=1.08x
frame= 243 fps= 34 q=24.0 size= 3901kB time=00:00:07.86 bitrate=4063.3kbits/s dup=2 drop=0 speed=1.09x
frame= 264 fps= 34 q=24.0 size= 4297kB time=00:00:08.56 bitrate=4110.6kbits/s dup=2 drop=0 speed=1.11x
frame= 284 fps= 35 q=24.0 size= 4601kB time=00:00:09.23 bitrate=4083.5kbits/s dup=2 drop=0 speed=1.12x
frame= 304 fps= 35 q=24.0 size= 4886kB time=00:00:09.89 bitrate=4044.4kbits/s dup=2 drop=0 speed=1.14x
frame= 314 fps= 35 q=-1.0 Lsize= 5138kB time=00:00:10.46 bitrate=4022.4kbits/s dup=2 drop=0 speed=1.16x
video:5135kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.040961%
[libx264 @ 0xee1fdc00] frame I:2 Avg QP:20.50 size: 84700
[libx264 @ 0xee1fdc00] frame P:312 Avg QP:24.06 size: 16310
[libx264 @ 0xee1fdc00] mb I I16..4: 100.0% 0.0% 0.0%
[libx264 @ 0xee1fdc00] mb P I16..4: 7.7% 0.0% 0.0% P16..4: 54.9% 0.0% 0.0% 0.0% 0.0% skip:37.4%
[libx264 @ 0xee1fdc00] coded y,uvDC,uvAC intra: 62.7% 22.9% 3.4% inter: 26.1% 8.4% 0.9%
[libx264 @ 0xee1fdc00] i16 v,h,dc,p: 13% 14% 59% 13%
[libx264 @ 0xee1fdc00] i8c dc,h,v,p: 47% 24% 22% 6%
[libx264 @ 0xee1fdc00] kb/s:4020.26
Success
time used: 9843So what could be the reason of such low CPU load ?