2

I trying to concat videos downloaded from yt-dlp using and getting the error

ffmpeg -y -f concat -safe 0 -i files.txt -map 0 -c copy merged.mp4

I also tried using 'vcodec vp9', '-bsf:a aac_adtstoasc', '-c:v libvpx' but to no avail getting the error :

  built with gcc 13.2.0 (crosstool-NG 1.25.0.232_c175b21)
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libharfbuzz --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-chromaprint --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libaribcaption --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libvpl --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --enable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20240220
  libavutil      58. 39.100 / 58. 39.100
  libavcodec     60. 39.101 / 60. 39.101
  libavformat    60. 21.101 / 60. 21.101
  libavdevice    60.  4.100 / 60.  4.100
  libavfilter     9. 17.100 /  9. 17.100
  libswscale      7.  6.100 /  7.  6.100
  libswresample   4. 13.100 /  4. 13.100
  libpostproc    57.  4.100 / 57.  4.100
Input #0, concat, from 'files.txt':
  Duration: N/A, start: 0.000000, bitrate: 223 kb/s
  Stream #0:0(und): Video: vp9 (Profile 0) (vp09 / 0x39307076), yuv420p(tv, bt709), 640x360, 95 kb/s, 30 fps, 30 tbr, 16k tbn
      Metadata:
        handler_name    : ISO Media file produced by Google Inc. Created on: 08/22/2024.
        vendor_id       : [0][0][0][0]
  Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s
      Metadata:
        handler_name    : ISO Media file produced by Google Inc.
        vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Output #0, mp4, to 'merged.mp4':
  Metadata:
    encoder         : Lavf60.21.101
  Stream #0:0(und): Video: vp9 (Profile 0) (vp09 / 0x39307076), yuv420p(tv, bt709), 640x360, q=2-31, 95 kb/s, 30 fps, 30 tbr, 16k tbn
      Metadata:
        handler_name    : ISO Media file produced by Google Inc. Created on: 08/22/2024.
        vendor_id       : [0][0][0][0]
  Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s
      Metadata:
        handler_name    : ISO Media file produced by Google Inc.
        vendor_id       : [0][0][0][0]
Press [q] to stop, [?] for help
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000026d78ab6c00] Auto-inserting h264_mp4toannexb bitstream filter
[vost#0:0/copy @ 0000026d78c20940] Non-monotonic DTS; previous: 25058651, current: 24669408; changing to 25058652. This may result in incorrect timestamps in the output file.
[vost#0:0/copy @ 0000026d78c20940] Non-monotonic DTS; previous: 25058652, current: 24669933; changing to 25058653. This may result in incorrect timestamps in the output file.
[vost#0:0/copy @ 0000026d78c20940] Non-monotonic DTS; previous: 25058653, current: 24670458; changing to 25058654. This may result in incorrect timestamps in the output file.
[vost#0:0/copy @ 0000026d78c20940] Non-monotonic DTS; previous: 25058654, current: 24670983; changing to 25058655. This may result in incorrect timestamps in the output file.
[vost#0:0/copy @ 0000026d78c20940] Non-monotonic DTS; previous: 25058655, current: 24671508; changing to 25058656. This may result in incorrect timestamps in the output file.
[vost#0:0/copy @ 0000026d78c20940] Non-monotonic DTS; previous: 25058656, current: 24672033; changing to 25058657. This may result in incorrect timestamps in the output file.
[vost#0:0/copy @ 0000026d78c20940] Non-monotonic DTS; previous: 25058657, current: 24672558; changing to 25058658. This may result in incorrect timestamps in the output file.
[vost#0:0/copy @ 0000026d78c20940] Non-monotonic DTS; previous: 25058658, current: 24673083; changing to 25058659. This may result in incorrect timestamps in the output file.
[vp9_superframe @ 0000026d78c21880] Too many invisible frames
[mp4 @ 0000026d78ab7440] Error applying bitstream filters to an output packet for stream #0: Invalid data found when processing input
[vost#0:0/copy @ 0000026d78c20940] Error submitting a packet to the muxer: Invalid data found when processing input
    Last message repeated 1 times
[out#0/mp4 @ 0000026d76a39b40] Error muxing a packet
[out#0/mp4 @ 0000026d76a39b40] Task finished with error code: -1094995529 (Invalid data found when processing input)
[out#0/mp4 @ 0000026d76a39b40] Terminating thread with return code -1094995529 (Invalid data found when processing input)
[out#0/mp4 @ 0000026d76a39b40] video:13886KiB audio:24474KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 3.967859%
size=   39883KiB time=00:25:42.19 bitrate= 211.9kbits/s speed=2.45e+03x
Conversion failed!

What I want is to mux videos which takes only few seconds for all and not re-encode them which takes several minutes for each file. Nonetheless I am willing to convert the videos which are causing error but I'm unaware which videos are faulty and why. If this helps this code is working on some other videos (in another folder) which have been downloaded from yt-dlp.

Edit 1: I tried removing the videos one by one to know which caused error (quite cumbersome), and found that two of them were causing the whole conversion to fail, As I read somewhere, maybe avc, vp9 codec were at conflict, so i opened them in media info and it was quite opposite. the 2 error full videos that caused error has vp9 codec as some others , and there were some videos with avc which didn't caused any error at all. If the helps those videos are first in line of processing.

Edit 2: Shifted the errorfull videos to last of file [so they would be last to be processed], and the conversion was successful, BUT the output merged video was lagging around first half and not working at all in the last segment.damn.

xmsk
  • 21

0 Answers0