Recherche avancée

Médias (3)

Mot : - Tags -/collection

Autres articles (26)

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

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

  • 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 (4432)

  • What is wrong with the following ffmpeg command

    9 juin 2017, par Brad

    What is wrong with the following ffmpeg command ? Originally this had -sameq instead of the -qscale:a 0

    Command :

    ffmpeg -loglevel debug -threads 4 -i sample-in.mpg -ss 00:00:01 -t 00:00:05 -f image2 -y sample-frames/frame%d.png -acodec copy -qscale:a 0  -y sample.mp3

    Output

    ffmpeg version 1.2.1 Copyright (c) 2000-2013 the FFmpeg developers
     built on Jul  9 2013 04:36:42 with Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/1.2.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=cc --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-ffplay
     libavutil      52. 18.100 / 52. 18.100
     libavcodec     54. 92.100 / 54. 92.100
     libavformat    54. 63.104 / 54. 63.104
     libavdevice    54.  3.103 / 54.  3.103
     libavfilter     3. 42.103 /  3. 42.103
     libswscale      2.  2.100 /  2.  2.100
     libswresample   0. 17.102 /  0. 17.102
     libpostproc    52.  2.100 / 52.  2.100

    Splitting the commandline.
    Reading option '-loglevel' ... matched as option 'loglevel' (set libav* logging level) with argument 'debug'.
    Reading option '-threads' ... matched as AVOption 'threads' with argument '4'.
    Reading option '-i' ... matched as input file with argument 'sample-in.mpg'.
    Reading option '-ss' ... matched as option 'ss' (set the start time offset) with argument '00:00:01'.
    Reading option '-t' ... matched as option 't' (record or transcode "duration" seconds of audio/video) with argument '00:00:05'.
    Reading option '-f' ... matched as option 'f' (force format) with argument 'image2'.
    Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
    Reading option 'sample-frames/frame%d.png' ... matched as output file.
    Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'copy'.
    Reading option '-qscale:a' ... matched as option 'qscale' (use fixed quality scale (VBR)) with argument '0'.
    Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
    Reading option 'sample.mp3' ... matched as output file.
    Finished splitting the commandline.
    Parsing a group of options: global .
    Applying option loglevel (set libav* logging level) with argument debug.
    Applying option y (overwrite output files) with argument 1.
       Last message repeated 1 times
    Successfully parsed a group of options.
    Parsing a group of options: input file sample-in.mpg.
    Successfully parsed a group of options.
    Opening an input file: sample-in.mpg.
    [mpeg @ 0x7ffb4a80f200] Format mpeg probed with size=16384 and score=52
    [mpeg @ 0x7ffb4a80f200] File position before avformat_find_stream_info() is 0
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2500
    [mpeg @ 0x7ffb4a80f200] Probe with size=2002, packets=1 detected mpegvideo with score=25
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2499
    [mpeg @ 0x7ffb4a80f200] Probe with size=4043, packets=2 detected mpegvideo with score=25
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2498
    [mpeg @ 0x7ffb4a80f200] Probe with size=6084, packets=3 detected mpegvideo with score=25
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2497
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2496
    [mpeg @ 0x7ffb4a80f200] Probe with size=10166, packets=5 detected mpegvideo with score=25
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2495
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2494
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2493
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2492
    [mpeg @ 0x7ffb4a80f200] Probe with size=18330, packets=9 detected mpegvideo with score=25
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2491
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2490
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2489
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2488
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2487
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2486
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2485
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2484
    [mpeg @ 0x7ffb4a80f200] Probe with size=34658, packets=17 detected mpegvideo with score=25
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2483
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2482
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2481
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2480
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2479
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2478
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2477
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2476
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2475
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2474
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2473
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2472
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2471
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2470
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2469
    [mpeg @ 0x7ffb4a80f200] probing stream 0 pp:2468
    [mpeg @ 0x7ffb4a80f200] Probe with size=67266, packets=33 detected mpegvideo with score=51
    [mpeg @ 0x7ffb4a80f200] probed stream 0
    [mpeg @ 0x7ffb4a80f200] first_dts 86997 not matching first dts 93003 in the queue
       Last message repeated 3 times
    [mpeg @ 0x7ffb4a80f200] first_dts 86997 not matching first dts 108018 in the queue
       Last message repeated 3 times
    [mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 111600 in the queue
       Last message repeated 9 times
    [mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 135360 in the queue
       Last message repeated 8 times
    [mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 156960 in the queue
       Last message repeated 9 times
    [mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 180720 in the queue
       Last message repeated 8 times
    [mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 202320 in the queue
       Last message repeated 9 times
    [mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 226080 in the queue
       Last message repeated 8 times
    [mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 247680 in the queue
       Last message repeated 9 times
    [mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 271440 in the queue
       Last message repeated 9 times
    [mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 295200 in the queue
       Last message repeated 8 times
    [mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 316800 in the queue
       Last message repeated 9 times
    [mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 340560 in the queue
       Last message repeated 8 times
    [mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 362160 in the queue
       Last message repeated 9 times
    [mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 385920 in the queue
       Last message repeated 8 times
    [mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 407520 in the queue
       Last message repeated 9 times
    [mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 431280 in the queue
       Last message repeated 8 times
    [mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 452880 in the queue
       Last message repeated 9 times
    [mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 476640 in the queue
       Last message repeated 8 times
    [mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 498240 in the queue
       Last message repeated 9 times
    [mpeg @ 0x7ffb4a80f200] first_dts 90000 not matching first dts 522000 in the queue
       Last message repeated 9 times
    [mpeg @ 0x7ffb4a80f200] max_analyze_duration 5000000 reached at 5005000 microseconds
    [mpeg @ 0x7ffb4a80f200] File position after avformat_find_stream_info() is 0
    Input #0, mpeg, from 'sample-in.mpg':
     Duration: 00:00:05.97, start: 1.000000, bitrate: 6827 kb/s
       Stream #0:0[0x1e0], 152, 1/90000: Video: mpeg1video, yuv420p, 704x480 [SAR 200:219 DAR 880:657], 1001/30000, 104857 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 29.97 tbc
       Stream #0:1[0x1c0], 211, 1/90000: Audio: mp2, 48000 Hz, stereo, s16p, 64 kb/s
    Successfully opened the file.
    Parsing a group of options: output file sample-frames/frame%d.png.
    Applying option ss (set the start time offset) with argument 00:00:01.
    Applying option t (record or transcode "duration" seconds of audio/video) with argument 00:00:05.
    Applying option f (force format) with argument image2.
    Successfully parsed a group of options.
    Opening an output file: sample-frames/frame%d.png.
    Successfully opened the file.
    Parsing a group of options: output file sample.mp3.
    Applying option acodec (force audio codec ('copy' to copy stream)) with argument copy.
    Applying option qscale:a (use fixed quality scale (VBR)) with argument 0.
    Successfully parsed a group of options.
    Opening an output file: sample.mp3.
    Successfully opened the file.
    [buffer @ 0x7ffb4a411e40] Setting entry with key 'video_size' to value '704x480'
    [buffer @ 0x7ffb4a411e40] Setting entry with key 'pix_fmt' to value '0'
    [buffer @ 0x7ffb4a411e40] Setting entry with key 'time_base' to value '1/90000'
    [buffer @ 0x7ffb4a411e40] Setting entry with key 'pixel_aspect' to value '200/219'
    [buffer @ 0x7ffb4a411e40] Setting entry with key 'sws_param' to value 'flags=2'
    [buffer @ 0x7ffb4a411e40] Setting entry with key 'frame_rate' to value '30000/1001'
    [graph 0 input from stream 0:0 @ 0x7ffb4a411de0] w:704 h:480 pixfmt:yuv420p tb:1/90000 fr:30000/1001 sar:200/219 sws_param:flags=2
    [scale @ 0x7ffb4a414800] Setting 'w' to value '0'
    [scale @ 0x7ffb4a414800] Setting 'h' to value '0'
    [scale @ 0x7ffb4a414800] Setting 'flags' to value '0x4'
    [auto-inserted scaler 0 @ 0x7ffb4a414740] w:0 h:0 flags:'0x4' interl:0
    [format @ 0x7ffb4a42aa20] auto-inserting filter 'auto-inserted scaler 0' between the filter 'Parsed_null_0' and the filter 'format'
    [auto-inserted scaler 0 @ 0x7ffb4a414740] picking rgb24 out of 7 ref:yuv420p alpha:0
    [auto-inserted scaler 0 @ 0x7ffb4a414740] w:704 h:480 fmt:yuv420p sar:200/219 -> w:704 h:480 fmt:rgb24 sar:200/219 flags:0x4
    [png @ 0x7ffb4a831000] detected 4 logical cores
    [mp3 @ 0x7ffb4a831600] Invalid audio stream. Exactly one MP3 audio stream is required.
    Output #0, image2, to 'sample-frames/frame%d.png':
     Metadata:
       encoder         : Lavf54.63.104
       Stream #0:0, 0, 1/90000: Video: png, rgb24, 704x480 [SAR 200:219 DAR 880:657], 1001/30000, q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
    Output #1, mp3, to 'sample.mp3':
     Metadata:
       encoder         : Lavf54.63.104
       Stream #1:0, 0, 1/90000: Audio: mp2, 48000 Hz, stereo, 64 kb/s
    Stream mapping:
     Stream #0:0 -> #0:0 (mpeg1video -> png)
     Stream #0:1 -> #1:0 (copy)
    Could not write header for output file #1 (incorrect codec parameters ?): Invalid argument
    Statistics: 4542608 bytes read, 2 seeks

    I found the code above from : http://kwlug.org/node/854
    I did a few edits removing the -sameq and replacing it with -qscale:a 0 which probably is wrong.

  • Convert .mov to .mp4 and keep alpha channel using FFMPEG

    5 mai 2015, par Mark S.

    I am trying to convert a .mov file that is Quicktime with Alpha Channel to a .mp4 movie. I am using FFMPEG and I can successfully convert the video to a .mp4 video, but I loose the alpha channel.

    Here is the command I am running :
    ffmpeg -i BLUE_LOWER_THIRD.mov -vcodec libx264 -vpre medium blue_lower_third.mp4

    I am running this on Ubuntu 11.10. Here is the information about my install of ffmpeg.

    ffmpeg version 0.7.3-4:0.7.3-0ubuntu0.11.10.1, Copyright (c) 2000-2011 the Libav developers
     built on Jan  4 2012 16:08:51 with gcc 4.6.1
     configuration: --extra-version='4:0.7.3-0ubuntu0.11.10.1' --arch=amd64 --prefix=/usr --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --enable-runtime-cpudetect --enable-vaapi --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
     avutil      configuration: --extra-version='4:0.7.3ubuntu0.11.10.1' --arch=amd64 --prefix=/usr --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --enable-runtime-cpudetect --enable-vaapi --enable-libopenjpeg --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdirac --enable-libmp3lame --enable-librtmp --enable-libx264 --enable-libxvid --enable-libvo-aacenc --enable-version3 --enable-libvo-amrwbenc --enable-version3 --enable-libdc1394 --enable-shared --disable-static
     avcodec     configuration: --extra-version='4:0.7.3ubuntu0.11.10.1' --arch=amd64 --prefix=/usr --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --enable-runtime-cpudetect --enable-vaapi --enable-libopenjpeg --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdirac --enable-libmp3lame --enable-librtmp --enable-libx264 --enable-libxvid --enable-libvo-aacenc --enable-version3 --enable-libvo-amrwbenc --enable-version3 --enable-libdc1394 --enable-shared --disable-static
     avformat    configuration: --extra-version='4:0.7.3ubuntu0.11.10.1' --arch=amd64 --prefix=/usr --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --enable-runtime-cpudetect --enable-vaapi --enable-libopenjpeg --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdirac --enable-libmp3lame --enable-librtmp --enable-libx264 --enable-libxvid --enable-libvo-aacenc --enable-version3 --enable-libvo-amrwbenc --enable-version3 --enable-libdc1394 --enable-shared --disable-static
     libavutil    51.  7. 0 / 51.  7. 0
     libavcodec   53.  6. 0 / 53.  6. 0
     libavformat  53.  3. 0 / 53.  3. 0
     libavdevice  53.  0. 0 / 53.  0. 0
     libavfilter   2.  4. 0 /  2.  4. 0
     libswscale    2.  0. 0 /  2.  0. 0
     libpostproc  52.  0. 0 / 52.  0. 0

    Is it possible to have alpha channel in an mp4 file ? If so, how do you do it with FFMPEG ?

    Edit : This is the output from running the command.

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'BLUE_LOWER_THIRD.mov':
     Metadata:
       major_brand     : qt  
       minor_version   : 537199360
       compatible_brands: qt  
       creation_time   : 2010-12-21 10:36:51
     Duration: 00:00:15.00, start: 0.000000, bitrate: 8050 kb/s
       Stream #0.0(eng): Video: png, bgra, 1920x1080, 8043 kb/s, PAR 1920:1920 DAR 16:9, 30 fps, 30 tbr, 30 tbn, 30 tbc
       Metadata:
         creation_time   : 2010-12-21 10:36:51
       Stream #0.1(eng): Data: tmcd / 0x64636D74, 0 kb/s
       Metadata:
         creation_time   : 2010-12-21 10:39:48
    File 'blue_lower_third.mp4' already exists. Overwrite ? [y/N] y
    Incompatible pixel format 'bgra' for codec 'libx264', auto-selecting format 'yuv420p'
    [buffer @ 0x7e3d80] w:1920 h:1080 pixfmt:bgra
    [ffsink @ 0x7edda0] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
    [scale @ 0x7fc480] w:1920 h:1080 fmt:bgra -> w:1920 h:1080 fmt:yuv420p flags:0x4
    [libx264 @ 0x7fcf20] using SAR=1/1
    [libx264 @ 0x7fcf20] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle Cache64
    [libx264 @ 0x7fcf20] profile High, level 4.0
    [libx264 @ 0x7fcf20] 264 - core 116 r2042 178455c - H.264/MPEG-4 AVC codec - Copyleft 2003-2011 - 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=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=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=200 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.41 aq=1:1.00
    Output #0, mp4, to 'blue_lower_third.mp4':
     Metadata:
       major_brand     : qt  
       minor_version   : 537199360
       compatible_brands: qt  
       creation_time   : 2010-12-21 10:36:51
       encoder         : Lavf53.3.0
       Stream #0.0(eng): Video: libx264, yuv420p, 1920x1080 [PAR 1920:1920 DAR 16:9], q=0-69, 200 kb/s, 30 tbn, 30 tbc
       Metadata:
         creation_time   : 2010-12-21 10:36:51
    Stream mapping:
     Stream #0.0 -> #0.0
    Press ctrl-c to stop encoding
    frame=  450 fps= 11 q=9.0 Lsize=      83kB time=14.93 bitrate=  45.7kbits/s    its/s    
    video:75kB audio:0kB global headers:0kB muxing overhead 10.287784%
    frame I:2     Avg QP:18.30  size:  2584
    [libx264 @ 0x7fcf20] frame P:118   Avg QP:16.22  size:   310
    [libx264 @ 0x7fcf20] frame B:330   Avg QP:16.75  size:   106
    [libx264 @ 0x7fcf20] consecutive B-frames:  1.8%  0.9%  1.3% 96.0%
    [libx264 @ 0x7fcf20] mb I  I16..4: 49.7% 50.0%  0.3%
    [libx264 @ 0x7fcf20] mb P  I16..4:  0.5%  0.0%  0.0%  P16..4:  0.3%  0.0%  0.0%  0.0%      0.0%    skip:99.0%
    [libx264 @ 0x7fcf20] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.3%  0.0%  0.0%  direct: 0.0%  skip:99.6%  L0:37.2% L1:62.6% BI: 0.2%
    [libx264 @ 0x7fcf20] final ratefactor: 9.32
    [libx264 @ 0x7fcf20] 8x8 transform intra:38.0% inter:56.1%
    [libx264 @ 0x7fcf20] coded y,uvDC,uvAC intra: 0.9% 4.2% 2.9% inter: 0.0% 0.1% 0.0%
    [libx264 @ 0x7fcf20] i16 v,h,dc,p: 64% 32%  1%  3%
    [libx264 @ 0x7fcf20] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  0%  2% 97%  0%  1%  0%  0%  0%  0%
    [libx264 @ 0x7fcf20] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu:  5% 60% 23%  2%  6%  1%  1%  1%  2%
    [libx264 @ 0x7fcf20] i8c dc,h,v,p: 86% 13%  1%  0%
    [libx264 @ 0x7fcf20] Weighted P-Frames: Y:0.0% UV:0.0%
    [libx264 @ 0x7fcf20] ref P L0: 79.4%  2.1% 13.2%  5.2%
    [libx264 @ 0x7fcf20] ref B L0: 61.1% 37.7%  1.2%
    [libx264 @ 0x7fcf20] ref B L1: 92.3%  7.7%
    [libx264 @ 0x7fcf20] kb/s:40.85
  • 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 & 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