6 개의 mp4 파일을 하나로 병합해야합니다. 파일에 대한 정보는 다음과 같습니다.
pt1.mp4
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 854x480 [SAR 1:1 DAR 427:240], 998 kb/s, 23.98 fps, 23.98 tbr, 11988 tbn, 47.95
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
pt2.mp4
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 854x480 [SAR 1280:1281 DAR 16:9], 1000 kb/s, 23.98 fps, 23.98 tbr, 11988 tbn,
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 130 kb/s (default)
pt3.mp4
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 854x480 [SAR 1280:1281 DAR 16:9], 1001 kb/s, 23.98 fps, 23.98 tbr, 11988 tbn,
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
pt4.mp4
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 854x480 [SAR 1280:1281 DAR 16:9], 990 kb/s, 23.98 fps, 23.98 tbr, 11988 tbn,
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
pt5.mp4
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 854x480 [SAR 1280:1281 DAR 16:9], 994 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn,
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
pt6.mp4
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 854x480 [SAR 1280:1281 DAR 16:9], 997 kb/s, 23.98 fps, 23.98 tbr, 11988 tbn,
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
ffmpeg에 대한 문서를 읽은 후 파일을 ts로 변환 한 후 연결하십시오.
ffmpeg -i pt1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts pt1.ts
...
ffmpeg -i pt6.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts pt6.ts
ffmpeg -i concat:"pt1.ts|pt2.ts|pt3.ts|pt4.ts|pt5.ts|pt6.ts" -c copy -bsf:a aac_adtstoasc output.mp4
그러나 불행히도 결과 파일은 개별적으로 작동하지만 정상적으로 작동하지 않습니다.
연결 로그는 다음과 같습니다.
Input #0, mpegts, from 'concat:pt1.ts|pt2.ts|pt3.ts|pt4.ts|pt5.ts|pt6.ts':
Duration: 00:33:11.57, start: 1.400000, bitrate: 7453 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 854x480 [SAR 1:1 DAR 427:240], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
Stream #0:1[0x101](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 125 kb/s
[mp4 @ 0x12e3080] Codec for stream 0 does not use global headers but container format requires global headers
[mp4 @ 0x12e3080] Codec for stream 1 does not use global headers but container format requires global headers
Output #0, mp4, to 'output.mp4':
Metadata:
encoder : Lavf56.40.101
Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 854x480 [SAR 1:1 DAR 427:240], q=2-31, 23.98 fps, 23.98 tbr, 90k tbn, 90k tbc
Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 125 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mp4 @ 0x12e3080] Non-monotonous DTS in output stream 0:1; previous: 195910409, current: 195909909; changing to 195910410. This may result in incorrect timestamps in the output file.
[mp4 @ 0x12e3080] Non-monotonous DTS in output stream 0:1; previous: 301545749, current: 301545544; changing to 301545750. This may result in incorrect timestamps in the output file.
[mp4 @ 0x12e3080] Non-monotonous DTS in output stream 0:1; previous: 475343963, current: 475340939; changing to 475343964. This may result in incorrect timestamps in the output file.
[mp4 @ 0x12e3080] Non-monotonous DTS in output stream 0:1; previous: 475343964, current: 475341963; changing to 475343965. This may result in incorrect timestamps in the output file.
[mp4 @ 0x12e3080] Non-monotonous DTS in output stream 0:1; previous: 475343965, current: 475342987; changing to 475343966. This may result in incorrect timestamps in the output file.
frame=294625 fps=38748 q=-1.0 Lsize= 1645766kB time=03:18:14.48 bitrate=1133.5kbits/s
video:1449809kB audio:186316kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.589257%
아마도 이것은 다른 프레임 속도, 5 개 fps 23.98 및 하나의 29.97 때문일까요?
1
정상적으로 작동을 거부 -> 의미?
—
Gyan
@Gyan, 플레이어에서 비디오 디코딩 오류보고
—
Dmitriy
어느 선수? ffplay가 잘 표시됩니까?
—
Gyan
소니 브라비아의 @Gyan, Plex KDL-42W653A, 다른 플레이어는 정상적으로 작동하지만 비디오가 되감 으면 정지합니다.
—
Dmitriy