Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (34)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (6229)

  • libx264 encoder error in ffmpeg android build

    26 décembre 2013, par kerim yucel

    Right now, I have a ffmeg build script which recognizes libx264 and compiles succesfully. I have also compiled x264 and obtained libx264.a library. Both ffmpeg and libx264 are built from source. I can build ffmpeg without libx264 succesfully as well. Below you may find my script which tries to build ffmpeg with libx264.

    #!/bin/bash
    NDK=~/Android_NDK_r7b
    PLATFORM=$NDK/platforms/android-8/arch-arm/
    PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86
    alitan=~/x264/ndk7_build
    function build_one
    {
    ./configure --target-os=linux \
    --prefix=$PREFIX \
    --enable-cross-compile \
    --extra-libs="-lgcc " \
    --arch=arm \
    --cc=$PREBUILT/bin/arm-linux-androideabi-gcc \
    --cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \
    --nm=$PREBUILT/bin/arm-linux-androideabi-nm \
    --sysroot=$PLATFORM \
    --extra-cflags=" -I$alitan/include" \
    --disable-shared \
    --enable-static \
    --extra-ldflags=" -L$alitan/lib " \
    --enable-version3 \
    --enable-gpl \
    --disable-doc \
    --disable-everything \
    --enable-libx264 \
    --enable-encoder=libx264 \
    $ADDITIONAL_CONFIGURE_FLAG

    make clean
    make -j4 install
    $PREBUILT/bin/arm-linux-androideabi-ar d libavcodec/libavcodec.a inverse.o
    $PREBUILT/bin/arm-linux-androideabi-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -soname libffmpeg.so -shared -nostdlib -z,noexecstack -Bsymbolic --whole-archive --no-undefined -o $PREFIX/libffmpeg.so libavcodec/libavcodec.a libavformat/libavformat.a libavutil/libavutil.a libswscale/libswscale.a -lc -lm -lz -ldl -llog --warn-once --dynamic-linker=/system/bin/linker $PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a
    }

    #arm v7vfpv3
    CPU=armv7-a
    OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=$CPU "
    PREFIX=./DONE/$CPU
    ADDITIONAL_CONFIGURE_FLAG=
    build_one

    Above script doesn’t give me libx264.a in ffmpeg output builds.Several other scenarios are as follows.
    If I enable x264 encoder, I get undefined reference errors to some variables in x264.c (in libavcodec).
    If I enable shared in ffmpeg configure, I get an error which says it can’t cd to my prefix directory (no permission issues by the way).

    I am using latest releases of ffmpeg and x264 (cloned the git today) and ndk 7. Ubuntu runs on VM, installed on Windows 7. For further details about my adventure of ffmpeg/x264 porting to Android, you may refer here.

    What should I do to use libx264 with ffmpeg ? I kept on trying this script with different configurations, removed all ffmpeg x264 folders and reinstalled them, but to no avail.

    Thanks a lot in advance.

    EDIT
    Below is my x264 build script. It builds fine, gives me the static library and the headers.

    export ARM_ROOT=/home/mehmet/Android_NDK_r7b
    export ARM_INC=$ARM_ROOT/platforms/android-8/arch-arm/usr/include/
    export ARM_LIB=$ARM_ROOT/platforms/android-8/arch-arm/usr/lib/
    export ARM_TOOL=$ARM_ROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86
    export ARM_LIBO=$ARM_TOOL/lib/gcc/arm-linux-androideabi/4.4.3
    export PATH=$ARM_TOOL/bin:$PATH
    export PATH=$ARM_TOOL/arm-linux-androideabi/bin:$PATH
    export ARM_PRE=arm-linux-androideabi
    #tries to build for 4.4.3 toolchain

    ./configure --prefix=./ndk7_build \
    --disable-gpac \
    --extra-cflags=" -I$ARM_INC -fPIC -DANDROID -fpic -mthumb-interwork -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -DANDROID -Wa,--noexecstack -MMD -MP " \
    --extra-ldflags=" -nostdlib -Bdynamic -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,nocopyreloc -Wl,-soname,/system/lib/libz.so -Wl,-rpath-link=$ARM_LIB,-dynamic-linker=/system/bin/linker -L$ARM_LIB -nostdlib $ARM_LIB/crtbegin_dynamic.o $ARM_LIB/crtend_android.o -lc -lm -ldl -lgcc " \
    --cross-prefix=${ARM_PRE}- \
    --disable-asm \
    --enable-static \
    --host=arm-linux \

    This is what happens on terminal when i enable libx264 encoder.

    STRIP   ffmpeg
    INSTALL install-progs-yes
    INSTALL ffmpeg
    INSTALL ffprobe
    libavcodec/libavcodec.a(libx264.o): In function `X264_frame':
    /home/mehmet/ffmpeg/libavcodec/libx264.c:158: undefined reference to `x264_picture_init'
    /home/mehmet/ffmpeg/libavcodec/libx264.c:178: undefined reference to `x264_encoder_reconfig'
    /home/mehmet/ffmpeg/libavcodec/libx264.c:189: undefined reference to `x264_encoder_encode'
    /home/mehmet/ffmpeg/libavcodec/libx264.c:195: undefined reference to `x264_encoder_delayed_frames'
    libavcodec/libavcodec.a(libx264.o): In function `encode_nals':
    /home/mehmet/ffmpeg/libavcodec/libx264.c:100: undefined reference to `x264_bit_depth'
    libavcodec/libavcodec.a(libx264.o): In function `X264_close':
    /home/mehmet/ffmpeg/libavcodec/libx264.c:230: undefined reference to `x264_encoder_close'
    libavcodec/libavcodec.a(libx264.o): In function `X264_init':
    /home/mehmet/ffmpeg/libavcodec/libx264.c:283: undefined reference to `x264_param_default'
    /home/mehmet/ffmpeg/libavcodec/libx264.c:291: undefined reference to `x264_param_default_preset'
    /home/mehmet/ffmpeg/libavcodec/libx264.c:313: undefined reference to `x264_param_parse'
    /home/mehmet/ffmpeg/libavcodec/libx264.c:448: undefined reference to `x264_param_apply_fastfirstpass'
    /home/mehmet/ffmpeg/libavcodec/libx264.c:451: undefined reference to `x264_param_apply_profile'
    /home/mehmet/ffmpeg/libavcodec/libx264.c:494: undefined reference to `x264_encoder_open_125'
    /home/mehmet/ffmpeg/libavcodec/libx264.c:505: undefined reference to `x264_encoder_headers'
  • FFMPEG and -crf on Android

    12 juin 2014, par mister-viper

    yesterday I managed to build a newer Version of FFMPEG for Android. I directly created a binary which allows me to invoke commands per commandline. I builded the Version using NDK r9d and the 4.8 linux_x86_x64 toolchain.

    After including everything in my Application my goal was to execute the command for which I did the whole effort.

    My goal is to run :

    ffmpeg -i example.mp4 -r 30 -vcodec libx264 -crf 0 output.mp4

    Running this command on the command line via python works absolutly fine. However, running this command on Android does not work.

    1) I get the error that I have to add

    -strict experimental

    After reading FFMPEG docu I found out, that this is due to the libx264. However, I do not understand why I have not to add this comment in the Python version.

    2) After adding the parameter above, I was able to convert the video. However, the result was horrible. The transcoded images were just some noisy blinking green stuff. Thus, I looked for the problem. The problem is the parameter :

    -crf 0

    Due to this parameter, the result was so horrible. However, if I change the parameter to

    -crf 1

    everything is working as expected. BUT : I really want a lossless encoding here. That was the reason for choosing -crf 0. Moreover, this parameter works fine in my python version.

    Can anybody explain to me :
    1) What are I’m doing wrong ?
    2) How can I use -crf 0 on Android ?

    Best regards,
    André

    //Edit :
    Requested Logoutput :

    06-12 19:23:04.841: I/System.out(8983): Starting process
    06-12 19:23:04.871: D/dalvikvm(8983): GC_FOR_ALLOC freed 294K, 4% free 9260K/9592K, paused 17ms, total 18ms
    06-12 19:23:04.871: I/System.out(8983): ffmpeg version N-63698-g22d1b24 Copyright (c) 2000-2014 the FFmpeg developers
    06-12 19:23:04.871: I/System.out(8983):   built on Jun 11 2014 13:17:16 with gcc 4.8 (GCC)
    06-12 19:23:04.871: I/System.out(8983):   configuration: --target-os=linux --cross-prefix=arm-linux-androideabi- --arch=arm --cpu=armv7-a --sysroot=/home/andre/Desktop/android-ndk-r9d/platforms/android-9/arch-arm --disable-avdevice --disable-decoder=h264_vdpau --enable-libx264 --enable-gpl --prefix=build/armeabi-v7a-neon --extra-cflags='-I../x264 -DANDROID -I${ANDROID_NDK_ROOT_PATH}/sources/cxx-stl/system/include -march=armv7-a -mfloat-abi=softfp -mfpu=neon' --extra-ldflags='-L../x264 -Wl,--fix-cortex-a8 -L../android-libs -Wl,-rpath-link,../android-libs' --extra-cxxflags='-Wno-multichar -fno-exceptions -fno-rtti'
    06-12 19:23:04.871: I/System.out(8983):   libavutil      52. 89.100 / 52. 89.100
    06-12 19:23:04.871: I/System.out(8983):   libavcodec     55. 66.100 / 55. 66.100
    06-12 19:23:04.871: I/System.out(8983):   libavformat    55. 42.100 / 55. 42.100
    06-12 19:23:04.871: I/System.out(8983):   libavfilter     4.  5.100 /  4.  5.100
    06-12 19:23:04.871: I/System.out(8983):   libswscale      2.  6.100 /  2.  6.100
    06-12 19:23:04.871: I/System.out(8983):   libswresample   0. 19.100 /  0. 19.100
    06-12 19:23:04.881: I/System.out(8983):   libpostproc    52.  3.100 / 52.  3.100
    06-12 19:23:04.971: I/System.out(8983): Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/screen_recording.mp4':
    06-12 19:23:04.971: I/System.out(8983):   Metadata:
    06-12 19:23:04.971: I/System.out(8983):     major_brand     : isom
    06-12 19:23:04.971: I/System.out(8983):     minor_version   : 0
    06-12 19:23:04.971: I/System.out(8983):     compatible_brands: isomiso2avc1
    06-12 19:23:04.971: I/System.out(8983):     creation_time   : 2014-06-12 11:52:00
    06-12 19:23:04.971: I/System.out(8983):   Duration: 00:00:09.39, start: 0.000000, bitrate: 597 kb/s
    06-12 19:23:04.971: I/System.out(8983):     Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 720x1280, 593 kb/s, SAR 65536:65536 DAR 9:16, 34.07 fps, 90k tbr, 90k tbn, 180k tbc (default)
    06-12 19:23:04.971: I/System.out(8983):     Metadata:
    06-12 19:23:04.971: I/System.out(8983):       creation_time   : 2014-06-12 11:51:56
    06-12 19:23:04.971: I/System.out(8983): [libx264 @ 0x171c930] using SAR=1/1
    06-12 19:23:04.981: I/System.out(8983): [libx264 @ 0x171c930] using cpu capabilities: ARMv6 NEON
    06-12 19:23:04.991: I/System.out(8983): [libx264 @ 0x171c930] profile High 4:4:4 Predictive, level 3.1, 4:2:0 8-bit
    06-12 19:23:04.991: I/System.out(8983): [libx264 @ 0x171c930] 64 - core 142 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=0 mixed_ref=1 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=0 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=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc=cqp mbtree=0 qp=0
    06-12 19:23:04.991: I/System.out(8983): Output #0, mp4, to '/storage/emulated/0/screen_recording_out.mp4':
    06-12 19:23:05.001: I/System.out(8983):   Metadata:
    06-12 19:23:05.001: I/System.out(8983):     major_brand     : isom
    06-12 19:23:05.001: I/System.out(8983):     minor_version   : 0
    06-12 19:23:05.001: I/System.out(8983):     compatible_brands: isomiso2avc1
    06-12 19:23:05.001: I/System.out(8983):     encoder         : Lavf55.42.100
    06-12 19:23:05.001: I/System.out(8983):     Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 720x1280 [SAR 65536:65536 DAR 9:16], q=-1--1, 30 fps, 15360 tbn, 30 tbc (default)
    06-12 19:23:05.001: I/System.out(8983):     Metadata:
    06-12 19:23:05.001: I/System.out(8983):       creation_time   : 2014-06-12 11:51:56
    06-12 19:23:05.001: I/System.out(8983):       encoder         : Lavc55.66.100 libx264
    06-12 19:23:05.001: I/System.out(8983): Stream mapping:
    06-12 19:23:05.001: I/System.out(8983):   Stream #0:0 -> #0:0 (h264 -> libx264)
    06-12 19:23:05.001: I/System.out(8983): Press [q] to stop, [?] for help
    06-12 19:23:05.662: I/System.out(8983): frame=   14 fps=0.0 q=0.0 size=      51kB time=00:00:00.23 bitrate=1789.0kbits/s dup=0 drop=7    
    06-12 19:23:06.022: I/System.out(8983): frame=   20 fps= 20 q=0.0 size=     127kB time=00:00:00.43 bitrate=2395.1kbits/s dup=0 drop=14    
    06-12 19:23:06.602: I/System.out(8983): frame=   25 fps= 16 q=0.0 size=     195kB time=00:00:00.60 bitrate=2659.2kbits/s dup=0 drop=16    
    06-12 19:23:07.103: I/System.out(8983): frame=   30 fps= 14 q=0.0 size=     262kB time=00:00:00.76 bitrate=2803.4kbits/s dup=0 drop=21    
    06-12 19:23:07.674: I/System.out(8983): frame=   50 fps= 19 q=0.0 size=     276kB time=00:00:01.43 bitrate=1575.9kbits/s dup=0 drop=35    
    06-12 19:23:08.174: I/System.out(8983): frame=   70 fps= 22 q=0.0 size=     277kB time=00:00:02.10 bitrate=1079.1kbits/s dup=0 drop=35    
    06-12 19:23:08.725: I/System.out(8983): frame=   90 fps= 24 q=0.0 size=     278kB time=00:00:02.76 bitrate= 821.8kbits/s dup=0 drop=35    
    06-12 19:23:09.245: I/System.out(8983): frame=  109 fps= 26 q=0.0 size=     291kB time=00:00:03.40 bitrate= 700.3kbits/s dup=0 drop=42    
    06-12 19:23:09.746: I/System.out(8983): frame=  125 fps= 27 q=0.0 size=     299kB time=00:00:03.93 bitrate= 622.1kbits/s dup=0 drop=43    
    06-12 19:23:10.236: I/System.out(8983): frame=  144 fps= 28 q=0.0 size=     300kB time=00:00:04.56 bitrate= 537.4kbits/s dup=0 drop=44    
    06-12 19:23:11.117: I/System.out(8983): frame=  160 fps= 28 q=0.0 size=     337kB time=00:00:05.10 bitrate= 542.1kbits/s dup=0 drop=55    
    06-12 19:23:11.277: I/System.out(8983): frame=  162 fps= 26 q=0.0 size=     378kB time=00:00:05.16 bitrate= 598.6kbits/s dup=0 drop=58    
    06-12 19:23:11.828: I/System.out(8983): frame=  178 fps= 26 q=0.0 size=     428kB time=00:00:05.70 bitrate= 614.6kbits/s dup=0 drop=59    
    06-12 19:23:12.318: I/System.out(8983): frame=  198 fps= 27 q=0.0 size=     429kB time=00:00:06.36 bitrate= 551.6kbits/s dup=0 drop=68    
    06-12 19:23:12.829: I/System.out(8983): frame=  214 fps= 27 q=0.0 size=     431kB time=00:00:06.90 bitrate= 511.6kbits/s dup=0 drop=69    
    06-12 19:23:13.339: I/System.out(8983): frame=  233 fps= 28 q=0.0 size=     432kB time=00:00:07.53 bitrate= 469.6kbits/s dup=0 drop=70    
    06-12 19:23:14.690: I/System.out(8983): frame=  262 fps= 27 q=-1.0 Lsize=     457kB time=00:00:08.73 bitrate= 428.4kbits/s dup=18 drop=76    
    06-12 19:23:14.690: I/System.out(8983): video:455kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.401494%
    06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] frame I:2     Avg QP: 0.00  size: 11390
    06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] frame P:260   Avg QP: 0.00  size:  1702
    06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] mb I  I16..4: 97.5%  0.2%  2.3%
    06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] mb P  I16..4:  5.9%  0.3%  0.1%  P16..4:  0.9%  0.1%  0.0%  0.0%  0.0%    skip:92.8%
    06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] 8x8 transform intra:3.6% inter:31.8%
    06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] coded y,uvDC,uvAC intra: 17.3% 9.6% 9.2% inter: 0.4% 0.3% 0.3%
    06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] i16 v,h,dc,p: 69% 30%  1%  0%
    06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 49% 29%  0%  0%  0%  0%  0%  0%
    06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 46% 31% 14%  1%  2%  2%  2%  1%  1%
    06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] i8c dc,h,v,p: 80% 16%  3%  0%
    06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] Weighted P-Frames: Y:5.4% UV:4.6%
    06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] ref P L0: 74.9%  4.1% 19.6%  1.3%  0.0%
    06-12 19:23:14.710: I/System.out(8983): [libx264 @ 0x171c930] kb/s:426.18
    06-12 19:23:14.740: I/System.out(8983): Finished
    06-12 19:23:14.740: I/System.out(8983): Finished Process
  • Script timing with FFMPEG and PHP

    23 juin 2014, par egekhter

    I’m running into a very strange bug.

    Here’s my command console output :

    ffmpeg -i /transcodes/original/883_1000_1403436916_00001.MTS -y -vcodec libx264 -tune zerolatency -

    movflags faststart -crf 20 -profile:v high -level:v 4.0 -maxrate 6000k -bufsize 12000k -acodec libfdk_aac -b:a 256k /transcodes/883_1000_1403436916_00001_HQ.mp4 -vcodec libx264 -s 848x480 -tune zerolatency -movflags faststart -crf 25 -profile:v main -level:v 3.1 -maxrate 1400k -bufsize 1400k -acodec libfdk_aac -b:a 256k /transcodes/883_1000_1403436916_00001_SQ.mp4 -ss 166.16 -f image2 -vframes 1 /transcodes/883_1000_1403436916_00001_poster.jpg -ss 166.16 -f image2 -vf scale=-1:240 -vframes 1 /transcodes/883_1000_1403436916_00001_thumb.jpg

    ffmpeg version 2.2.git Copyright (c) 2000-2014 the FFmpeg developers
     built on Jun 13 2014 02:40:27 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
     configuration: --prefix=/home/ubuntu/ffmpeg_build --extra-cflags=-I/home/ubuntu/ffmpeg_build/include --extra-ldflags=-L/home/ubuntu/ffmpeg_build/lib --bindir=/home/ubuntu/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree
     libavutil      52. 89.100 / 52. 89.100
     libavcodec     55. 66.100 / 55. 66.100
     libavformat    55. 43.100 / 55. 43.100
     libavdevice    55. 13.101 / 55. 13.101
     libavfilter     4.  8.100 /  4.  8.100
     libswscale      2.  6.100 /  2.  6.100
     libswresample   0. 19.100 /  0. 19.100
     libpostproc    52.  3.100 / 52.  3.100
    Input #0, mpegts, from '/transcodes/original/883_1000_1403436916_00001.MTS':
     Duration: 00:04:11.74, start: 0.382511, bitrate: 25222 kb/s
     Program 1
       Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc
       Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 384 kb/s
       Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080
    [swscaler @ 0x216fe40] deprecated pixel format used, make sure you did set range correctly
    [swscaler @ 0x2188c20] deprecated pixel format used, make sure you did set range correctly
    [libx264 @ 0x2143e60] using SAR=1/1
    [libx264 @ 0x2143e60] MB rate (489110) > level limit (245760)
    [libx264 @ 0x2143e60] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
    [libx264 @ 0x2143e60] profile High, level 4.0
    [libx264 @ 0x2143e60] 264 - core 142 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - 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=2 lookahead_threads=2 sliced_threads=1 slices=2 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=0 rc=crf mbtree=0 crf=20.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=6000 vbv_bufsize=12000 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
    [libx264 @ 0x2150680] using SAR=160/159
    [libx264 @ 0x2150680] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
    [libx264 @ 0x2150680] profile Main, level 3.1
    [libx264 @ 0x2150680] 264 - core 142 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=2 lookahead_threads=2 sliced_threads=1 slices=2 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=0 rc=crf mbtree=0 crf=25.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=1400 vbv_bufsize=1400 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to '/transcodes/883_1000_1403436916_00001_HQ.mp4':
     Metadata:
       encoder         : Lavf55.43.100
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, max. 6000 kb/s, 59.94 fps, 60k tbn, 59.94 tbc
       Metadata:
         encoder         : Lavc55.66.100 libx264
       Stream #0:1: Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 48000 Hz, 5.1, s16, 256 kb/s
       Metadata:
         encoder         : Lavc55.66.100 libfdk_aac
    Output #1, mp4, to '/transcodes/883_1000_1403436916_00001_SQ.mp4':
     Metadata:
       encoder         : Lavf55.43.100
       Stream #1:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 848x480 [SAR 160:159 DAR 16:9], q=-1--1, max. 1400 kb/s, 59.94 fps, 60k tbn, 59.94 tbc
       Metadata:
         encoder         : Lavc55.66.100 libx264
       Stream #1:1: Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 48000 Hz, 5.1, s16, 256 kb/s
       Metadata:
         encoder         : Lavc55.66.100 libfdk_aac
    Output #2, image2, to '/transcodes/883_1000_1403436916_00001_poster.jpg':
     Metadata:
       encoder         : Lavf55.43.100
       Stream #2:0: Video: mjpeg, yuvj420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 59.94 fps, 90k tbn, 59.94 tbc
       Metadata:
         encoder         : Lavc55.66.100 mjpeg
    Output #3, image2, to '/transcodes/883_1000_1403436916_00001_thumb.jpg':
     Metadata:
       encoder         : Lavf55.43.100
       Stream #3:0: Video: mjpeg, yuvj420p, 427x240 [SAR 1280:1281 DAR 16:9], q=2-31, 200 kb/s, 59.94 fps, 90k tbn, 59.94 tbc
       Metadata:
         encoder         : Lavc55.66.100 mjpeg
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
     Stream #0:1 -> #0:1 (ac3 (native) -> aac (libfdk_aac))
     Stream #0:0 -> #1:0 (h264 (native) -> h264 (libx264))
     Stream #0:1 -> #1:1 (ac3 (native) -> aac (libfdk_aac))
     Stream #0:0 -> #2:0 (h264 (native) -> mjpeg (mjpeg))
     Stream #0:0 -> #3:0 (h264 (native) -> mjpeg (mjpeg))
    frame=15090 fps=1.0 q=39.0 q=30.0 q=6.6 q=4.3 size=  193843kB time=00:04:11.75 bitrate=6307.7kbits/s dup=0 drop=15088    
    [mp4 @ 0x210ae00] Starting second pass: moving the moov atom to the beginning of the file
    [mp4 @ 0x210ae00] Unable to re-open /transcodes/883_1000_1403436916_00001_HQ.mp4 output file for the second pass (faststart)
    [mp4 @ 0x214fc20] Starting second pass: moving the moov atom to the beginning of the file
    [mp4 @ 0x214fc20] Unable to re-open /transcodes/883_1000_1403436916_00001_SQ.mp4 output file for the second pass (faststart)
    frame=15090 fps=1.0 q=39.0 Lq=30.0 q=6.6 q=4.3 size=  193843kB time=00:04:11.77 bitrate=6307.1kbits/s dup=0 drop=15088    
    video:212914kB audio:15741kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
    [libx264 @ 0x2143e60] frame I:162   Avg QP:23.31  size: 38205
    [libx264 @ 0x2143e60] frame P:14928 Avg QP:25.47  size: 12322
    [libx264 @ 0x2143e60] mb I  I16..4: 24.9% 70.4%  4.6%
    [libx264 @ 0x2143e60] mb P  I16..4:  2.2%  3.2%  0.0%  P16..4: 38.3%  3.7%  4.3%  0.0%  0.0%    skip:48.3%
    [libx264 @ 0x2143e60] 8x8 transform intra:60.6% inter:94.6%
    [libx264 @ 0x2143e60] coded y,uvDC,uvAC intra: 25.5% 50.7% 2.8% inter: 9.7% 17.3% 0.0%
    [libx264 @ 0x2143e60] i16 v,h,dc,p: 43% 17% 10% 29%
    [libx264 @ 0x2143e60] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 30% 13% 34%  4%  4%  4%  5%  3%  3%
    [libx264 @ 0x2143e60] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 37% 18% 13%  5%  7%  6%  7%  4%  3%
    [libx264 @ 0x2143e60] i8c dc,h,v,p: 64% 15% 19%  2%
    [libx264 @ 0x2143e60] Weighted P-Frames: Y:0.2% UV:0.0%
    [libx264 @ 0x2143e60] ref P L0: 67.7% 14.5% 13.8%  4.0%  0.0%
    [libx264 @ 0x2143e60] kb/s:6042.08
    [libx264 @ 0x2150680] frame I:72    Avg QP:24.70  size: 14016
    [libx264 @ 0x2150680] frame P:15018 Avg QP:28.46  size:  1783
    [libx264 @ 0x2150680] mb I  I16..4: 39.4%  0.0% 60.6%
    [libx264 @ 0x2150680] mb P  I16..4:  0.8%  0.0%  0.3%  P16..4: 36.3%  4.1%  2.6%  0.0%  0.0%    skip:56.0%
    [libx264 @ 0x2150680] coded y,uvDC,uvAC intra: 32.1% 41.1% 7.1% inter: 3.9% 6.6% 0.1%
    [libx264 @ 0x2150680] i16 v,h,dc,p: 50% 12% 10% 27%
    [libx264 @ 0x2150680] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 34% 15% 22%  5%  5%  5%  6%  5%  3%
    [libx264 @ 0x2150680] i8c dc,h,v,p: 67% 11% 19%  3%
    [libx264 @ 0x2150680] Weighted P-Frames: Y:0.7% UV:0.1%
    [libx264 @ 0x2150680] ref P L0: 65.0% 22.3% 10.0%  2.6%  0.0%
    [libx264 @ 0x2150680] kb/s:882.93

    I’ve tried adding sleep(5) after :

           exec($cmd, $out, $ret);

    to give the script time to move the moov atom to the front before uploading the local file to s3 and then deleting the local file, but it is not 100% reliable.

    Any ideas ?