1

Я использовал этот код для объединения трех видео вместе с ffmpeg:

ffmpeg -y -f concat -safe 0 -i list.txt -c copy done.mp4

list.txt содержит:

file 'first.mp4'
duration 2.5
file 'second.mp4'
duration 20.0
file 'third.mp4'
duration 1.5

Но у выходного видео нет звука! Я хочу, чтобы звук каждого из них оставался на выходе.

какой код я должен использовать?


Полный вывод ffmpeg:

ffmpeg -y -f concat -safe 0 -i list.txt -c copy done.mp4
ffmpeg version N-92833-gfccba32b4c Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181201
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 25.100 / 56. 25.100
  libavcodec     58. 42.104 / 58. 42.104
  libavformat    58. 25.100 / 58. 25.100
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 46.101 /  7. 46.101
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000024a408e3dc0] Auto-inserting h264_mp4toannexb bitstream filter
Input #0, concat, from 'list.txt':
  Duration: 00:00:58.00, start: 0.000000, bitrate: 0 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x640 [SAR 1:1 DAR 1:1], 182 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc
    Metadata:
      handler_name    : VideoHandler
Output #0, mp4, to 'done.mp4':
  Metadata:
    encoder         : Lavf58.25.100
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x640 [SAR 1:1 DAR 1:1], q=2-31, 182 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000024a408ec540] Auto-inserting h264_mp4toannexb bitstream filter
[mp4 @ 0000024a408ea1c0] Non-monotonous DTS in output stream 0:0; previous: 30720, current: 24576; changing to 30721. This may result in incorrect timestamps in the output file.
[mp4 @ 0000024a408ea1c0] Non-monotonous DTS in output stream 0:0; previous: 30721, current: 25088; changing to 30722. This may result in incorrect timestamps in the output file.
[concat @ 0000024a408da300] New audio stream 0:1 at pos:12735 and DTS:1.97678s
[mp4 @ 0000024a408ea1c0] Non-monotonous DTS in output stream 0:0; previous: 30722, current: 25600; changing to 30723. This may result in incorrect timestamps in the output file.
[mp4 @ 0000024a408ea1c0] Non-monotonous DTS in output stream 0:0; previous: 30723, current: 26112; changing to 30724. This may result in incorrect timestamps in the output file.
[mp4 @ 0000024a408ea1c0] Non-monotonous DTS in output stream 0:0; previous: 30724, current: 26624; changing to 30725. This may result in incorrect timestamps in the output file.
[mp4 @ 0000024a408ea1c0] Non-monotonous DTS in output stream 0:0; previous: 30725, current: 27136; changing to 30726. This may result in incorrect timestamps in the output file.
[mp4 @ 0000024a408ea1c0] Non-monotonous DTS in output stream 0:0; previous: 30726, current: 27648; changing to 30727. This may result in incorrect timestamps in the output file.
[mp4 @ 0000024a408ea1c0] Non-monotonous DTS in output stream 0:0; previous: 30727, current: 28160; changing to 30728. This may result in incorrect timestamps in the output file.
[mp4 @ 0000024a408ea1c0] Non-monotonous DTS in output stream 0:0; previous: 30728, current: 28672; changing to 30729. This may result in incorrect timestamps in the output file.
[mp4 @ 0000024a408ea1c0] Non-monotonous DTS in output stream 0:0; previous: 30729, current: 29184; changing to 30730. This may result in incorrect timestamps in the output file.
[mp4 @ 0000024a408ea1c0] Non-monotonous DTS in output stream 0:0; previous: 30730, current: 29696; changing to 30731. This may result in incorrect timestamps in the output file.
[mp4 @ 0000024a408ea1c0] Non-monotonous DTS in output stream 0:0; previous: 30731, current: 30208; changing to 30732. This may result in incorrect timestamps in the output file.
[mp4 @ 0000024a408ea1c0] Non-monotonous DTS in output stream 0:0; previous: 30732, current: 30720; changing to 30733. This may result in incorrect timestamps in the output file.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000024a408ec540] Auto-inserting h264_mp4toannexb bitstream filter
frame=  984 fps=0.0 q=-1.0 Lsize=    1495kB time=00:00:54.60 bitrate= 224.3kbits/s speed=1.4e+03x
video:1483kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.796812%

0