user14107: 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:

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: 

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


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?

user14107: 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.

14107: <p>I have the following interlaced H264 file:<br></p>

<blockquote>
  <p>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</p>
</blockquote>

<p>And this is a frame from the source video:
<a href="https://i.stack.imgur.com/I6fBO.png" rel="noreferrer"><img src="https://i.stack.imgur.com/I6fBO.png" alt="enter image description here"></a></p>

<p>When I use:</p>

<blockquote>
  <p>ffprobe -show_frames -i source.mpg | grep interlaced_frame</p>
</blockquote>

<p>All frames are interlaced:<br>
interlaced_frame=1<br>
interlaced_frame=1<br>
         .<br>
         .<br>
         .<br>
interlaced_frame=1<br></p>

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

<blockquote>
  <p>ffmpeg -i source.mpg -vcodec h264_nvenc -flags +ildct+ilme -acodec copy -f mpegts out.mpg</p>
</blockquote>

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

<p><a href="https://i.stack.imgur.com/q8Qbz.png" rel="noreferrer"><img src="https://i.stack.imgur.com/q8Qbz.png" alt="enter image description here"></a></p>

<p>This is a console output:<br></p>

<pre><code>[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 -&gt; #0:0 (h264 (native) -&gt; h264 (h264_nvenc))
  Stream #0:1 -&gt; #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  
</code></pre>

<blockquote>
  <p>$ffprobe -i out.mpg<br>
  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</p>
</blockquote>

<p><strong>But when I tried the same command with libx264 codec everythin looks fine:</strong></p>

<blockquote>
  <p>ffmpeg -y -i source.mpg -vcodec libx264 -flags +ildct+ilme -acodec copy -f mpegts libx264_out.mpg</p>
</blockquote>

<p><a href="https://i.stack.imgur.com/zsM4X.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zsM4X.png" alt="enter image description here"></a></p>

<p>And console output:</p>

<pre><code>[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 -&gt; #0:0 (h264 (native) -&gt; h264 (libx264))
  Stream #0:1 -&gt; #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    
</code></pre>

<blockquote>
  <p>$ffprobe -i libx264_out.mpg<br>
  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</p>
</blockquote>

<p><strong>How to correct transcode H264 file to H264 and keep interlacing via h264_nvenc codec?</strong></p>
 14107: <p>It's an issue with new video drivers. Everything is fine with video driver <a href="http://www.nvidia.com/Download/driverResults.aspx/98373/en-us" rel="nofollow noreferrer">361.28</a> and lower.
I already sent this issue to NVIDIA Support with Reference Number 161118-000164 <br><br>
UPDATE: This issue has been resolved from the <a href="http://www.nvidia.com/Download/driverResults.aspx/114708/en-us" rel="nofollow noreferrer">375.39</a> driver.<br> It allows keep interlacing on Pascal 10x video cards.</p>
