I am developing an application. People upload videos from their mobile, from other places.
Using a CMS in PHP (it is the language with which the application is developed) I need to generate a unique video with these partial uploads.
Through FFmpeg I am doing tests, from the command line:
ffmpeg -i concat:IMG_1916.mp4\|IMG_1917.mp4 -c copy videoLoop.mp4
This code when I run it says:
ffmpeg version 3.2.4 Copyright (c) 2000-2017 the FFmpeg developers built with Apple LLVM version 8.0.0 (clang-800.0.42.1) configuration: --prefix=/usr/local/Cellar/ffmpeg/3.2.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda libavutil 55. 34.101 / 55. 34.101 libavcodec 57. 64.101 / 57. 64.101 libavformat 57. 56.101 / 57. 56.101 libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100 libavresample 3. 1. 0 / 3. 1. 0 libswscale 4. 2.100 / 4. 2.100 libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100 / 54. 1.100 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f8515000000] Found duplicated MOOV Atom. Skipped it Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'concat:IMG_1916.mp4|IMG_1917.mp4': Metadata: encoder : Lavf57.66.102 major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 Duration: 00:00:04.27, start: 0.000000, bitrate: 26792 kb/s Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1920x1080, 11978 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 120 kb/s (default) Metadata: handler_name : SoundHandler Output #0, mp4, to 'videoLoop.mp4': Metadata: compatible_brands: isomiso2avc1mp41 major_brand : isom minor_version : 512 encoder : Lavf57.56.101 Stream #0:0(und): Video: h264 (Constrained Baseline) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080, q=2-31, 11978 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 30k tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (LC) ([64][0][0][0] / 0x0040), 44100 Hz, mono, 120 kb/s (default) Metadata: handler_name : SoundHandler Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help frame= 127 fps=0.0 q=-1.0 Lsize= 6264kB time=00:00:04.22 bitrate=12142.8kbits/s speed= 376x video:6196kB audio:63kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.076698%
This execution generates a video, but not concatenated with the 2 specified, only with the first one.
Why not join the 2?
The videos to upload, will be of very different formats so I can not define codec.