Estou acostumado a gravar programas de TV não-HD, usar o DGIndex para converter o arquivo ts resultante e continuar removendo comerciais, transcodificar para mp4, ...
Agora eu gravei um programa de TV em 1080p. Uma vez que o DGIndex não funciona neles e DLL DGAVCDecode.dll do DGAVCIndex provoca muitos blocos eu preciso encontrar uma nova maneira de fazer as coisas. O que eu estou curioso é como DGIndex / DGAVCIndex detectar o atraso de áudio. Eu pensei que o ffmpeg é mais sofisticado e não deveria ser um problema vê-lo lá, mas eu não posso.
Aqui está a saída do ffmpeg:
V:\>ffmpeg -i "20130327 0108.ts"
ffmpeg version N-50911-g9efcfbe Copyright (c) 2000-2013 the FFmpeg developers
built on Mar 13 2013 21:26:48 with gcc 4.7.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 19.100 / 52. 19.100
libavcodec 55. 0.100 / 55. 0.100
libavformat 55. 0.100 / 55. 0.100
libavdevice 54. 4.100 / 54. 4.100
libavfilter 3. 45.103 / 3. 45.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] mmco: unref short failure
Last message repeated 5 times
[mpegts @ 025597e0] Stream #0: not enough frames to estimate rate; consider increasing probesize
[NULL @ 03f019a0] start time is not set in estimate_timings_from_pts
[mpegts @ 025597e0] PES packet size mismatch
Last message repeated 2 times
Input #0, mpegts, from '20130327 0108.ts':
Duration: 01:51:59.74, start: 12467.588567, bitrate: 9273 kb/s
Program 105
Program 106
Stream #0:0[0x20](deu): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
Stream #0:1[0x1ff]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:2[0x203](deu): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz, stereo, fltp, 384 kb/s (clean effects)
Stream #0:3[0x204](eng): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz, stereo, fltp, 384 kb/s (clean effects)
Program 107
Program 108
Program 242
Program 3997
Program 3998
Program 4017
Program 4028
Program 4035
At least one output file must be specified
V:\>
Nota: apesar das linhas h264, o vídeo é reproduzido bem.
Depois de jogar a moldura do VirtualDub, AviSynth e ffmpeg no vídeo, meus olhos e ouvidos me dizem que no arquivo resultante o áudio está desligado por aproximadamente -350ms de acordo com o VLC. Em outras palavras, achei que poderia encontrar algo na saída do ffmpeg que me levaria a esses 350ms.
Eu também usei o parâmetro -debug_ts
do ffmpeg e obtive linhas como:
demuxer -> ist_index:1 type:video next_dts:NOPTS next_dts_time:NOPTS next_pts:NOPTS next_pts_time:NOPTS pkt_pts:1122126141 pkt_pts_time:12468.1 pkt_dts:1122122541 pkt_dts_time:12468 off:-12467588567 off_time:-12467.6
demuxer+ffmpeg -> ist_index:1 type:video pkt_pts:42135 pkt_pts_time:0.468167 pkt_dts:38535 pkt_dts_time:0.428167 off:-12467600067 off_time:-12467.6
demuxer -> ist_index:1 type:video next_dts:448167 next_dts_time:0.448167 next_pts:0 next_pts_time:0 pkt_pts:1122127941 pkt_pts_time:12468.1 pkt_dts:1122124341 pkt_dts_time:12468 off:-12467600067 off_time:-12467.6
demuxer+ffmpeg -> ist_index:1 type:video pkt_pts:43935 pkt_pts_time:0.488167 pkt_dts:40335 pkt_dts_time:0.448167 off:-12467600067 off_time:-12467.6
Com -fdebug ts
do ffmpeg, recebo linhas como:
first_dts 1122082971 not matching first dts 1122097371
first_dts 1122084006 not matching first dts 1122098406
first_dts 1122082971 not matching first dts 1122111771
first_dts 1122084006 not matching first dts 1122112806
first_dts 1122082971 not matching first dts 1122126171
first_dts 1122084006 not matching first dts 1122127206
O único número próximo que consegui obter é o uso dos números da primeira linha da saída acima:
1122097371 - 1122082971 = 14400
14400 / 48000 (the samplerate) = 0.3
Mas eu não tenho absolutamente nenhuma ideia do que estou fazendo ou se isso deve fazer sentido ...;)
Alguém tem experiência com isso e pode me ajudar a calcular o atraso?