Recherche avancée

Médias (91)

Autres articles (55)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • Dépôt de média et thèmes par FTP

    31 mai 2013, par

    L’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
    Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)

Sur d’autres sites (4910)

  • 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);
  • Running ffmpeg command on Android results in "Unable to find a suitable output format for ' -map 0:v:0 -map 1:a:0'"

    5 juin 2017, par Akash Dubey

    I am using this command for replacing audio of video and genrate new video having new audio. Here file1 is my video.mp4, file2 is my audio.mp3 and output would be the output.mp4 :

    complexCommand = new String[]{"-y", "-i", file1.toString(), "-i", file2.toString(), "-c", "copy", " -map 0:v:0 -map 1:a:0", rootPath + "/output.mp4"};

    Below is My code :

       private void changeAudioofVideo(String selectedUri, String videoPath) {

       String[] complexCommand;


       File f = new File("/storage/emulated/0");
       if (!f.getParentFile().exists())
           f.getParentFile().mkdirs();
       if (!f.exists())
           try {
               f.createNewFile();
           } catch (IOException e) {
               e.printStackTrace();
           }

       file1 = new File(videoPath);
       if (file1.exists()) {
           Log.d("yes", "File 1 exists");
       } else {
           Log.d("no", "File 1 not exists");
       }

       file2 = new File(selectedUri);
       if (file2.exists()) {
           Log.d("yes", "File 1 exists");
       } else {
           Log.d("no", "File 1 not exists");
       }

       String rootPath = f.getPath();

       complexCommand = new String[]{"-y", "-i", file1.toString(), "-i", file2.toString(), "-c", "copy", " -map 0:v:0 -map 1:a:0", rootPath + "/output.mp4"};

       FFmpeg ffmpeg = FFmpeg.getInstance(this);

       try {
           //Load the binary
           ffmpeg.loadBinary(new LoadBinaryResponseHandler() {

               @Override
               public void onStart() {
               }

               @Override
               public void onFailure() {
               }

               @Override
               public void onSuccess() {
               }

               @Override
               public void onFinish() {
               }
           });
       } catch (FFmpegNotSupportedException e) {
           // Handle if FFmpeg is not supported by device
           Toast.makeText(getApplicationContext(), "Not Supported by Device", Toast.LENGTH_LONG).show();
       }

       try {

           final String finalRootPath = rootPath;
           ffmpeg.execute(complexCommand, new FFmpegExecuteResponseHandler() {
               @Override
               public void onSuccess(String message) {
                   Log.d("Success", message);

                   Toast.makeText(getApplicationContext(), "Successful" + finalRootPath.toString(), Toast.LENGTH_LONG).show();
                   Uri path = Uri.parse(finalRootPath + "/output.mp4");
                   playVideo(path.toString());

               }

               @Override
               public void onProgress(String message) {
                   Log.d("progress", message);
                   pd.show();
               }

               @Override
               public void onFailure(String message) {
                   Log.d("failure", message);
                   pd.dismiss();

               }

               @Override
               public void onStart() {
                   Log.d("Start", "merge started");
               }

               @Override
               public void onFinish() {
                   Log.d("finish", "merge finish");
                   pd.dismiss();
               }
           });
       } catch (FFmpegCommandAlreadyRunningException e) {
           e.printStackTrace();
       }


      }

    Below is my output :

      05-26 18:39:35.533 29188-29188/com.example.codal.videotm D/failure: 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-and    roid/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/videokit/out2.mp4':
                                                                     Metadata:
                                                                       major_brand     : isom
                                                                       minor_version   : 512
                                                                       compatible_brands: isomiso2mp41
                                                                       encoder         : Lavf56.23.100
                                                                       comment         : Courtesy of National Geographic.  Used by Permission.
                                                                     Duration: 00:00:04.20, start: 0.046440, bitrate: 577 kb/s
                                                                       Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 160x120 [SAR 9:16 DAR 3:4], 521 kb/s, 30 fps, 30 tbr, 15360 tbn, 30 tbc (default)
                                                                       Metadata:
                                                                         handler_name    : VideoHandler
                                                                       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 22050 Hz, stereo, fltp, 50 kb/s (default)
                                                                       Metadata:
                                                                         handler_name    : SoundHandler
                                                                   [mp3 @ 0xb86ade60] Skipping 0 bytes of junk at 132692.
                                                                   [mjpeg @ 0xb86c9980] Changing bps to 8
                                                                   [mp3 @ 0xb86ade60] Estimating duration from bitrate, this may be inaccurate
                                                                   Input #1, mp3, from '/storage/emulated/0/Download/01 Kaari Kaari - Dobaara.mp3':
                                                                     Metadata:
                                                                       album           : Dobaara (SongsMp3.Co)
                                                                       artist          : Arko , Asees Kaur
                                                                       album_artist    : Arko &amp; Asees Kaur
                                                                       composer        : Arko
                                                                       performer       : SongsMp3.Co
                                                                       copyright       : SongsMp3.Co
                                                                       disc            : 1/1
                                                                       encoded_by      : iTunes 12.6.0.100
                                                                       genre           : Bollywood
                                                                       TEXT            : SongsMp3.Co
                                                                       TPE4            : SongsMp3.Co
                                                                       TRSN            : SongsMp3.Co
                                                                       TOPE            : SongsMp3.Co
                                                                       TOLY            : SongsMp3.Co
                                                                       publisher       : SongsMp3.Co
                                                                       title           : Kaari Kaari (SongsMp3.Co)
                                                                       track           : 1/1
                                                                       date            : 2017
                                                                     Duration: 00:03:46.72, start: 0.000000, bitrate: 324 kb/s
                                                                       Stream #1:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s
                                                                       Stream #1:1: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 600x600 [SAR 96:96 DAR 1:1], 90k tbr, 90k tbn, 90k tbc
                                                                       Metadata:
                                                                         comment         : Cover (front)
                                                                   [NULL @ 0xb86cab70] Unable to find a suitable output format for ' -map 0:v:0 -map 1:a:0'
                                                                    -map 0:v:0 -map 1:a:0: Invalid argument
    05-26 18:39:35.543 29188-29188/com.example.codal.videotm D/ViewRootImpl: #3 mView = null
    05-26 18:39:35.543 29188-29188/com.example.codal.videotm D/finish: merge finish
  • FFmpeg fontcolor_expr to dynamically change fontcolor over time

    26 juin 2017, par Matthew

    I’m using Fluent-FFmpeg with Node.JS to create videos with text overlaid on them and I’m wanting to change the color of the text as the video progresses.

    My filters follow this pattern :

    drawtext=enable='between(t,18.93,20.28)':fontfile=fonts/cousine-bold.ttf:fontsize=144:fontcolor_expr=%{expr\\\: if(between(t\\, 0\\, 20)\\, 888888\\, 111111)}:x=82:y=288:text='PROGRAMMING'

    And it prints out this stuff :

    ffmpeg version 3.3.2 Copyright (c) 2000-2017 the FFmpeg developers
     built with Apple LLVM version 8.1.0 (clang-802.0.42)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libfreetype --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda
     libavutil      55. 58.100 / 55. 58.100
     libavcodec     57. 89.100 / 57. 89.100
     libavformat    57. 71.100 / 57. 71.100
     libavdevice    57.  6.100 / 57.  6.100
     libavfilter     6. 82.100 /  6. 82.100
     libavresample   3.  5.  0 /  3.  5.  0
     libswscale      4.  6.100 /  4.  6.100
     libswresample   2.  7.100 /  2.  7.100
     libpostproc    54.  5.100 / 54.  5.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'uploads/0c719e39820366bc62c8fd66a6327828':
     Metadata:
       major_brand     : qt  
       minor_version   : 0
       compatible_brands: qt  
       creation_time   : 2017-06-23T00:19:46.000000Z
       com.apple.quicktime.make: Apple
       com.apple.quicktime.model: MacBookPro9,2
       com.apple.quicktime.software: Mac OS X 10.12.5 (16F73)
       com.apple.quicktime.creationdate: 2017-06-22T17:18:42-0700
     Duration: 00:00:22.00, start: 0.000000, bitrate: 3408 kb/s
       Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 3091 kb/s, 15 fps, 15 tbr, 30k tbn, 50 tbc (default)
       Metadata:
         creation_time   : 2017-06-23T00:19:46.000000Z
         handler_name    : Core Media Data Handler
         encoder         : H.264
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 316 kb/s (default)
       Metadata:
         creation_time   : 2017-06-23T00:19:46.000000Z
         handler_name    : Core Media Data Handler
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
     Stream #0:1 -> #0:1 (aac (native) -> aac (native))
    Press [q] to stop, [?] for help
    [libx264 @ 0x7ff72e810a00] using SAR=1/1
    [libx264 @ 0x7ff72e810a00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    [libx264 @ 0x7ff72e810a00] profile High, level 3.1
    [libx264 @ 0x7ff72e810a00] 264 - core 148 r2748 97eaef2 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0     direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=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
    Output #0, mp4, to './outputFile.mp4':
     Metadata:
       major_brand     : qt  
       minor_version   : 0
       compatible_brands: qt  
       com.apple.quicktime.creationdate: 2017-06-22T17:18:42-0700
       com.apple.quicktime.make: Apple
       com.apple.quicktime.model: MacBookPro9,2
       com.apple.quicktime.software: Mac OS X 10.12.5 (16F73)
       encoder         : Lavf57.71.100
       Stream #0:0(und): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 15 fps, 15360 tbn, 15 tbc (default)
       Metadata:
         creation_time   : 2017-06-23T00:19:46.000000Z
         handler_name    : Core Media Data Handler
         encoder         : Lavc57.89.100 libx264
       Side data:
         cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
       Stream #0:1(und): Audio: aac (LC) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp, 128 kb/s (default)
       Metadata:
         creation_time   : 2017-06-23T00:19:46.000000Z
         handler_name    : Core Media Data Handler
         encoder         : Lavc57.89.100 aac
    frame=   52 fps=0.0 q=27.0 size=      37kB time=00:00:04.66 bitrate=  65.7kbits/s speed=8.74x    
    frame=   72 fps= 70 q=27.0 size=     187kB time=00:00:06.03 bitrate= 253.4kbits/s speed=5.83x    
    frame=   95 fps= 61 q=27.0 size=     358kB time=00:00:07.52 bitrate= 390.4kbits/s speed=4.82x    
    frame=  117 fps= 57 q=27.0 size=     569kB time=00:00:08.98 bitrate= 518.9kbits/s speed=4.35x    
    frame=  137 fps= 53 q=27.0 size=     732kB time=00:00:10.32 bitrate= 580.2kbits/s speed=4.03x    
    frame=  159 fps= 52 q=27.0 size=     942kB time=00:00:11.79 bitrate= 654.7kbits/s speed=3.84x    
    frame=  180 fps= 50 q=27.0 size=    1110kB time=00:00:13.18 bitrate= 689.5kbits/s speed=3.67x    
    frame=  204 fps= 50 q=27.0 size=    1331kB time=00:00:14.78 bitrate= 737.2kbits/s speed= 3.6x    
    frame=  223 fps= 48 q=27.0 size=    1486kB time=00:00:16.06 bitrate= 757.9kbits/s speed=3.49x    
    frame=  248 fps= 48 q=27.0 size=    1708kB time=00:00:17.71 bitrate= 789.7kbits/s speed=3.46x    
    frame=  266 fps= 47 q=27.0 size=    1859kB time=00:00:18.92 bitrate= 805.0kbits/s speed=3.35x    
    frame=  285 fps= 46 q=27.0 size=    2013kB time=00:00:20.19 bitrate= 816.4kbits/s speed=3.28x    
    [drawtext @ 0x7ff72d84bc00] Cannot find color '888888.000000'
       Last message repeated 9 times
    frame=  308 fps= 46 q=27.0 size=    2224kB time=00:00:21.75 bitrate= 837.5kbits/s speed=3.27x    
    frame=  330 fps= 46 q=27.0 size=    2401kB time=00:00:21.96 bitrate= 895.5kbits/s speed=3.06x    
    frame=  330 fps= 41 q=-1.0 Lsize=    2834kB time=00:00:22.00 bitrate=1055.0kbits/s speed=2.73x    
    video:2484kB audio:338kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.441003%
    [libx264 @ 0x7ff72e810a00] frame I:22    Avg QP:13.64  size: 47604
    [libx264 @ 0x7ff72e810a00] frame P:154   Avg QP:16.76  size:  8574
    [libx264 @ 0x7ff72e810a00] frame B:154   Avg QP:19.42  size:  1138
    [libx264 @ 0x7ff72e810a00] consecutive B-frames:  6.7% 93.3%  0.0%  0.0%
    [libx264 @ 0x7ff72e810a00] mb I  I16..4: 85.1% 13.3%  1.6%
    [libx264 @ 0x7ff72e810a00] mb P  I16..4:  5.5%  3.1%  0.0%  P16..4: 41.5%  4.0%  5.5%  0.0%  0.0%    skip:40.4%
    [libx264 @ 0x7ff72e810a00] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8: 14.7%  0.1%  0.0%  direct: 4.7%  skip:80.4%  L0:28.0% L1:71.4% BI: 0.7%
    [libx264 @ 0x7ff72e810a00] 8x8 transform intra:21.7% inter:84.8%
    [libx264 @ 0x7ff72e810a00] coded y,uvDC,uvAC intra: 60.5% 98.6% 92.9% inter: 6.0% 24.3% 3.1%
    [libx264 @ 0x7ff72e810a00] i16 v,h,dc,p: 35% 19% 43%  3%
    [libx264 @ 0x7ff72e810a00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10%  7% 80%  1%  1%  1%  1%  0%  0%
    [libx264 @ 0x7ff72e810a00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 33% 20% 45%  0%  0%  0%  0%  0%  0%
    [libx264 @ 0x7ff72e810a00] i8c dc,h,v,p: 77%  9% 10%  4%
    [libx264 @ 0x7ff72e810a00] Weighted P-Frames: Y:0.0% UV:0.0%
    [libx264 @ 0x7ff72e810a00] ref P L0: 75.3%  0.3% 17.1%  7.3%
    [libx264 @ 0x7ff72e810a00] ref B L0: 80.0% 20.0%
    [libx264 @ 0x7ff72e810a00] kb/s:924.66
    [aac @ 0x7ff72e812200] Qavg: 2159.960

    In particular this annoying bit :

    [drawtext @ 0x7ff72d84bc00] Cannot find color '888888.000000'

    However, it would be really nice to do something like this :

    fontcolor_expr=%{expr\\\\: if(between(t\\, 0\\, 20)\\, pink\\, white)}

    Which prints out this error :

    [Parsed_drawtext_0 @ 0x7ff3cf523300] [Eval @ 0x7fff5f7760c0] Undefined constant or missing '(' in 'pink,white)'
    [Parsed_drawtext_0 @ 0x7ff3cf523300] [Eval @ 0x7fff5f7760c0] Missing ')' or too many args in 'if(between(t,0,20),pink,white)'
    [Parsed_drawtext_0 @ 0x7ff3cf523300] Expression 'if(between(t, 0, 20), pink, white)' for the expr text expansion function is not valid
    frame=  287 fps= 46 q=27.0 size=    2023kB time=00:00:20.31 bitrate= 815.9kbits/s speed=3.27x    
    [Parsed_drawtext_0 @ 0x7ff3cf523300] [Eval @ 0x7fff5f7760c0] Undefined constant or missing '(' in 'pink,white)'
    [Parsed_drawtext_0 @ 0x7ff3cf523300] [Eval @ 0x7fff5f7760c0] Missing ')' or too many args in 'if(between(t,0,20),pink,white)'
    [Parsed_drawtext_0 @ 0x7ff3cf523300] Expression 'if(between(t, 0, 20), pink, white)' for the expr text expansion function is not valid
    [Parsed_drawtext_0 @ 0x7ff3cf523300] [Eval @ 0x7fff5f7760c0] Undefined constant or missing '(' in 'pink,white)'
    [Parsed_drawtext_0 @ 0x7ff3cf523300] [Eval @ 0x7fff5f7760c0] Missing ')' or too many args in 'if(between(t,0,20),pink,white)'
    [Parsed_drawtext_0 @ 0x7ff3cf523300] Expression 'if(between(t, 0, 20), pink, white)' for the expr text expansion function is not valid
    [Parsed_drawtext_0 @ 0x7ff3cf523300] [Eval @ 0x7fff5f7760c0] Undefined constant or missing '(' in 'pink,white)'
    [Parsed_drawtext_0 @ 0x7ff3cf523300] [Eval @ 0x7fff5f7760c0] Missing ')' or too many args in 'if(between(t,0,20),pink,white)'
    [Parsed_drawtext_0 @ 0x7ff3cf523300] Expression 'if(between(t, 0, 20), pink, white)' for the expr text expansion function is not valid
    [Parsed_drawtext_0 @ 0x7ff3cf523300] [Eval @ 0x7fff5f7760c0] Undefined constant or missing '(' in 'pink,white)'
    [Parsed_drawtext_0 @ 0x7ff3cf523300] [Eval @ 0x7fff5f7760c0] Missing ')' or too many args in 'if(between(t,0,20),pink,white)'
    [Parsed_drawtext_0 @ 0x7ff3cf523300] Expression 'if(between(t, 0, 20), pink, white)' for the expr text expansion function is not valid
    [Parsed_drawtext_0 @ 0x7ff3cf523300] [Eval @ 0x7fff5f7760c0] Undefined constant or missing '(' in 'pink,white)'
    [Parsed_drawtext_0 @ 0x7ff3cf523300] [Eval @ 0x7fff5f7760c0] Missing ')' or too many args in 'if(between(t,0,20),pink,white)'
    [Parsed_drawtext_0 @ 0x7ff3cf523300] Expression 'if(between(t, 0, 20), pink, white)' for the expr text expansion function is not valid
    [Parsed_drawtext_0 @ 0x7ff3cf523300] [Eval @ 0x7fff5f7760c0] Undefined constant or missing '(' in 'pink,white)'
    [Parsed_drawtext_0 @ 0x7ff3cf523300] [Eval @ 0x7fff5f7760c0] Missing ')' or too many args in 'if(between(t,0,20),pink,white)'
    [Parsed_drawtext_0 @ 0x7ff3cf523300] Expression 'if(between(t, 0, 20), pink, white)' for the expr text expansion function is not valid
    [Parsed_drawtext_0 @ 0x7ff3cf523300] [Eval @ 0x7fff5f7760c0] Undefined constant or missing '(' in 'pink,white)'
    [Parsed_drawtext_0 @ 0x7ff3cf523300] [Eval @ 0x7fff5f7760c0] Missing ')' or too many args in 'if(between(t,0,20),pink,white)'
    [Parsed_drawtext_0 @ 0x7ff3cf523300] Expression 'if(between(t, 0, 20), pink, white)' for the expr text expansion function is not valid
    [Parsed_drawtext_0 @ 0x7ff3cf523300] [Eval @ 0x7fff5f7760c0] Undefined constant or missing '(' in 'pink,white)'
    [Parsed_drawtext_0 @ 0x7ff3cf523300] [Eval @ 0x7fff5f7760c0] Missing ')' or too many args in 'if(between(t,0,20),pink,white)'
    [Parsed_drawtext_0 @ 0x7ff3cf523300] Expression 'if(between(t, 0, 20), pink, white)' for the expr text expansion function is not valid
    [Parsed_drawtext_0 @ 0x7ff3cf523300] [Eval @ 0x7fff5f7760c0] Undefined constant or missing '(' in 'pink,white)'
    [Parsed_drawtext_0 @ 0x7ff3cf523300] [Eval @ 0x7fff5f7760c0] Missing ')' or too many args in 'if(between(t,0,20),pink,white)'
    [Parsed_drawtext_0 @ 0x7ff3cf523300] Expression 'if(between(t, 0, 20), pink, white)' for the expr text expansion function is not valid

    There aren’t a lot of examples of fontcolor_expr, so I wanted to see if anyone had experience with this. Any tips on changing fonrcolors dynamically without creating multiple filters ?

    Please note that fontcolor_expr=white and fontcolor_expr=888888 are valid and create videos with a fixed font color.