Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (59)

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

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (8464)

  • Creating a video using ffmpeg in a PHP script

    30 décembre 2017, par Femzy

    I have been trying to solve this problem for a while now, but i have not got it through please someone should help me..
    My main objective is to collect user’n inputs and convert it to a video with black background, then the input text will be moving from left to right while the video is playing with audio in the background. Currently i was suggested to use "drawtext" but i have not find it working
    This is the code I use just to test the drawtext but the thing is, if i try it 10 times it will create a video file ones in many times i tried and even the video file would have 0 kb in size
    The Below code is my code

    The Below is the Report i got from the not working ffmpeg cmmand

    echo shell_exec('ffmpeg -f lavfi -i testsrc=duration=5:size=800x600:rate=30 -vf drawtext="fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf:textfile=text.txt: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000@1" -preset ultrafast outex.mp4');

    ffmpeg started on 2017-12-29 at 16:43:24

    Report written to "ffmpeg-20171229-164324.log"
    Command line :
    ffmpeg -f test.mp4 -vf "drawtext=fontsize=64:fontcolor=white@0.8:box=1:boxcolor=black@0.75:boxborderw=16:fontfile=OCRA.ttf:text=my_video:x=(w-tw)/2:y=th" textover09.mpg -report
    ffmpeg version git-2017-12-28-be4dfbf Copyright (c) 2000-2017 the FFmpeg developers
    built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-18)
    configuration : —prefix=/usr/local/ffmpeg —extra-cflags=-I/usr/local/ffmpeg/include —extra-ldflags=-L/usr/local/ffmpeg/lib —bindir=/usr/local/bin —enable-gpl —enable-nonfree —enable-libfdk_aac —enable-libmp3lame —enable-libopus —enable-libvpx —enable-libx264 —enable-libtheora —enable-filter=drawtext
    libavutil 56. 7.100 / 56. 7.100
    libavcodec 58. 9.100 / 58. 9.100
    libavformat 58. 3.100 / 58. 3.100
    libavdevice 58. 0.100 / 58. 0.100
    libavfilter 7. 8.100 / 7. 8.100
    libswscale 5. 0.101 / 5. 0.101
    libswresample 3. 0.101 / 3. 0.101
    libpostproc 55. 0.100 / 55. 0.100
    Splitting the commandline.
    Reading option ’-f’ ... matched as option ’f’ (force format) with argument ’test.mp4’.
    Reading option ’-vf’ ... matched as option ’vf’ (set video filters) with argument ’drawtext=fontsize=64:fontcolor=white@0.8:box=1:boxcolor=black@0.75:boxborderw=16:fontfile=OCRA.ttf:text=my_video:x=(w-tw)/2:y=th’.
    Reading option ’textover09.mpg’ ... matched as output url.
    Reading option ’-report’ ... matched as option ’report’ (generate a report) with argument ’1’.
    Finished splitting the commandline.
    Parsing a group of options : global .
    Applying option report (generate a report) with argument 1.
    Successfully parsed a group of options.
    Parsing a group of options : output url textover09.mpg.
    Applying option f (force format) with argument test.mp4.
    Applying option vf (set video filters) with argument drawtext=fontsize=64:fontcolor=white@0.8:box=1:boxcolor=black@0.75:boxborderw=16:fontfile=OCRA.ttf:text=my_video:x=(w-tw)/2:y=th.
    Successfully parsed a group of options.
    Opening an output file : textover09.mpg.
    [NULL @ 0x4671e80] Requested output format ’test.mp4’ is not a suitable output format
    textover09.mpg : Invalid argument

    This is Another report i got, in this report it is saying" Drawtext no such filters"

    ffmpeg started on 2017-12-29 at 09:00:43
    Report written to "ffmpeg-20171229-090043.log"
    Command line:
    ffmpeg -i test.mp4 -vf "drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf:textfile=text.txt:reload=1:y=h-line_h-10:x=(W/tw)*n" textover7.mpg -report
    ffmpeg version git-2017-12-28-be4dfbf Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-18)
     configuration: --prefix=/usr/local/ffmpeg --extra-cflags=-I/usr/local/ffmpeg/include --extra-ldflags=-L/usr/local/ffmpeg/lib --bindir=/usr/local/bin --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libx264 --enable-libtheora --enable-filter=drawtext
     libavutil      56.  7.100 / 56.  7.100
     libavcodec     58.  9.100 / 58.  9.100
     libavformat    58.  3.100 / 58.  3.100
     libavdevice    58.  0.100 / 58.  0.100
     libavfilter     7.  8.100 /  7.  8.100
     libswscale      5.  0.101 /  5.  0.101
     libswresample   3.  0.101 /  3.  0.101
     libpostproc    55.  0.100 / 55.  0.100
    Splitting the commandline.
    Reading option '-i' ... matched as input url with argument 'test.mp4'.
    Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf:textfile=text.txt:reload=1:y=h-line_h-10:x=(W/tw)*n'.
    Reading option 'textover7.mpg' ... matched as output url.
    Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
    Finished splitting the commandline.
    Parsing a group of options: global .
    Applying option report (generate a report) with argument 1.
    Successfully parsed a group of options.
    Parsing a group of options: input url test.mp4.
    Successfully parsed a group of options.
    Opening an input file: test.mp4.
    [NULL @ 0x42d2d80] Opening 'test.mp4' for reading
    [file @ 0x42d3700] Setting default whitelist 'file,crypto'
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x42d2d80] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x42d2d80] ISO: File Type Major Brand: mp42
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x42d2d80] Unknown dref type 0x206c7275 size 12
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x42d2d80] Processing st: 0, edit list 0 - media time: 0, duration: 13049
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x42d2d80] Unknown dref type 0x206c7275 size 12
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x42d2d80] Before avformat_find_stream_info() pos: 112452 bytes read:141356 seeks:0 nb_streams:2
    [h264 @ 0x42d4640] nal_unit_type: 7, nal_ref_idc: 3
    [h264 @ 0x42d4640] nal_unit_type: 8, nal_ref_idc: 3
    [h264 @ 0x42d4640] nal_unit_type: 5, nal_ref_idc: 3
    [h264 @ 0x42d4640] Format yuv420p chosen by get_format().
    [h264 @ 0x42d4640] Reinit context to 640x368, pix_fmt: yuv420p
    [h264 @ 0x42d4640] nal_unit_type: 1, nal_ref_idc: 2
    [h264 @ 0x42d4640] nal_unit_type: 1, nal_ref_idc: 2
    [h264 @ 0x42d4640] nal_unit_type: 1, nal_ref_idc: 2
    [h264 @ 0x42d4640] nal_unit_type: 1, nal_ref_idc: 2
    [h264 @ 0x42d4640] nal_unit_type: 1, nal_ref_idc: 2
    [h264 @ 0x42d4640] nal_unit_type: 1, nal_ref_idc: 2
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x42d2d80] All info found
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x42d2d80] After avformat_find_stream_info() pos: 159483 bytes read:174124 seeks:0 frames:9
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':
     Metadata:
       major_brand     : mp42
       minor_version   : 0
       compatible_brands: isommp42
       creation_time   : 2014-01-19T03:12:30.000000Z
     Duration: 00:07:15.00, start: 0.000000, bitrate: 201 kb/s
       Stream #0:0(und), 8, 1/30: Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x360, 103 kb/s, 15 fps, 15 tbr, 30 tbn, 30 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(und), 1, 1/44100: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 96 kb/s (default)
       Metadata:
         creation_time   : 2014-01-19T03:12:31.000000Z
         handler_name    : IsoMedia File Produced by Google, 5-11-2011
    Successfully opened the file.
    Parsing a group of options: output url textover7.mpg.
    Applying option vf (set video filters) with argument drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf:textfile=text.txt:reload=1:y=h-line_h-10:x=(W/tw)*n.
    Successfully parsed a group of options.
    Opening an output file: textover7.mpg.
    [file @ 0x42e9e40] Setting default whitelist 'file,crypto'
    Successfully opened the file.
    detected 12 logical cores
    [h264 @ 0x43ece00] nal_unit_type: 7, nal_ref_idc: 3
    [h264 @ 0x43ece00] nal_unit_type: 8, nal_ref_idc: 3
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> mpeg1video (native))
     Stream #0:1 -> #0:1 (aac (native) -> mp2 (native))
    Press [q] to stop, [?] for help
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    [h264 @ 0x43ece00] nal_unit_type: 5, nal_ref_idc: 3
    [h264 @ 0x43ece00] Format yuv420p chosen by get_format().
    [h264 @ 0x43ece00] Reinit context to 640x368, pix_fmt: yuv420p
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    [h264 @ 0x43f91c0] nal_unit_type: 1, nal_ref_idc: 2
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    [h264 @ 0x43376c0] nal_unit_type: 1, nal_ref_idc: 2
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    [h264 @ 0x4339d40] nal_unit_type: 1, nal_ref_idc: 2
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    [h264 @ 0x43c1840] nal_unit_type: 1, nal_ref_idc: 2
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    [h264 @ 0x43de0c0] nal_unit_type: 1, nal_ref_idc: 2
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    [h264 @ 0x439b000] nal_unit_type: 1, nal_ref_idc: 2
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    [h264 @ 0x445ae80] nal_unit_type: 1, nal_ref_idc: 2
    [graph_1_in_0_1 @ 0x4657a40] Setting 'time_base' to value '1/44100'
    [graph_1_in_0_1 @ 0x4657a40] Setting 'sample_rate' to value '44100'
    [graph_1_in_0_1 @ 0x4657a40] Setting 'sample_fmt' to value 'fltp'
    [graph_1_in_0_1 @ 0x4657a40] Setting 'channel_layout' to value '0x3'
    [graph_1_in_0_1 @ 0x4657a40] tb:1/44100 samplefmt:fltp samplerate:44100 chlayout:0x3
    [format_out_0_1 @ 0x4657cc0] Setting 'sample_fmts' to value 's16'
    [format_out_0_1 @ 0x4657cc0] Setting 'sample_rates' to value '44100|48000|32000|22050|24000|16000'
    [format_out_0_1 @ 0x4657cc0] Setting 'channel_layouts' to value '0x4|0x3'
    [format_out_0_1 @ 0x4657cc0] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_1'
    [AVFilterGraph @ 0x42d2c40] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed
    [auto_resampler_0 @ 0x4658dc0] [SWR @ 0x4659140] Using fltp internally between filters
    [auto_resampler_0 @ 0x4658dc0] ch:2 chl:stereo fmt:fltp r:44100Hz -> ch:2 chl:stereo fmt:s16 r:44100Hz
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    [h264 @ 0x4477580] nal_unit_type: 1, nal_ref_idc: 2
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    [h264 @ 0x4493cc0] nal_unit_type: 1, nal_ref_idc: 2
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    [h264 @ 0x44b0340] nal_unit_type: 1, nal_ref_idc: 2
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    [h264 @ 0x44cca80] nal_unit_type: 1, nal_ref_idc: 2
    [AVFilterGraph @ 0x466e4c0] No such filter: 'drawtext'
    Error reinitializing filters!
    Failed to inject frame into filter network: Invalid argument
    Error while processing the decoded data for stream #0:0
    [h264 @ 0x44e91c0] nal_unit_type: 1, nal_ref_idc: 2
    [AVIOContext @ 0x43c0280] Statistics: 0 seeks, 0 writeouts
    [AVIOContext @ 0x42db980] Statistics: 174124 bytes read, 0 seeks
    Conversion failed!
  • Segmenting an audio stream or audio only file

    15 janvier 2013, par Luuk D. Jansen

    There is need for an audio only link for HTTP-live streaming. I now use the segmenter in FFMPEG for the video, and that works great. However, when giving an audio-file the segmenter does not seem to work, just creates one segment.

    The call to FFMPEG for the segmentation is :

    ffmpeg -i data/media/1/2/encoded.mp3 -y -c copy -flags global_header
    -map 0 -f segment -segment_time 10 -segment_list data/media/1/2/fileList.txt -segment_format libmp3lame
    data/media/1/2/segment_%05d.mp3

    I did put as the -segment_format 'libmp3lame' in, but it doesn't seem to make a difference.

    The first step is the encoding, this is the bedbug output :

    20:11:36,158 DEBUG ~ FFMPEG: ffmpeg version 0.10.2.git-d3d5e84 Copyright (c) 2000-2012 the FFmpeg developers
    20:11:36,158 DEBUG ~ FFMPEG:   built on May  2 2012 19:00:38 with clang 3.0 (tags/Apple/clang-211.10.1)
    20:11:36,158 DEBUG ~ FFMPEG:   configuration: --prefix=/opt/local --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libdirac --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libxvid --enable-libx264 --enable-libvpx --enable-libspeex --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm
    20:11:36,158 DEBUG ~ FFMPEG:   libavutil      51. 44.100 / 51. 44.100
    20:11:36,158 DEBUG ~ FFMPEG:   libavcodec     54. 12.100 / 54. 12.100
    20:11:36,158 DEBUG ~ FFMPEG:   libavformat    54.  3.100 / 54.  3.100
    20:11:36,158 DEBUG ~ FFMPEG:   libavdevice    53.  4.100 / 53.  4.100
    20:11:36,158 DEBUG ~ FFMPEG:   libavfilter     2. 66.101 /  2. 66.101
    20:11:36,158 DEBUG ~ FFMPEG:   libswscale      2.  1.100 /  2.  1.100
    20:11:36,158 DEBUG ~ FFMPEG:   libswresample   0. 10.100 /  0. 10.100
    20:11:36,158 DEBUG ~ FFMPEG:   libpostproc    52.  0.100 / 52.  0.100
    20:11:36,162 DEBUG ~ FFMPEG: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'data/media/1/1/test.m4a':
    20:11:36,162 DEBUG ~ FFMPEG:   Metadata:
    20:11:36,162 DEBUG ~ FFMPEG:     major_brand     : mp42
    20:11:36,162 DEBUG ~ FFMPEG:     minor_version   : 1
    20:11:36,163 DEBUG ~ FFMPEG:     compatible_brands: mp42mp41
    20:11:36,163 DEBUG ~ FFMPEG:     creation_time   : 2011-12-07 18:53:04
    20:11:36,163 DEBUG ~ FFMPEG:   Duration: 00:00:24.20, start: 0.000000, bitrate: 40 kb/s
    20:11:36,163 DEBUG ~ FFMPEG:     Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 22050 Hz, stereo, s16, 39 kb/s
    20:11:36,163 DEBUG ~ FFMPEG:     Metadata:
    20:11:36,163 DEBUG ~ FFMPEG:       creation_time   : 2011-12-07 18:53:04
    20:11:36,163 DEBUG ~ FFMPEG:       handler_name    : Apple Sound Media Handler
    20:11:36,170 DEBUG ~ FFMPEG: [mpegts @ 0x7fe4c404d000] muxrate VBR, pcr every 4 pkts, sdt every 200, pat/pmt every 40 pkts
    20:11:36,171 DEBUG ~ FFMPEG: Output #0, mpegts, to '/Users/Luuk/Documents/Java/idoms-server/data/media/1/2/encoded.mp3':
    20:11:36,171 DEBUG ~ FFMPEG:   Metadata:
    20:11:36,171 DEBUG ~ FFMPEG:     major_brand     : mp42
    20:11:36,171 DEBUG ~ FFMPEG:     minor_version   : 1
    20:11:36,171 DEBUG ~ FFMPEG:     compatible_brands: mp42mp41
    20:11:36,171 DEBUG ~ FFMPEG:     creation_time   : 2011-12-07 18:53:04
    20:11:36,171 DEBUG ~ FFMPEG:     encoder         : Lavf54.3.100
    20:11:36,171 DEBUG ~ FFMPEG:     Stream #0:0(eng): Audio: mp3, 48000 Hz, stereo, s16, 64 kb/s
    20:11:36,171 DEBUG ~ FFMPEG:     Metadata:
    20:11:36,171 DEBUG ~ FFMPEG:       creation_time   : 2011-12-07 18:53:04
    20:11:36,171 DEBUG ~ FFMPEG:       handler_name    : Apple Sound Media Handler
    20:11:36,171 DEBUG ~ FFMPEG: Stream mapping:
    20:11:36,171 DEBUG ~ FFMPEG:   Stream #0:0 -> #0:0 (aac -> libmp3lame)
    20:11:36,171 DEBUG ~ FFMPEG: Press [q] to stop, [?] for help
    20:11:36,673 DEBUG ~ FFMPEG: size=     109kB time=00:00:12.79 bitrate=  69.5kbits/s    
    20:11:37,156 DEBUG ~ FFMPEG: size=     209kB time=00:00:24.24 bitrate=  70.7kbits/s    
    20:11:37,156 DEBUG ~ FFMPEG: video:0kB audio:190kB global headers:0kB muxing overhead 10.301383%

    Then the next is the segmentation (version 0.10.2 cannot do both at the same time yet) :

    20:11:37,211 DEBUG ~ FFMPEG: ffmpeg version 0.10.2.git-d3d5e84 Copyright (c) 2000-2012 the FFmpeg developers
       20:11:37,212 DEBUG ~ FFMPEG:   built on May  2 2012 19:00:38 with clang 3.0 (tags/Apple/clang-211.10.1)
       20:11:37,212 DEBUG ~ FFMPEG:   configuration: --prefix=/opt/local --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libdirac --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libxvid --enable-libx264 --enable-libvpx --enable-libspeex --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm
       20:11:37,212 DEBUG ~ FFMPEG:   libavutil      51. 44.100 / 51. 44.100
       20:11:37,212 DEBUG ~ FFMPEG:   libavcodec     54. 12.100 / 54. 12.100
       20:11:37,212 DEBUG ~ FFMPEG:   libavformat    54.  3.100 / 54.  3.100
       20:11:37,212 DEBUG ~ FFMPEG:   libavdevice    53.  4.100 / 53.  4.100
       20:11:37,212 DEBUG ~ FFMPEG:   libavfilter     2. 66.101 /  2. 66.101
       20:11:37,212 DEBUG ~ FFMPEG:   libswscale      2.  1.100 /  2.  1.100
       20:11:37,212 DEBUG ~ FFMPEG:   libswresample   0. 10.100 /  0. 10.100
       20:11:37,212 DEBUG ~ FFMPEG:   libpostproc    52.  0.100 / 52.  0.100
       20:11:37,226 DEBUG ~ FFMPEG: [mpegts @ 0x7fccc2049800] max_analyze_duration 5000000 reached at 5016000
       20:11:37,226 DEBUG ~ FFMPEG: Input #0, mpegts, from '/Users/Luuk/Documents/Java/idoms-server/data/media/1/2/encoded.mp3':
       20:11:37,226 DEBUG ~ FFMPEG:   Duration: 00:00:24.12, start: 1.376978, bitrate: 71 kb/s
       20:11:37,226 DEBUG ~ FFMPEG:   Program 1
       20:11:37,226 DEBUG ~ FFMPEG:     Metadata:
       20:11:37,226 DEBUG ~ FFMPEG:       service_name    : Service01
       20:11:37,226 DEBUG ~ FFMPEG:       service_provider: FFmpeg
       20:11:37,226 DEBUG ~ FFMPEG:     Stream #0:0[0x100](eng): Audio: mp3 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16, 64 kb/s
       20:11:37,226 DEBUG ~ FFMPEG: Output #0, segment, to '/Users/Luuk/Documents/Java/idoms-server/data/media/1/2/segment_%05d.mp3':
       20:11:37,226 DEBUG ~ FFMPEG:   Metadata:
       20:11:37,226 DEBUG ~ FFMPEG:     encoder         : Lavf54.3.100
       20:11:37,226 DEBUG ~ FFMPEG:     Stream #0:0(eng): Audio: mp3 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, 64 kb/s
       20:11:37,226 DEBUG ~ FFMPEG: Stream mapping:
       20:11:37,226 DEBUG ~ FFMPEG:   Stream #0:0 -> #0:0 (copy)
       20:11:37,226 DEBUG ~ FFMPEG: Press [q] to stop, [?] for help
       20:11:37,238 DEBUG ~ FFMPEG: size=       0kB time=00:00:24.28 bitrate=   0.0kbits/s    
       20:11:37,238 DEBUG ~ FFMPEG: video:0kB audio:190kB global headers:0kB muxing overhead -100.000000%
  • Concatenating video using FFMPEG wrapper class [duplicate]

    21 décembre 2017, par alan samuel

    I am trying to concatenate video using NReco.VideoConverter wrapper class made for FFMPEG.

    I have three video files with the same frame rate and same frame size.

    Here is what I have done.

           string toconcatfile = @"C:\Users\Alan\Desktop\Black.mp4";
           string output1 = @"C:\Users\Alan\Desktop\output1.mp4";
           string output2 = @"C:\Users\Alan\Desktop\output2.mp4";
           string finaloutput = @"C:\Users\Alan\Desktop\finaloutput.mp4";

    All the three videos have a frame rate of 25 and Video frame size yet it fails when I add in toconcatfile to the final conversion method.

    It works when its just output1 and output2 meaning there must be a different setting in toconcatfile.

    Here is what I have tried.

           FFMpegConverter fFMpeg = new FFMpegConverter();


           //Slices first video
           ConvertSettings settings = new ConvertSettings
           {
               VideoFrameRate = 25,
               VideoFrameSize = FrameSize.hd480,
               MaxDuration = startcut,
               AudioSampleRate = 44100

           };

           //Slices second video
           ConvertSettings settings2 = new ConvertSettings
           {
               VideoFrameRate = 25,
               VideoFrameSize = FrameSize.hd480,
               Seek = endcut,
               AudioSampleRate = 44100

           };
           //Copies framerate and size from the previous video to the concatenation video
           ConvertSettings settings3 = new ConvertSettings
           {
               VideoFrameRate = 25,
               VideoFrameSize = FrameSize.hd480,
               MaxDuration = 4,
               AppendSilentAudioStream = true,
               AudioSampleRate = 44100

           };


     string newblack = @"C:\Users\Alan\Desktop\newblack.mp4";

           //Slice method called
           fFMpeg.ConvertMedia(pathtofile, Format.mp4, output1, Format.mp4, settings);
           fFMpeg.ConvertMedia(pathtofile, Format.mp4, output2, Format.mp4, settings2);
           fFMpeg.ConvertMedia(toconcatfile, Format.mp4, newblack, Format.mp4, settings3);

           String[] inputfiles = new String[2];
           inputfiles[0] = output1;
           inputfiles[1] = newblack;
           //inputfiles[1] = output2;


           ConcatSettings concatSettings = new ConcatSettings
           {
               //CustomOutputArgs = output1+" "+ toconcatfile+ " "+output2+ " -filter_complex \"[0:v:0][0:a:0][1:v:0][1:a:0][2:v:0][2:a:0]concat=n=3:v=1:a=1[outv][outa]\" -map \"[outv]\" - map \"[outa]\""
           };

           fFMpeg.ConcatMedia(inputfiles, finaloutput, Format.mp4, concatSettings);

    Can anyone help ?

    Edit : I get the exception message - "Invalid argument (exit code : 1)",

    Here is the output log of FFMPEG

           FFMPEG LOG ITEM - ffmpeg version 3.2.2 Copyright (c) 2000-2016 the
               FFmpeg developers
    FFMPEG LOG ITEM -   built with gcc 5.4.0 (GCC)
    FFMPEG LOG ITEM -   configuration: --enable-gpl --enable-version3 --enable-

    dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --

    enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
    FFMPEG LOG ITEM -   libavutil      55. 34.100 / 55. 34.100
    FFMPEG LOG ITEM -   libavcodec     57. 64.101 / 57. 64.101
    FFMPEG LOG ITEM -   libavformat    57. 56.100 / 57. 56.100
    FFMPEG LOG ITEM -   libavdevice    57.  1.100 / 57.  1.100
    FFMPEG LOG ITEM -   libavfilter     6. 65.100 /  6. 65.100
    FFMPEG LOG ITEM -   libswscale      4.  2.100 /  4.  2.100
    FFMPEG LOG ITEM -   libswresample   2.  3.100 /  2.  3.100
    FFMPEG LOG ITEM -   libpostproc    54.  1.100 / 54.  1.100
    FFMPEG LOG ITEM - Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\Alan\Desktop\output1.mp4':
    FFMPEG LOG ITEM -   Metadata:
    FFMPEG LOG ITEM -     major_brand     : isom
    FFMPEG LOG ITEM -     minor_version   : 512
    FFMPEG LOG ITEM -     compatible_brands: isomiso2avc1mp41
    FFMPEG LOG ITEM -     encoder         : Lavf57.56.100
    FFMPEG LOG ITEM -   Duration: 00:00:30.02, start: 0.000000, bitrate: 543 kb/s
    FFMPEG LOG ITEM -     Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 852x480 [SAR 3893:2872 DAR 276403:114880], 407 kb/s, SAR 12800:9443 DAR 320:133, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    FFMPEG LOG ITEM -     Metadata:
    FFMPEG LOG ITEM -       handler_name    : VideoHandler
    FFMPEG LOG ITEM -     Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 129 kb/s (default)
    FFMPEG LOG ITEM -     Metadata:
    FFMPEG LOG ITEM -       handler_name    : SoundHandler
    FFMPEG LOG ITEM - Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\Alan\Desktop\newblack.mp4':
    FFMPEG LOG ITEM -   Metadata:
    FFMPEG LOG ITEM -     major_brand     : isom
    FFMPEG LOG ITEM -     minor_version   : 512
    FFMPEG LOG ITEM -     compatible_brands: isomiso2avc1mp41
    FFMPEG LOG ITEM -     encoder         : Lavf57.56.100
    FFMPEG LOG ITEM -   Duration: 00:00:04.02, start: 0.000000, bitrate: 19 kb/s
    FFMPEG LOG ITEM -     Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 852x480 [SAR 160:213 DAR 4:3], 7 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    FFMPEG LOG ITEM -     Metadata:
    FFMPEG LOG ITEM -       handler_name    : VideoHandler
    FFMPEG LOG ITEM -     Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 2 kb/s (default)
    FFMPEG LOG ITEM -     Metadata:
    FFMPEG LOG ITEM -       handler_name    : SoundHandler
    FFMPEG LOG ITEM - Input #2, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\Alan\Desktop\output2.mp4':
    FFMPEG LOG ITEM -   Metadata:
    FFMPEG LOG ITEM -     major_brand     : isom
    FFMPEG LOG ITEM -     minor_version   : 512
    FFMPEG LOG ITEM -     compatible_brands: isomiso2avc1mp41
    FFMPEG LOG ITEM -     encoder         : Lavf57.56.100
    FFMPEG LOG ITEM -   Duration: 00:01:34.22, start: 0.000000, bitrate: 1058 kb/s
    FFMPEG LOG ITEM -     Stream #2:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 852x480 [SAR 3893:2872 DAR 276403:114880], 923 kb/s, SAR 12800:9443 DAR 320:133, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    FFMPEG LOG ITEM -     Metadata:
    Exception thrown: 'NReco.VideoConverter.FFMpegException' in NReco.VideoConverter.dll
    FFMPEG LOG ITEM -       handler_name    : VideoHandler
    FFMPEG LOG ITEM -     Stream #2:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    FFMPEG LOG ITEM -     Metadata:
    FFMPEG LOG ITEM -       handler_name    : SoundHandler
    FFMPEG LOG ITEM - [Parsed_concat_0 @ 04ded5e0] Input link in1:v0 parameters (size 852x480, SAR 160:213) do not match the corresponding output link in0:v0 parameters (852x480, SAR 12800:9443)
    FFMPEG LOG ITEM - [Parsed_concat_0 @ 04ded5e0] Failed to configure output pad on Parsed_concat_0
    FFMPEG LOG ITEM - Error configuring complex filters.
    FFMPEG LOG ITEM - Invalid argument