Я пытаюсь записать потоковое видео в локальный файл, используя следующий синтаксис:
ffmpeg -i "http://test.com/videoxxx" -c copy -bsf:v aac_adtstoasc -t 10 c:\\temp\\out.mp4 -loglevel debug
Это работает довольно хорошо, но недавно я столкнулся с определенной ошибкой:
[mpegts @ 00000232c9568f40] DTS 165134700 < 165199500 out of order
[mpegts @ 00000232c9568f40] Non-increasing DTS in stream 0: packet 249 with DTS 165199500, packet 250 with DTS 165134700
[mpegts @ 00000232c9568f40] Continuity check failed for pid 0 expected 12 got 11
[mpegts @ 00000232c9568f40] Continuity check failed for pid 4096 expected 12 got 11
[h264 @ 00000232c9571980] ct_type:0 pic_struct:1
[mpegts @ 00000232c9568f40] Continuity check failed for pid 256 expected 8 got 10
[mpegts @ 00000232c9568f40] Continuity check failed for pid 17 expected 10 got 5
[mpegts @ 00000232c9568f40] Continuity check failed for pid 257 expected 2 got 12
[mpegts @ 00000232c9568f40] PES packet size mismatch
[mpegts @ 00000232c9568f40] Non-increasing DTS in stream 1: packet 207 with DTS 165121380, packet 208 with DTS 164212020
[mpegts @ 00000232c9568f40] max_analyze_duration 5000000 reached at 5016000 microseconds st:1
[mpegts @ 00000232c9568f40] After avformat_find_stream_info() pos: 799667 bytes read:822628 seeks:0 frames:463
Input #0, mpegts, from 'http://test.com/videoxxx':
Duration: N/A, start: 1824.578000, bitrate: N/A
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100], 252, 1/90000: Video: h264 (High), 1 reference frame ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg, top first, left), 720x576 [SAR 16:11 DAR 20:11], 0/1, 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:1[0x101](pol), 211, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s
Successfully opened the file.
Parsing a group of options: output url c:\temp\out.mp4.
Applying option c (codec name) with argument copy.
Applying option bsf:a (A comma-separated list of bitstream filters) with argument aac_adtstoasc.
Applying option t (record or transcode "duration" seconds of audio/video) with argument 30.
Successfully parsed a group of options.
Opening an output file: c:\temp\out.mp4.
[file @ 00000232ca120e80] Setting default whitelist 'file,crypto'
Successfully opened the file.
[AVBSFContext @ 00000232ca6e5780] Codec 'mp2' (86016) is not supported by the bitstream filter 'aac_adtstoasc'. Supported codecs are: aac (86018)
Error initializing bitstream filter: aac_adtstoasc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Last message repeated 1 times
[AVIOContext @ 00000232c95ecfc0] Statistics: 0 seeks, 0 writeouts
[AVIOContext @ 00000232c9574780] Statistics: 822628 bytes read, 0 seeks
Можно ли использовать специальную команду FFMPEG, чтобы избежать проблемы с битовым фильтром? Я пробовал:
-vcodec copy -t 20 c:\\temp\\out.mp4 -loglevel debug
и:
c:a copy -t 10 c:\\temp\\out.mp4 -loglevel debug
, но я могу создать обрезанный mp4 с 1 кадром и обрезкой звука через 1/2 сек.
Это также способ отладки исходного кода? Thx