여러 비디오 연결: FPS 및 오디오 피치가 잘못됨

여러 비디오 연결: FPS 및 오디오 피치가 잘못됨

다음과 같은 프로세스가 있습니다.

  1. N개의 입력 비디오가 있습니다. 다음 코드를 사용하여 잘라내고 트랜스코딩했습니다.

    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 오류 -filter:v fps=fps=25 -c:v h264_nvenc -사전 설정 중간 -프로필 높음 -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. 다음 형식으로 videoArrayFile.txt를 생성합니다.

    파일 'myFilePath\output_N.mp4' 파일 'myFilePath\output_N.mp4' 파일 'myFilePath\output_N.mp4' ...

  3. 다음 명령을 사용하여 videoArrayFile.txt의 파일을 연결합니다.

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

위 명령을 실행할 때의 ffmpeg 로그는 다음과 같습니다.

[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

절차는 작동 중이지만 일부 입력 파일을 사용하면 일부 문제가 발생합니다.FPS 및 오디오 피치 문제: 출력 파일이 가변 프레임 속도이고 오디오 속도가 잘못되었습니다.

"output_N"의 Ffprobe는 다음을 생성합니다.

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

OutputConcat.mp4의 ffprobe가 생성되는 동안

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

outputConcat.mp4의 타임베이스는 다른 것과 다릅니다. 이 동작은 오디오 스트림의 다양한 샘플 속도와 관련이 있습니까(입력 파일에서 알 수 있는 유일한 차이점)?

1)번 항목에서 볼 수 있듯이 입력 FPS는 25로 설정되어 있으며 모든 입력 비디오의 코덱과 해상도는 정확히 동일합니다.

출력이 입력과 동일한 FPS를 갖고 오디오 피치 문제가 없도록 비디오를 어떻게 연결할 수 있습니까? 타임베이스 문제일 수 있나요?

고마워요, 마르코

답변1

문제에 대한 부분적인 해결책을 찾았습니다. 문제는 입력의 오디오 샘플 속도가 일관되지 않고 첫 번째 변환 중에 이를 관리하지 않았다는 것입니다. 모든 초기 변환 문자열에 추가하여 -ar 32000오디오 피치 문제를 해결했습니다. fps가 변경되는 이유를 아직도 이해하려고 노력 중입니다.

관련 정보