Recherche avancée

Médias (1)

Mot : - Tags -/ogg

Autres articles (65)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 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 (...)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, 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 (...)

Sur d’autres sites (7787)

  • android - ffmpeg output audio contains garbled sound at the end

    31 mai 2017, par Sha

    I’m converting an audio (recorded via android phone with output type MPEG_4 and encoder DEFAULT) to mp3 using ffmpeg like this :

    -y -i /data/user/0/com.whispero.mithoo/files/input.mp3 -codec:a libmp3lame -qscale:a 2 /data/user/0/com.whispero.mithoo/files/output.mp3

    if the input audio is >20 seconds, there’s garbled audio at the end in the converted output file, otherwise if it’s <20 seconds, the output is fine.

    log :

    05-31 15:54:41.760 11922-11922/com.home.myapp E/onStart: onStart
    05-31 15:54:41.788 11922-11922/com.home.myapp E/first visible: 18: 4: total22,last:21
    05-31 15:54:42.046 11922-11922/com.home.myapp E/onProgress: ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
    05-31 15:54:42.046 11922-11922/com.home.myapp E/onProgress:   built with gcc 4.8 (GCC)
    05-31 15:54:42.047 11922-11922/com.home.myapp E/onProgress:   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=
    05-31 15:54:42.047 11922-11922/com.home.myapp E/onProgress:   libavutil      55. 17.103 / 55. 17.103
    05-31 15:54:42.047 11922-11922/com.home.myapp E/onProgress:   libavcodec     57. 24.102 / 57. 24.102
    05-31 15:54:42.047 11922-11922/com.home.myapp E/onProgress:   libavformat    57. 25.100 / 57. 25.100
    05-31 15:54:42.048 11922-11922/com.home.myapp E/onProgress:   libavdevice    57.  0.101 / 57.  0.101
    05-31 15:54:42.048 11922-11922/com.home.myapp E/onProgress:   libavfilter     6. 31.100 /  6. 31.100
    05-31 15:54:42.048 11922-11922/com.home.myapp E/onProgress:   libswscale      4.  0.100 /  4.  0.100
    05-31 15:54:42.048 11922-11922/com.home.myapp E/onProgress:   libswresample   2.  0.101 /  2.  0.101
    05-31 15:54:42.049 11922-11922/com.home.myapp E/onProgress:   libpostproc    54.  0.100 / 54.  0.100
    05-31 15:54:42.053 11922-11922/com.home.myapp E/onProgress: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/com.home.myapp/files/166_31052017155411.mp3':
    05-31 15:54:42.053 11922-11922/com.home.myapp E/onProgress:   Metadata:
    05-31 15:54:42.053 11922-11922/com.home.myapp E/onProgress:     major_brand     : mp42
    05-31 15:54:42.054 11922-11922/com.home.myapp E/onProgress:     minor_version   : 0
    05-31 15:54:42.054 11922-11922/com.home.myapp E/onProgress:     compatible_brands: isommp42
    05-31 15:54:42.054 11922-11922/com.home.myapp E/onProgress:     creation_time   : 2017-05-31 10:54:41
    05-31 15:54:42.055 11922-11922/com.home.myapp E/onProgress:     com.android.version: 6.0.1
    05-31 15:54:42.055 11922-11922/com.home.myapp E/onProgress:   Duration: 00:00:29.98, start: 0.000000, bitrate: 15 kb/s
    05-31 15:54:42.056 11922-11922/com.home.myapp E/onProgress:     Stream #0:0(eng): Audio: amr_nb (samr / 0x726D6173), 8000 Hz, mono, flt, 12 kb/s (default)
    05-31 15:54:42.057 11922-11922/com.home.myapp E/onProgress:     Metadata:
    05-31 15:54:42.059 11922-11922/com.home.myapp E/onProgress:       creation_time   : 2017-05-31 10:54:41
    05-31 15:54:42.059 11922-11922/com.home.myapp E/onProgress:       handler_name    : SoundHandle
    05-31 15:54:42.089 11922-11922/com.home.myapp E/onProgress: Output #0, mp3, to '/data/user/0/com.home.myapp/files/166_31052017155411.mp3':
    05-31 15:54:42.090 11922-11922/com.home.myapp E/onProgress:   Metadata:
    05-31 15:54:42.090 11922-11922/com.home.myapp E/onProgress:     major_brand     : mp42
    05-31 15:54:42.091 11922-11922/com.home.myapp E/onProgress:     minor_version   : 0
    05-31 15:54:42.092 11922-11922/com.home.myapp E/onProgress:     compatible_brands: isommp42
    05-31 15:54:42.093 11922-11922/com.home.myapp E/onProgress:     com.android.version: 6.0.1
    05-31 15:54:42.095 11922-11922/com.home.myapp E/onProgress:     TSSE            : Lavf57.25.100
    05-31 15:54:42.095 11922-11922/com.home.myapp E/onProgress:     Stream #0:0(eng): Audio: mp3 (libmp3lame), 8000 Hz, mono, fltp (default)
    05-31 15:54:42.096 11922-11922/com.home.myapp E/onProgress:     Metadata:
    05-31 15:54:42.097 11922-11922/com.home.myapp E/onProgress:       creation_time   : 2017-05-31 10:54:41
    05-31 15:54:42.098 11922-11922/com.home.myapp E/onProgress:       handler_name    : SoundHandle
    05-31 15:54:42.098 11922-11922/com.home.myapp E/onProgress:       encoder         : Lavc57.24.102 libmp3lame
    05-31 15:54:42.099 11922-11922/com.home.myapp E/onProgress: Stream mapping:
    05-31 15:54:42.100 11922-11922/com.home.myapp E/onProgress:   Stream #0:0 -> #0:0 (amr_nb (amrnb) -> mp3 (libmp3lame))
    05-31 15:54:42.100 11922-11922/com.home.myapp E/onProgress: Press [q] to stop, [?] for help
    05-31 15:54:42.595 11922-11922/com.home.myapp E/onProgress: size=      18kB time=00:00:05.54 bitrate=  27.0kbits/s speed=11.1x    
    05-31 15:54:43.096 11922-11922/com.home.myapp E/onProgress: size=      43kB time=00:00:13.32 bitrate=  26.6kbits/s speed=13.3x    
    05-31 15:54:43.518 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.518 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.525 11922-11922/com.home.myapp E/onProgress: Multiple frames in a packet from stream 0
    05-31 15:54:43.525 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.538 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.540 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.540 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.541 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.541 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.542 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.543 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.543 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] dtx mode is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
    05-31 15:54:43.544 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Note: libopencore_amrnb supports dtx
    05-31 15:54:43.544 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Not yet implemented in FFmpeg, patches welcome
    05-31 15:54:43.545 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.546 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.546 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.547 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.547 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.548 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.549 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.549 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.550 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.551 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.551 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.552 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.552 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.553 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.554 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.555 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.556 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] dtx mode is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
    05-31 15:54:43.557 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Note: libopencore_amrnb supports dtx
    05-31 15:54:43.558 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Not yet implemented in FFmpeg, patches welcome
    05-31 15:54:43.559 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] dtx mode is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
    05-31 15:54:43.560 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Note: libopencore_amrnb supports dtx
    05-31 15:54:43.561 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Not yet implemented in FFmpeg, patches welcome
    05-31 15:54:43.562 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:43.563 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:43.563 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.519 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Not yet implemented in FFmpeg, patches welcome
    05-31 15:54:44.521 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.522 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.523 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.524 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.526 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.527 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.530 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.531 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.532 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.533 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.534 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.535 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.536 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.537 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.538 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.539 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.540 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.541 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.542 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.543 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.544 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.545 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.546 11922-11922/com.home.myapp E/onProgress: [amrnb @ 0xb5bc3400] Corrupt bitstream
    05-31 15:54:44.548 11922-11922/com.home.myapp E/onProgress: Error while decoding stream #0:0: Invalid data found when processing input
    05-31 15:54:44.549 11922-11922/com.home.myapp E/onProgress: size=      90kB time=00:00:30.03 bitrate=  24.6kbits/s speed=16.6x    
    05-31 15:54:44.556 11922-11922/com.home.myapp E/onProgress: video:0kB audio:90kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.425926%
    05-31 15:54:44.558 11922-11922/com.home.myapp E/SUCCESS: SUCCESS
    05-31 15:54:44.558 11922-11922/com.home.myapp E/onFinish: onFinish

    My MediaRecorder settings are :

    mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
    mRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
    mRecorder.setAudioSamplingRate(24000);
    mRecorder.setAudioEncodingBitRate(32000);
    Log.e("Path","Createdfilepath:"+mFile.getPath());
    mRecorder.setOutputFile(mFile.getPath());
    mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
  • How can I compress or change the resolution of the video very fast with FFmpeg ?

    28 mai 2017, par Rares

    I would like to compress or change the resolution of the video before sending it to server but I don’t want to take too long. For example for the following code a video with size 100MB it takes 2-3 min to resize it to 10MB. Can I do it faster without losing too much quality ?

                String[] command = {"-i", filePath, "-vf", "scale=640:360", "-c:a", "copy", "-preset", "ultrafast", dest.getAbsolutePath()};

    Console output for above command :

       05-28 11:50:22.131 23323-23323/com.example.rares.peoplecounterapp D/TestFFmpeg: SUCCESS with output : ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
                                                                                     built with gcc 4.8 (GCC)
                                                                                     configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
                                                                                     libavutil      55. 17.103 / 55. 17.103
                                                                                     libavcodec     57. 24.102 / 57. 24.102
                                                                                     libavformat    57. 25.100 / 57. 25.100
                                                                                     libavdevice    57.  0.101 / 57.  0.101
                                                                                     libavfilter     6. 31.100 /  6. 31.100
                                                                                     libswscale      4.  0.100 /  4.  0.100
                                                                                     libswresample   2.  0.101 /  2.  0.101
                                                                                     libpostproc    54.  0.100 / 54.  0.100
                                                                                   Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/DCIM/Camera/20170501_212606.mp4':
                                                                                     Metadata:
                                                                                       major_brand     : mp42
                                                                                       minor_version   : 0
                                                                                       compatible_brands: isommp42
                                                                                       creation_time   : 2017-05-01 18:26:46
                                                                                       com.android.version: 6.0
                                                                                     Duration: 00:00:38.70, start: 0.000000, bitrate: 17203 kb/s
                                                                                       Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 17007 kb/s, SAR 1:1 DAR 16:9, 29.98 fps, 29.92 tbr, 90k tbn, 180k tbc (default)
                                                                                       Metadata:
                                                                                         creation_time   : 2017-05-01 18:26:46
                                                                                         handler_name    : VideoHandle
                                                                                       Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 155 kb/s (default)
                                                                                       Metadata:
                                                                                         creation_time   : 2017-05-01 18:26:46
                                                                                         handler_name    : SoundHandle
                                                                                   [libx264 @ 0xf7344400] using SAR=1/1
                                                                                   [libx264 @ 0xf7344400] using cpu capabilities: none!
                                                                                   [libx264 @ 0xf7344400] profile Constrained Baseline, level 3.0
                                                                                   [libx264 @ 0xf7344400] 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=9 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/DCIM/Camera/20170501_212606_compressed97.mp4':
                                                                                     Metadata:
                                                                                       major_brand     : mp42
                                                                                       minor_version   : 0
                                                                                       compatible_brands: isommp42
                                                                                       com.android.version: 6.0
                                                                                       encoder         : Lavf57.25.100
                                                                                       Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=-1--1, 29.92 fps, 11488 tbn, 29.92 tbc (default)
                                                                                       Metadata:
                                                                                         creation_time   : 2017-05-01 18:26:46
                                                                                         handler_name    : VideoHandle
                                                                                         encoder         : Lavc57.24.102 libx264
                                                                                       Side data:
                                                                                         unknown side data type 10 (24 bytes)
                                                                                       Stream #0:1(eng): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 155 kb/s (default)
                                                                                       Metadata:
                                                                                         creation_time   : 2017-05-01 18:26:46
                                                                                         handler_name    : SoundHandle
                                                                                   Stream mapping:
                                                                                     Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
                                                                                     Stream #0:1 -> #0:1 (copy)
                                                                                   Press [q] to stop, [?] for help
                                                                                   frame=    6 fps=0.0 q=0.0 size=       0kB time=00:00:01.04 bitrate=   0.4kbits/s speed=1.96x    
                                                                                   frame=   15 fps=
    05-28 11:50:22.132 23323-23323/com.example.rares.peoplecounterapp D/TestFFmpeg: Finished command :ffmpeg [Ljava.lang.String;@d8854f
  • OpenCV VideoWriter using ffmpeg with "Could not open codec 'libx264'" Error

    19 avril, par user2262504

    I am new to OpenCV, and I want write Mat images into video using VideoWriter on Ubuntu 12.04. But when constructing VideoWriter, errors came out.

    &#xA;&#xA;

    It seems that OpenCV invoke ffmpeg API using default parameters and ffmpeg invoke x264 using its default parameters. Then these setting is broken for libx264. Thus the "Could not open codec 'libx264'" error.

    &#xA;&#xA;

    Anyone has ideas to solve this problem ?

    &#xA;&#xA;

    More specifically :

    &#xA;&#xA;

      &#xA;
    1. anyone knows where and how OpenCV invoke ffmpeg API ?
    2. &#xA;

    3. how to change ffmpeg default settings using code, hopefull, can be easily embeded into OpenCV ?
    4. &#xA;

    5. will changes of default in ffmpeg be carried to libx264 ?
    6. &#xA;

    &#xA;&#xA;

    Errors :

    &#xA;&#xA;

    1. Uising CV_FOURCC(&#x27;H&#x27;, &#x27;2&#x27;, &#x27;6&#x27;, &#x27;4&#x27;)&#xA;[libx264 @ 0x255de40] broken ffmpeg default settings detected&#xA;[libx264 @ 0x255de40] use an encoding preset (e.g. -vpre medium)&#xA;[libx264 @ 0x255de40] preset usage: -vpre <speed> -vpre <profile>&#xA;[libx264 @ 0x255de40] speed presets are listed in x264 --help&#xA;[libx264 @ 0x255de40] profile is optional; x264 defaults to high&#xA;Could not open codec &#x27;libx264&#x27;: Unspecified error&#xA;&#xA;2. Using FOURCC = -1 to invoke user customized codec&#xA;OpenCV Error: Unsupported format or combination of formats (Gstreamer Opencv &#xA;backend doesn&#x27;t support this codec acutally.) in CvVideoWriter_GStreamer::open, &#xA;file /home/XXX/Downloads/opencv-2.4.8/modules/highgui/src/cap_gstreamer.cpp, &#xA;line 505 terminate called after throwing an instance of &#x27;cv::Exception&#x27;&#xA;what():  /home/XXX/Downloads/opencv-2.4.8/modules/highgui/src/cap_gstreamer.cpp:&#xA;505: error: (-210) Gstreamer Opencv backend doesn&#x27;t support this codec acutally.&#xA;in function CvVideoWriter_GStreamer::open&#xA;</profile></speed>

    &#xA;&#xA;

    Codes :

    &#xA;&#xA;

    int main(int argc, char *argv[])&#xA;{&#xA;    VideoWriter outputVideo;&#xA;    bool fourcc_on = true; //switch on / off different error&#xA;    if (fourcc_on)&#xA;        outputVideo.open("outVideo.avi", CV_FOURCC(&#x27;H&#x27;, &#x27;2&#x27;, &#x27;6&#x27;, &#x27;4&#x27;), 25, Size(100, 100), true);&#xA;    else&#xA;        outputVideo.open("outVideo.avi", -1, 25, Size(100, 100), true);&#xA;&#xA;    if (!outputVideo.isOpened())&#xA;    {&#xA;        cout  &lt;&lt; "Could not open the output video for write" &lt;&lt; endl;&#xA;        return -1;&#xA;    }&#xA;    return 0;&#xA;}&#xA;

    &#xA;&#xA;

    OpenCV Configuration :

    &#xA;&#xA;

    -- Detected version of GNU GCC: 46 (406)&#xA;-- Found OpenEXR: /usr/lib/libIlmImf.so&#xA;-- Looking for linux/videodev.h&#xA;-- Looking for linux/videodev.h - not found&#xA;-- Looking for linux/videodev2.h&#xA;-- Looking for linux/videodev2.h - found&#xA;-- Looking for sys/videoio.h&#xA;-- Looking for sys/videoio.h - not found&#xA;-- Looking for libavformat/avformat.h&#xA;-- Looking for libavformat/avformat.h - found&#xA;-- Looking for ffmpeg/avformat.h&#xA;-- Looking for ffmpeg/avformat.h - not found&#xA;-- Could NOT find JNI (missing:  JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) &#xA;-- &#xA;-- General configuration for OpenCV 2.4.8 =====================================&#xA;--   Version control:               unknown&#xA;-- &#xA;--   Platform:&#xA;--     Host:                        Linux 3.8.0-38-generic x86_64&#xA;--     CMake:                       2.8.7&#xA;--     CMake generator:             Unix Makefiles&#xA;--     CMake build tool:            /usr/bin/make&#xA;--     Configuration:               RELEASE&#xA;-- &#xA;--   C/C&#x2B;&#x2B;:&#xA;--     Built as dynamic libs?:      YES&#xA;--     C&#x2B;&#x2B; Compiler:                /usr/bin/c&#x2B;&#x2B;  (ver 4.6)&#xA;--     C&#x2B;&#x2B; flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -O3 -DNDEBUG  -DNDEBUG&#xA;--     C&#x2B;&#x2B; flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -g  -O0 -DDEBUG -D_DEBUG&#xA;--     C Compiler:                  /usr/bin/gcc&#xA;--     C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -O3 -DNDEBUG  -DNDEBUG&#xA;--     C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -g  -O0 -DDEBUG -D_DEBUG&#xA;--     Linker flags (Release):      &#xA;--     Linker flags (Debug):        &#xA;--     Precompiled headers:         YES&#xA;-- &#xA;--   OpenCV modules:&#xA;--     To be built:                 core flann imgproc highgui features2d calib3d ml video legacy objdetect photo gpu ocl nonfree contrib python stitching superres ts videostab&#xA;--     Disabled:                    world&#xA;--     Disabled by dependency:      -&#xA;--     Unavailable:                 androidcamera dynamicuda java&#xA;-- &#xA;--   GUI: &#xA;--     QT:                          NO&#xA;--     GTK&#x2B; 2.x:                    YES (ver 2.24.10)&#xA;--     GThread :                    YES (ver 2.32.4)&#xA;--     GtkGlExt:                    NO&#xA;--     OpenGL support:              NO&#xA;-- &#xA;--   Media I/O: &#xA;--     ZLib:                        /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.3.4)&#xA;--     JPEG:                        /usr/lib/x86_64-linux-gnu/libjpeg.so (ver )&#xA;--     PNG:                         /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.2.46)&#xA;--     TIFF:                        /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 - 3.9.5)&#xA;--     JPEG 2000:                   /usr/lib/x86_64-linux-gnu/libjasper.so (ver 1.900.1)&#xA;--     OpenEXR:                     /usr/lib/libImath.so /usr/lib/libIlmImf.so /usr/lib/libIex.so /usr/lib/libHalf.so /usr/lib/libIlmThread.so (ver 1.6.1)&#xA;-- &#xA;--   Video I/O:&#xA;--     DC1394 1.x:                  NO&#xA;--     DC1394 2.x:                  YES (ver 2.2.0)&#xA;--     FFMPEG:                      YES&#xA;--       codec:                     YES (ver 55.58.105)&#xA;--       format:                    YES (ver 55.37.101)&#xA;--       util:                      YES (ver 52.78.100)&#xA;--       swscale:                   YES (ver 2.6.100)&#xA;--       gentoo-style:              YES&#xA;--     GStreamer:                   &#xA;--       base:                      YES (ver 0.10.36)&#xA;--       app:                       YES (ver 0.10.36)&#xA;--       video:                     YES (ver 0.10.36)&#xA;--     OpenNI:                      NO&#xA;--     OpenNI PrimeSensor Modules:  NO&#xA;--     PvAPI:                       NO&#xA;--     GigEVisionSDK:               NO&#xA;--     UniCap:                      NO&#xA;--     UniCap ucil:                 NO&#xA;--     V4L/V4L2:                    Using libv4l (ver 1.0.1)&#xA;--     XIMEA:                       NO&#xA;--     Xine:                        NO&#xA;-- &#xA;--   Other third-party libraries:&#xA;--     Use IPP:                     NO&#xA;--     Use Eigen:                   NO&#xA;--     Use TBB:                     NO&#xA;--     Use OpenMP:                  NO&#xA;--     Use GCD                      NO&#xA;--     Use Concurrency              NO&#xA;--     Use C=:                      NO&#xA;--     Use Cuda:                    NO&#xA;--     Use OpenCL:                  YES&#xA;-- &#xA;--   OpenCL:&#xA;--     Version:                     dynamic&#xA;--     Include path:                /home/shixudongleo/Downloads/opencv-2.4.8/3rdparty/include/opencl/1.2&#xA;--     Use AMD FFT:                 NO&#xA;--     Use AMD BLAS:                NO&#xA;-- &#xA;--   Python:&#xA;--     Interpreter:                 /usr/bin/python (ver 2.7.3)&#xA;--     Libraries:                   /usr/lib/libpython2.7.so&#xA;--     numpy:                       /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.6.1)&#xA;--     packages path:               lib/python2.7/dist-packages&#xA;-- &#xA;--   Java:&#xA;--     ant:                         NO&#xA;--     JNI:                         NO&#xA;--     Java tests:                  NO&#xA;-- &#xA;--   Documentation:&#xA;--     Build Documentation:         NO&#xA;--     Sphinx:                      NO&#xA;--     PdfLaTeX compiler:           /usr/bin/pdflatex&#xA;-- &#xA;--   Tests and samples:&#xA;--     Tests:                       YES&#xA;--     Performance tests:           YES&#xA;--     C/C&#x2B;&#x2B; Examples:              NO&#xA;-- &#xA;--   Install path:                  /usr/local&#xA;-- &#xA;--   cvconfig.h is in:              /home/shixudongleo/Downloads/opencv-2.4.8/build&#xA;-- -----------------------------------------------------------------&#xA;-- &#xA;-- Configuring done&#xA;-- Generating done&#xA;-- Build files have been written to: /home/XXX/Downloads/opencv-2.4.8/build&#xA;

    &#xA;&#xA;

    FFMPEG

    &#xA;&#xA;

    ffmpeg is enable to support OpenCV and libx264 is enabled when compiling ffmpeg.&#xA;By using ffmpeg command line, libx264 is running normally.

    &#xA;&#xA;

    $ ffmpeg -i test.avi -vcodec libx264 test.mp4&#xA;ffmpeg -i test.avi -vcodec libx264 test.mp4 > ~/Downloads/ffmpeg_log.txt&#xA;ffmpeg version 2.2.git Copyright (c) 2000-2014 the FFmpeg developers&#xA;  built on Apr 24 2014 16:39:51 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)&#xA;  configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-shared --enable-pic&#xA;  libavutil      52. 78.100 / 52. 78.100&#xA;  libavcodec     55. 58.105 / 55. 58.105&#xA;  libavformat    55. 37.101 / 55. 37.101&#xA;  libavdevice    55. 13.100 / 55. 13.100&#xA;  libavfilter     4.  4.100 /  4.  4.100&#xA;  libswscale      2.  6.100 /  2.  6.100&#xA;  libswresample   0. 18.100 /  0. 18.100&#xA;  libpostproc    52.  3.100 / 52.  3.100&#xA;Input #0, avi, from &#x27;test.avi&#x27;:&#xA;  Duration: 00:00:03.73, start: 0.000000, bitrate: 1757 kb/s&#xA;    Stream #0:0: Video: msvideo1 (CRAM / 0x4D415243), rgb555le, 320x240, 1781 kb/s, 15 tbr, 15 tbn, 15 tbc&#xA;    Metadata:&#xA;      title           : julius.avi Video #1&#xA;File &#x27;test.mp4&#x27; already exists. Overwrite ? [y/N] y&#xA;No pixel format specified, yuv444p for H.264 encoding chosen.&#xA;Use -pix_fmt yuv420p for compatibility with outdated media players.&#xA;[libx264 @ 0x25d08e0] using cpu capabilities: none!&#xA;[libx264 @ 0x25d08e0] profile High 4:4:4 Predictive, level 1.2, 4:4:4 8-bit&#xA;[libx264 @ 0x25d08e0] 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=4 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=2 keyint=250 keyint_min=15 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00&#xA;Output #0, mp4, to &#x27;test.mp4&#x27;:&#xA;  Metadata:&#xA;    encoder         : Lavf55.37.101&#xA;    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv444p, 320x240, q=-1--1, 15360 tbn, 15 tbc&#xA;    Metadata:&#xA;      title           : julius.avi Video #1&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (msvideo1 -> libx264)&#xA;Press [q] to stop, [?] for help&#xA;frame=   56 fps=0.0 q=-1.0 Lsize=     321kB time=00:00:03.60 bitrate= 731.0kbits/s    &#xA;video:320kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.409949%&#xA;[libx264 @ 0x25d08e0] frame I:3     Avg QP:15.36  size:  7975&#xA;[libx264 @ 0x25d08e0] frame P:38    Avg QP:26.05  size:  6230&#xA;[libx264 @ 0x25d08e0] frame B:15    Avg QP:28.25  size:  4418&#xA;[libx264 @ 0x25d08e0] consecutive B-frames: 46.4% 53.6%  0.0%  0.0%&#xA;[libx264 @ 0x25d08e0] mb I  I16..4:  1.4% 72.8% 25.8%&#xA;[libx264 @ 0x25d08e0] mb P  I16..4:  1.6%  5.7% 15.1%  P16..4:  7.6%  6.3%  7.4%  0.0%  0.0%    skip:56.3%&#xA;[libx264 @ 0x25d08e0] mb B  I16..4:  0.2%  1.0%  2.0%  B16..8: 13.3%  7.8%  8.7%  direct: 8.3%  skip:58.8%  L0:34.9% L1:36.6% BI:28.5%&#xA;[libx264 @ 0x25d08e0] 8x8 transform intra:37.7% inter:2.3%&#xA;[libx264 @ 0x25d08e0] coded y,u,v intra: 52.1% 42.1% 30.1% inter: 19.6% 9.2% 5.2%&#xA;[libx264 @ 0x25d08e0] i16 v,h,dc,p: 56% 17% 24%  2%&#xA;[libx264 @ 0x25d08e0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 16% 68%  1%  1%  1%  1%  1%  1%&#xA;[libx264 @ 0x25d08e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 18% 28%  5%  6%  5%  7%  5%  6%&#xA;[libx264 @ 0x25d08e0] Weighted P-Frames: Y:31.6% UV:21.1%&#xA;[libx264 @ 0x25d08e0] ref P L0: 70.5%  9.0% 12.1%  6.5%  2.0%&#xA;[libx264 @ 0x25d08e0] ref B L0: 91.3%  8.7%&#xA;[libx264 @ 0x25d08e0] kb/s:700.56&#xA;

    &#xA;