ffmpeg-Transcodierung H264 interlaced und Interlacing über H264_NVENC-Codec fortsetzen

Ich habe die folgende interlaced H264-Datei:

Stream #0:0[0x335]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg, top first), 720x576 [SAR 16:11 DAR 20 :11], 25 fps, 50 tbr, 90.000 tbn, 50 tbc

Und dies ist ein Frame aus dem Quellvideo:Geben Sie hier die Bildbeschreibung ein

Wenn ich verwende:

ffprobe -show_frames -i Quelle.mpg | grep interlaced_frame

Alle Frames sind interlaced:
interlaced_frame=1
interlaced_frame=1
.
.
.
interlaced_frame=1

Ich möchte diese Datei transkodieren und weiterhin verschachteln und versuche es mit dem folgenden Befehl:

ffmpeg -i source.mpg -vcodec h264_nvenc -flags +ildct+ilme -acodec copy -f mpegts out.mpg

Nach der Transcodierung sieht derselbe Frame aus der Datei "out.mpg" wie folgt aus:

Geben Sie hier die Bildbeschreibung ein

Dies ist eine Konsolenausgabe:

[h264 @ 0x2b546c0] SPS unavailable in decode_picture_timing
[h264 @ 0x2b546c0] non-existing PPS 0 referenced
[h264 @ 0x2b546c0] SPS unavailable in decode_picture_timing
[h264 @ 0x2b546c0] non-existing PPS 0 referenced
[h264 @ 0x2b546c0] decode_slice_header error
[h264 @ 0x2b546c0] no frame!
[h264 @ 0x2b546c0] SPS unavailable in decode_picture_timing
[h264 @ 0x2b546c0] non-existing PPS 0 referenced
[h264 @ 0x2b546c0] SPS unavailable in decode_picture_timing
[h264 @ 0x2b546c0] non-existing PPS 0 referenced
[h264 @ 0x2b546c0] decode_slice_header error
[h264 @ 0x2b546c0] no frame!
[h264 @ 0x2b546c0] SPS unavailable in decode_picture_timing
[h264 @ 0x2b546c0] non-existing PPS 0 referenced
[h264 @ 0x2b546c0] SPS unavailable in decode_picture_timing
[h264 @ 0x2b546c0] non-existing PPS 0 referenced
[h264 @ 0x2b546c0] decode_slice_header error
[h264 @ 0x2b546c0] no frame!
[h264 @ 0x2b546c0] SPS unavailable in decode_picture_timing
[h264 @ 0x2b546c0] non-existing PPS 0 referenced
[h264 @ 0x2b546c0] SPS unavailable in decode_picture_timing
[h264 @ 0x2b546c0] non-existing PPS 0 referenced
[h264 @ 0x2b546c0] decode_slice_header error
[h264 @ 0x2b546c0] no frame!
[h264 @ 0x2b546c0] mmco: unref short failure
    Last message repeated 1 times
[mpegts @ 0x2b4fcc0] PES packet size mismatch
Input #0, mpegts, from 'source.mpg':
  Duration: 01:00:00.95, start: 44661.794367, bitrate: 3336 kb/s
  Program 2101 
    Metadata:
      service_name    : ?������ �����
      service_provider: TricolorTV
    Stream #0:0[0x335]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg, top first), 720x576 [SAR 16:11 DAR 20:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x336](rus): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #0:2[0x337](rus): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
Output #0, mpegts, to 'out.mpg':
  Metadata:
    encoder         : Lavf57.56.100
    Stream #0:0: Video: h264 (h264_nvenc) (Main), yuv420p, 720x576 [SAR 16:11 DAR 20:11], q=-1--1, 2000 kb/s, 25 fps, 90k tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.64.100 h264_nvenc
    Side data:
      cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 4000000 vbv_delay: -1
    Stream #0:1(rus): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, 192 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_nvenc))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[h264 @ 0x2b91360] reference picture missing during reorder
[h264 @ 0x2b91360] Missing reference picture, default is 2147483647
[h264 @ 0x2bf1f40] mmco: unref short failure
    Last message repeated 1 times
[h264 @ 0x2bf1f40] number of reference frames (0+5) exceeds max (4; probably corrupt input), discarding one
[h264 @ 0x2c7bf80] reference picture missing during reorder
[h264 @ 0x2c7bf80] Missing reference picture, default is 65736
[h264 @ 0x2c979e0] mmco: unref short failure
[h264 @ 0x2ccefa0] mmco: unref short failure
[h264 @ 0x2bf1f40] mmco: unref short failure
frame= 1232 fps=169 q=34.0 Lsize=   13581kB time=00:00:51.04 bitrate=2179.7kbits/s speed=6.99x  

$ffprobe -i out.mpg
Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p (oben zuerst), 720x576 [SAR 16: 11 DAR 20:11], 25 fps, 25 tbr, 90.000 tbn, 50 tbc

Aber wenn ich den gleichen Befehl mit dem libx264-Codec ausprobiert habe, sieht alles gut aus:

ffmpeg -y -i source.mpg -vcodec libx264 -flags +ildct+ilme -acodec copy -f mpegts libx264_out.mpg

Geben Sie hier die Bildbeschreibung ein

Und Konsolenausgabe:

[h264 @ 0x22ef6c0] SPS unavailable in decode_picture_timing
[h264 @ 0x22ef6c0] non-existing PPS 0 referenced
[h264 @ 0x22ef6c0] SPS unavailable in decode_picture_timing
[h264 @ 0x22ef6c0] non-existing PPS 0 referenced
[h264 @ 0x22ef6c0] decode_slice_header error
[h264 @ 0x22ef6c0] no frame!
[h264 @ 0x22ef6c0] SPS unavailable in decode_picture_timing
[h264 @ 0x22ef6c0] non-existing PPS 0 referenced
[h264 @ 0x22ef6c0] SPS unavailable in decode_picture_timing
[h264 @ 0x22ef6c0] non-existing PPS 0 referenced
[h264 @ 0x22ef6c0] decode_slice_header error
[h264 @ 0x22ef6c0] no frame!
[h264 @ 0x22ef6c0] SPS unavailable in decode_picture_timing
[h264 @ 0x22ef6c0] non-existing PPS 0 referenced
[h264 @ 0x22ef6c0] SPS unavailable in decode_picture_timing
[h264 @ 0x22ef6c0] non-existing PPS 0 referenced
[h264 @ 0x22ef6c0] decode_slice_header error
[h264 @ 0x22ef6c0] no frame!
[h264 @ 0x22ef6c0] SPS unavailable in decode_picture_timing
[h264 @ 0x22ef6c0] non-existing PPS 0 referenced
[h264 @ 0x22ef6c0] SPS unavailable in decode_picture_timing
[h264 @ 0x22ef6c0] non-existing PPS 0 referenced
[h264 @ 0x22ef6c0] decode_slice_header error
[h264 @ 0x22ef6c0] no frame!
[h264 @ 0x22ef6c0] mmco: unref short failure
    Last message repeated 1 times
[mpegts @ 0x22eacc0] PES packet size mismatch
Input #0, mpegts, from 'source.mpg':
  Duration: 01:00:00.95, start: 44661.794367, bitrate: 3336 kb/s
  Program 2101 
    Metadata:
      service_name    : ?������ �����
      service_provider: TricolorTV
    Stream #0:0[0x335]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg, top first), 720x576 [SAR 16:11 DAR 20:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x336](rus): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #0:2[0x337](rus): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
[libx264 @ 0x2332720] interlace + weightp is not implemented
[libx264 @ 0x2332720] using SAR=16/11
[libx264 @ 0x2332720] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x2332720] profile High, level 3.0
Output #0, mpegts, to 'libx264_out.mpg':
  Metadata:
    encoder         : Lavf57.56.100
    Stream #0:0: Video: h264 (libx264), yuv420p, 720x576 [SAR 16:11 DAR 20:11], q=-1--1, 25 fps, 90k tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.64.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1(rus): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, 192 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[h264 @ 0x2327140] reference picture missing during reorder
[h264 @ 0x2327140] Missing reference picture, default is 2147483647
[h264 @ 0x23757e0] mmco: unref short failure
    Last message repeated 1 times
[h264 @ 0x23757e0] number of reference frames (0+5) exceeds max (4; probably corrupt input), discarding one
[h264 @ 0x2415500] reference picture missing during reorder
[h264 @ 0x2415500] Missing reference picture, default is 65736
[h264 @ 0x2430f60] mmco: unref short failure
[h264 @ 0x2468520] mmco: unref short failure
[h264 @ 0x23757e0] mmco: unref short failure
[mpegts @ 0x22eacc0] PES packet size mismatchme=00:59:59.40 bitrate=1368.5kbits/s speed=4.97x    
[h264 @ 0x2483fe0] error while decoding MB 16 8, bytestream -6
frame=89975 fps=124 q=-1.0 Lsize=  601846kB time=01:00:00.68 bitrate=1369.3kbits/s speed=4.97x    

$ffprobe -i libx264_out.mpg
Stream #0:0[0x100]: Video: h264 (Hoch) ([27][0][0][0] / 0x001B), yuv420p (oben zuerst), 720x576 [SAR 16: 11 DAR 20:11], 25 fps, 25 tbr, 90.000 tbn, 50 tbc

Wie kann ich die H264-Datei in H264 korrigieren und das Interlacing über den h264_nvenc-Codec beibehalten?

Die Ausgabe wird als interlaced und mit der gleichen Reihenfolge wie die Quelle gekennzeichnet. Die Ausgabe-Screencap sieht aus wie die Nichtübereinstimmung der Feldpaare in Ihrem Player oder ffmpeg hat Frames während der Codierung verloren. Was sagt die Konsolenausgabe?
@Mulvya danke für die Hilfe! Ich habe die Frage zum Problem im nvenc-Encoder aktualisiert. Bitte überprüfen Sie dieses Problem. Haben Sie Ideen?
@Mulvya Wie ich aus Ihrem Beitrag im ffmpeg-Forum ffmpeg.gusari.org/viewtopic.php?f=11&t=3078 verstehe , wird ffmpeg keine Interlaced-Codierung über nvenc unterstützt. Ist dies im Moment für ffmpeg 3.2 und nvenc sdk 7 korrekt?

Antworten (1)

Es ist ein Problem mit neuen Grafiktreibern. Mit Videotreiber 361.28 und niedriger ist alles in Ordnung. Ich habe dieses Problem bereits mit der Referenznummer 161118-000164 an den NVIDIA-Support gesendet.

UPDATE: Dieses Problem wurde vom 375.39- Treiber behoben.
Es ermöglicht Keep Interlacing auf Pascal 10x Grafikkarten.