FFMPEG concat audio и videos производит только аудио - PullRequest
0 голосов
/ 19 сентября 2019

Я пытаюсь объединить несколько видеофайлов в один аудиофайл.При использовании только видео без звука, он работает нормально, но при добавлении звуковой дорожки в начало файла concat я получаю возврат ниже, и output.mp4 становится просто аудио без видео при предварительном просмотре в браузере.Команда FFMPEG

ffmpeg -f concat -safe 0 -i /var/www/html/video_tool/edit/out/concat.txt -c copy -flags +global_header /var/www/html/video_tool/edit/out/output.mp4

concat.txt

#CONCAT FILE
file '/var/www/html/video_tool/edit/audio/sound.mp3'
file '/var/www/html/video_tool/edit/vids/frame_0.mp4'
file '/var/www/html/video_tool/edit/vids/frame_1.mp4'
file '/var/www/html/video_tool/edit/vids/frame_2.mp4'
file '/var/www/html/video_tool/edit/vids/frame_3.mp4'

Вывод

ffmpeg version 4.1.3-0york1~16.04 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.11) 20160609
  configuration: --prefix=/usr --extra-version='0york1~16.04' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-nonfree --enable-libfdk-aac --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
[mp3 @ 0x5635174e08c0] Estimating duration from bitrate, this may be inaccurate
Input #0, concat, from '/var/www/html/video_tool/edit/out/concat.txt':
  Duration: N/A, start: 0.000000, bitrate: 192 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 192 kb/s
Output #0, mp4, to '/var/www/html/video_tool/edit/out/output.mp4':
  Metadata:
    encoder         : Lavf58.20.100
    Stream #0:0: Audio: mp3 (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 192 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5635174e38c0] Auto-inserting h264_mp4toannexb bitstream filter
[mp4 @ 0x5635174e5080] Non-monotonous DTS in output stream 0:0; previous: 9897984, current: 8976; changing to 9897985. This may result in incorrect timestamps in the output file.
[mp4 @ 0x5635174e5080] Non-monotonous DTS in output stream 0:0; previous: 9897985, current: 8977; changing to 9897986. This may result in incorrect timestamps in the output file.
[mp4 @ 0x5635174e5080] Non-monotonous DTS in output stream 0:0; previous: 9897986, current: 8979; changing to 9897987. This may result in incorrect timestamps in the output file.
[mp4 @ 0x5635174e5080] Non-monotonous DTS in output stream 0:0; previous: 9897987, current: 8980; changing to 9897988. This may result in incorrect timestamps in the output file.
etc, etc...
size=    5347kB time=00:03:44.44 bitrate= 195.1kbits/s speed=2.91e+03x    
video:0kB audio:5311kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.664769%
...