Concat viele Videos: FPS und Audio-Pitch falsch

Concat viele Videos: FPS und Audio-Pitch falsch

Ich habe einen Prozess wie diesen:

  1. ich habe N Eingangsvideos; ich schneide und transkodiere sie mit dem folgenden Code:

    ffmpeg.exe -c:v h264_cuvid -resize 1920x1080 -noaccurate_seek -ss 00:00:04.000 -to 00:00:44.240 -i "input_N.MP4" -v Fehler -filter:v fps=fps=25 -c:v h264_nvenc -preset mittel -profile hoch -b:v 8000k -bufsize 8000k -maxrate 10000k -qmin 0 -g 250 -bf 2 -i_qfactor 0,75 -b_qfactor 1,1 "output_N.mp4"

  2. Ich erstelle eine videoArrayFile.txt im folgenden Format:

    Datei „myFilePath\output_N.mp4“ Datei „myFilePath\output_N.mp4“ Datei „myFilePath\output_N.mp4“ …

  3. Ich verknüpfe die Dateien in videoArrayFile.txt mit dem folgenden Befehl:

    ffmpeg.exe -f concat -v error -safe 0 -i "meinPfad\videoArrayFile.txt" -filter:a "volume=1" -c:v copy -c:a aac "meinPfad\outputConcat.mp4"

Dies ist das ffmpeg-Protokoll, wenn ich den obigen Befehl ausführe:

[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (50) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (50) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (50) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (50) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (50) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (50) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (50) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 000001fa4273e000] Number of scalefactor bands in group (51) exceeds limit (49).
Error while decoding stream #0:1: Invalid data found when processing input

Das Verfahren funktioniert, aber bei der Verwendung einiger Eingabedateien habe ich einigeFPS- und Audio-Pitch-Problem: die Ausgabedatei hat eine variable Bildrate und die Audiogeschwindigkeit ist falsch.

Ffprobe erzeugt auf dem „output_N“ folgendes:

file 'D:\SharedExp_SSD\Outs\0.51.8\2020-10-30_11-45_LancioTandem-30FPS_1604054749\video_HL\tmp\introEncoded.mp4'

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'introEncoded.mp4':   Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.42.100   Duration: 00:00:04.60, start: 0.000000, bitrate: 2707 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 2575 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : Core Media Video
    Stream #0:1(ita): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 131 kb/s (default)
    Metadata:
      handler_name    : Core Media Audio
       file 'D:\SharedExp_SSD\Outs\0.51.8\2020-10-30_11-45_LancioTandem-30FPS_1604054749\video_HL\tmp\Exp_1488_clip_0.mp4'

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Exp_1488_clip_0.mp4':   Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.42.100   Duration: 00:00:40.27, start: 0.000000, bitrate: 8142 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 8221 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    :  GoPro AVC
      timecode        : 12:52:03:24
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 32000 Hz, mono, fltp, 69 kb/s (default)
    Metadata:
      handler_name    :  GoPro AAC
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      handler_name    :  GoPro AVC
      timecode        : 12:52:03:24 Unsupported codec with id 0 for input stream 2

file 'D:\SharedExp_SSD\Outs\0.51.8\2020-10-30_11-45_LancioTandem-30FPS_1604054749\video_HL\tmp\Exp_1488_clip_1.mp4'

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Exp_1488_clip_1.mp4':   Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.42.100   Duration: 00:00:05.03, start: 0.000000, bitrate: 8460 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 10239 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    :  GoPro AVC
      timecode        : 13:22:01:01
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 32000 Hz, mono, fltp, 69 kb/s (default)
    Metadata:
      handler_name    :  GoPro AAC
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s
    Metadata:
      handler_name    :  GoPro AVC
      timecode        : 13:22:01:01 Unsupported codec with id 0 for input stream 2


file 'D:\SharedExp_SSD\Outs\0.51.8\2020-10-30_11-45_LancioTandem-30FPS_1604054749\video_HL\tmp\Exp_1488_clip_2.mp4'

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Exp_1488_clip_2.mp4':   Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.42.100   Duration: 00:00:08.03, start: 0.000000, bitrate: 8926 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 9303 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    :  GoPro AVC
      timecode        : 13:22:01:01
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 32000 Hz, mono, fltp, 69 kb/s (default)
    Metadata:
      handler_name    :  GoPro AAC
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s
    Metadata:
      handler_name    :  GoPro AVC
      timecode        : 13:22:01:01 Unsupported codec with id 0 for input stream 2

Während ffprobe auf outputConcat.mp4 produziert

outputConcat.mp4:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'outputConcat.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.42.100
  Duration: 00:00:57.54, start: 0.000000, bitrate: 7900 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 7820 kb/s, 24.28 fps, 25 tbr, 15360 tbn, 50 tbc (default)
    Metadata:
      handler_name    : Core Media Video
    Stream #0:1(ita): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 111 kb/s (default)
    Metadata:
      handler_name    : Core Media Audio

Die Zeitbasis in outputConcat.mp4 unterscheidet sich von den anderen: Hängt dieses Verhalten mit der unterschiedlichen Abtastrate der Audiostreams zusammen (der einzige Unterschied, den ich in den Eingabedateien erkennen kann)?

Wie Sie unter Punkt 1) sehen können, ist die Eingangs-FPS auf 25 eingestellt und alle Eingangsvideos haben genau denselben Codec und dieselbe Auflösung.

Wie kann ich die Videos so zusammenfügen, dass die Ausgabe die gleiche FPS wie die Eingabe hat und es kein Tonhöhenproblem gibt? Kann es ein Zeitbasisproblem sein?

Danke, Marco

Antwort1

Ich habe eine Teillösung für das Problem gefunden: Das Problem war, dass die Audio-Abtastrate der Eingänge nicht kohärent war und ich dies bei der ersten Konvertierung nicht hinbekommen habe. Indem ich -ar 32000die gesamte anfängliche Konvertierungszeichenfolge hinzugefügt habe, habe ich das Problem mit der Tonhöhe gelöst. Ich versuche immer noch zu verstehen, warum sich die fps ändern

verwandte Informationen