5

I have the following interlaced H264 file:

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

And this is a frame from the source video: enter image description here

When I use:

ffprobe -show_frames -i source.mpg | grep interlaced_frame

All frames are interlaced:
interlaced_frame=1
interlaced_frame=1
.
.
.
interlaced_frame=1

I whant to transcode this file and keep interlacing and try to do it with the following command:

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

after transcode the same frame from the "out.mpg" file is looks like follow:

enter image description here

This is a console output:

[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(top first), 720x576 [SAR 16:11 DAR 20:11], 25 fps, 25 tbr, 90k tbn, 50 tbc

But when I tried the same command with libx264 codec everythin looks fine:

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

enter image description here

And console output:

[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 (High) ([27][0][0][0] / 0x001B), yuv420p(top first), 720x576 [SAR 16:11 DAR 20:11], 25 fps, 25 tbr, 90k tbn, 50 tbc

How to correct transcode H264 file to H264 and keep interlacing via h264_nvenc codec?

3
  • 1
    The output is flagged as interlaced and with the same order as source. The output screencap looks like the field pair mismatch in your player, or ffmpeg dropped frames during encode. What does the console output say?
    – Gyan
    Nov 10, 2016 at 14:44
  • @Mulvya thank you for the help! I updated the question the problem in nvenc encoder. Please check this issue. Have you any ideas? Nov 11, 2016 at 8:59
  • @Mulvya As I understand from your post on ffmpeg forum ffmpeg.gusari.org/viewtopic.php?f=11&t=3078 ffmpeg is not supported interlaced encoding via nvenc. Is this correct at the moment for ffmpeg 3.2 and nvenc sdk 7 ? Nov 11, 2016 at 12:53

1 Answer 1

6

It's an issue with new video drivers. Everything is fine with video driver 361.28 and lower. I already sent this issue to NVIDIA Support with Reference Number 161118-000164

UPDATE: This issue has been resolved from the 375.39 driver.
It allows keep interlacing on Pascal 10x video cards.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.