Re: [FFmpeg-trac] #7080(undetermined:new): ffmpeg issue with NVENC and keyframes when encoding interlaced video

2021-03-02 Thread FFmpeg
#7080: ffmpeg issue with NVENC and keyframes when encoding interlaced video
-+-
 Reporter:  malakudi |Owner:
 Type:  defect   |   Status:  new
 Priority:  normal   |Component:
 |  undetermined
  Version:  unspecified  |   Resolution:
 Keywords:  nvenc|   Blocked By:
 Blocking:   |  Reproduced by developer:  0
Analyzed by developer:  0|
-+-

Comment (by Balling):

 Replying to [comment:11 oromit]:
 >I have some code somewhere that makes nvenc do the right thing,

 Do you still have it? We need it for interlaced hevc.

--
Ticket URL: 
FFmpeg 
FFmpeg issue tracker
___
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-trac

To unsubscribe, visit link above, or email
ffmpeg-trac-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-trac] #7080(undetermined:new): ffmpeg issue with NVENC and keyframes when encoding interlaced video

2018-03-23 Thread FFmpeg
#7080: ffmpeg issue with NVENC and keyframes when encoding interlaced video
-+-
 Reporter:  malakudi |Owner:
 Type:  defect   |   Status:  new
 Priority:  normal   |Component:
  Version:  unspecified  |  undetermined
 Keywords:  nvenc|   Resolution:
 Blocking:   |   Blocked By:
Analyzed by developer:  0|  Reproduced by developer:  0
-+-

Comment (by oromit):

 The most reliable "workaround" I found was writing the video to a raw
 .h264 file and then using that as input.

 I have some code somewhere that makes nvenc do the right thing, but when I
 tested it it made the whole rest of ffmpeg and libav* blow up.

 I'm thinking to put the whole interlaced encoding with nvenc behind
 -strict experimental for now.

--
Ticket URL: 
FFmpeg 
FFmpeg issue tracker
___
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-trac


Re: [FFmpeg-trac] #7080(undetermined:new): ffmpeg issue with NVENC and keyframes when encoding interlaced video

2018-03-23 Thread FFmpeg
#7080: ffmpeg issue with NVENC and keyframes when encoding interlaced video
-+-
 Reporter:  malakudi |Owner:
 Type:  defect   |   Status:  new
 Priority:  normal   |Component:
  Version:  unspecified  |  undetermined
 Keywords:  nvenc|   Resolution:
 Blocking:   |   Blocked By:
Analyzed by developer:  0|  Reproduced by developer:  0
-+-

Comment (by malakudi):

 With my little understanding of the ffmpeg code, I think that mpegts
 encoder does not suffer from the issue of nvenc interlaced encoding
 because it uses the flags from payload and not packet
 (ts_st->payload_flags).
 I couldn't understand why matroska encoder also doesn't suffer from the
 issue.

 I will try to modify hls encoder (hlsenc.c) to also use the flags from
 payload.

--
Ticket URL: 
FFmpeg 
FFmpeg issue tracker
___
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-trac


Re: [FFmpeg-trac] #7080(undetermined:new): ffmpeg issue with NVENC and keyframes when encoding interlaced video

2018-03-11 Thread FFmpeg
#7080: ffmpeg issue with NVENC and keyframes when encoding interlaced video
-+-
 Reporter:  malakudi |Owner:
 Type:  defect   |   Status:  new
 Priority:  normal   |Component:
  Version:  unspecified  |  undetermined
 Keywords:  nvenc|   Resolution:
 Blocking:   |   Blocked By:
Analyzed by developer:  0|  Reproduced by developer:  0
-+-

Comment (by malakudi):

 @oromit: I've seen you are the code maintainer of nvenc in ffmpeg so
 definitely you know better from anyone. Can the issue be fixed with a
 workaround? A code that checks the output from the nvidia encoder and
 "fix"  the keyframe issue by inspecting both fields? Or, if this is not
 possible, can we add a workaround to muxers affected? I have reproduced
 the problem in rtmp output and hls output.

--
Ticket URL: 
FFmpeg 
FFmpeg issue tracker
___
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-trac


Re: [FFmpeg-trac] #7080(undetermined:new): ffmpeg issue with NVENC and keyframes when encoding interlaced video

2018-03-11 Thread FFmpeg
#7080: ffmpeg issue with NVENC and keyframes when encoding interlaced video
-+-
 Reporter:  malakudi |Owner:
 Type:  defect   |   Status:  new
 Priority:  normal   |Component:
  Version:  unspecified  |  undetermined
 Keywords:  nvenc|   Resolution:
 Blocking:   |   Blocked By:
Analyzed by developer:  0|  Reproduced by developer:  0
-+-

Comment (by cehoyos):

 If the first field can be decided independently (ā€œIā€) I believe you should
 set the keyframe flag.

--
Ticket URL: 
FFmpeg 
FFmpeg issue tracker
___
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-trac


Re: [FFmpeg-trac] #7080(undetermined:new): ffmpeg issue with NVENC and keyframes when encoding interlaced video

2018-03-11 Thread FFmpeg
#7080: ffmpeg issue with NVENC and keyframes when encoding interlaced video
-+-
 Reporter:  malakudi |Owner:
 Type:  defect   |   Status:  new
 Priority:  normal   |Component:
  Version:  unspecified  |  undetermined
 Keywords:  nvenc|   Resolution:
 Blocking:   |   Blocked By:
Analyzed by developer:  0|  Reproduced by developer:  0
-+-

Comment (by oromit):

 Because the two fields have different parameters. Like, one of them can be
 a keyframe, but the other isn't, and whichever one comes first gets its
 parameter set on the packet, but the ones for the other field are lost.
 That includes its timestamp, and flags like being keyframe.

 If it works depends on how much the output format depends on the
 information in the packet. Some don't use it at all, others rely heavily
 on it.
 The two fields are combined in one packet, which is exactly the problem.
 If I split them, I end up with the rest of ffmpeg exploding because an
 encoder is not expected to return two packets for one input frame, even
 though the new API technically supports it.

--
Ticket URL: 
FFmpeg 
FFmpeg issue tracker
___
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-trac


Re: [FFmpeg-trac] #7080(undetermined:new): ffmpeg issue with NVENC and keyframes when encoding interlaced video

2018-03-11 Thread FFmpeg
#7080: ffmpeg issue with NVENC and keyframes when encoding interlaced video
-+-
 Reporter:  malakudi |Owner:
 Type:  defect   |   Status:  new
 Priority:  normal   |Component:
  Version:  unspecified  |  undetermined
 Keywords:  nvenc|   Resolution:
 Blocking:   |   Blocked By:
Analyzed by developer:  0|  Reproduced by developer:  0
-+-

Comment (by malakudi):

 @oromit: How the issue you mention affects the keyframes? And why output
 to file doesn't have this issue? Can you point to look somewhere in the
 code about this?

 Same issue used to occur on file output as well, as mentioned in ticket
 5440, but got fixed in the process.

--
Ticket URL: 
FFmpeg 
FFmpeg issue tracker
___
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-trac


Re: [FFmpeg-trac] #7080(undetermined:new): ffmpeg issue with NVENC and keyframes when encoding interlaced video

2018-03-11 Thread FFmpeg
#7080: ffmpeg issue with NVENC and keyframes when encoding interlaced video
-+-
 Reporter:  malakudi |Owner:
 Type:  defect   |   Status:  new
 Priority:  normal   |Component:
  Version:  unspecified  |  undetermined
 Keywords:  nvenc|   Resolution:
 Blocking:   |   Blocked By:
Analyzed by developer:  0|  Reproduced by developer:  0
-+-

Comment (by malakudi):

 Just tried with almost current git, nightly build for windows. Problem
 also there.
 {{{
 ffmpeg -f mpegts -i sample.ts -flags +ildct+ilme -vcodec h264_nvenc
 -preset slow -b:v 2200k -profile:v high -level 4.1 -c:a aac -ac 2 -b:a
 128k -f hls -hls_time 8 playlist.m3u8
 ffmpeg version N-90288-g2536bd8632 Copyright (c) 2000-2018 the FFmpeg
 developers
   built with gcc 7.3.0 (GCC)
   configuration: --disable-static --enable-shared --enable-gpl --enable-
 version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls
 --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype
 --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb
 --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy
 --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx
 --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265
 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp
 --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-
 libmysofa --enable-libspeex --enable-libxvid --enable-libmfx --enable-amf
 --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc
 --enable-nvdec --enable-dxva2 --enable-avisynth
   libavutil  56.  9.100 / 56.  9.100
   libavcodec 58. 14.100 / 58. 14.100
   libavformat58. 10.100 / 58. 10.100
   libavdevice58.  2.100 / 58.  2.100
   libavfilter 7. 12.100 /  7. 12.100
   libswscale  5.  0.102 /  5.  0.102
   libswresample   3.  0.101 /  3.  0.101
   libpostproc55.  0.100 / 55.  0.100
 Input #0, mpegts, from 'sample.ts':
   Duration: 00:01:02.56, start: 1.40, bitrate: 13795 kb/s
   Program 1
 Metadata:
   service_name: Service01
   service_provider: FFmpeg
 Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B),
 yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], Closed
 Captions, 25 fps, 25 tbr, 90k tbn, 50 tbc
 Stream #0:1[0x101](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000
 Hz, stereo, fltp, 384 kb/s
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_nvenc))
   Stream #0:1 -> #0:1 (ac3 (native) -> aac (native))
 Press [q] to stop, [?] for help
 [hls @ 01230d7f0500] Opening 'playlist0.ts' for writing
 Output #0, hls, to 'playlist.m3u8':
   Metadata:
 encoder : Lavf58.10.100
 Stream #0:0: Video: h264 (h264_nvenc) (High), yuv420p, 1920x1080 [SAR
 1:1 DAR 16:9], q=-1--1, 2200 kb/s, 25 fps, 90k tbn, 25 tbc
 Metadata:
   encoder : Lavc58.14.100 h264_nvenc
 Side data:
   cpb: bitrate max/min/avg: 0/0/220 buffer size: 440
 vbv_delay: -1
 Stream #0:1(eng): Audio: aac (LC), 48000 Hz, stereo, fltp, 128 kb/s
 Metadata:
   encoder : Lavc58.14.100 aac
 [hls @ 01230d7f0500] Opening 'playlist.m3u8.tmp' for writing dup=36
 drop=0 speed=8.65x
 frame= 1564 fps=216 q=36.0 Lsize=N/A time=00:01:02.56 bitrate=N/A dup=36
 drop=0 speed=8.65x
 video:16968kB audio:953kB subtitle:0kB other streams:0kB global
 headers:0kB muxing overhead: unknown
 [aac @ 01230b89e840] Qavg: 1101.940
 }}}

--
Ticket URL: 
FFmpeg 
FFmpeg issue tracker
___
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-trac


Re: [FFmpeg-trac] #7080(undetermined:new): ffmpeg issue with NVENC and keyframes when encoding interlaced video

2018-03-11 Thread FFmpeg
#7080: ffmpeg issue with NVENC and keyframes when encoding interlaced video
-+-
 Reporter:  malakudi |Owner:
 Type:  defect   |   Status:  new
 Priority:  normal   |Component:
  Version:  unspecified  |  undetermined
 Keywords:  nvenc|   Resolution:
 Blocking:   |   Blocked By:
Analyzed by developer:  0|  Reproduced by developer:  0
-+-

Comment (by cehoyos):

 The question is if the issue is reproducible with current FFmpeg.

--
Ticket URL: 
FFmpeg 
FFmpeg issue tracker
___
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-trac


Re: [FFmpeg-trac] #7080(undetermined:new): ffmpeg issue with NVENC and keyframes when encoding interlaced video

2018-03-11 Thread FFmpeg
#7080: ffmpeg issue with NVENC and keyframes when encoding interlaced video
-+-
 Reporter:  malakudi |Owner:
 Type:  defect   |   Status:  new
 Priority:  normal   |Component:
  Version:  unspecified  |  undetermined
 Keywords:  nvenc|   Resolution:
 Blocking:   |   Blocked By:
Analyzed by developer:  0|  Reproduced by developer:  0
-+-

Comment (by malakudi):

 Yes issue happens since forever. It used to affect file output also but it
 got fixed sometime between 2.5.4 and 3.1.x . I can try to find when file
 output was fixed if that would help.

--
Ticket URL: 
FFmpeg 
FFmpeg issue tracker
___
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-trac


Re: [FFmpeg-trac] #7080(undetermined:new): ffmpeg issue with NVENC and keyframes when encoding interlaced video

2018-03-11 Thread FFmpeg
#7080: ffmpeg issue with NVENC and keyframes when encoding interlaced video
-+-
 Reporter:  malakudi |Owner:
 Type:  defect   |   Status:  new
 Priority:  normal   |Component:
  Version:  unspecified  |  undetermined
 Keywords:  nvenc|   Resolution:
 Blocking:   |   Blocked By:
Analyzed by developer:  0|  Reproduced by developer:  0
-+-
Changes (by cehoyos):

 * keywords:  nvenc interlaced ildct keyframe => nvenc
 * version:  3.4 => unspecified


Comment:

 Please confirm that this issue is not specific to version 3.4.

 Why can't we just combine the field into one packet?

--
Ticket URL: 
FFmpeg 
FFmpeg issue tracker
___
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-trac


Re: [FFmpeg-trac] #7080(undetermined:new): ffmpeg issue with NVENC and keyframes when encoding interlaced video

2018-03-11 Thread FFmpeg
#7080: ffmpeg issue with NVENC and keyframes when encoding interlaced video
-+-
 Reporter:  malakudi |Owner:
 Type:  defect   |   Status:  new
 Priority:  normal   |Component:
  Version:  3.4  |  undetermined
 Keywords:  nvenc|   Resolution:
  interlaced ildct keyframe  |   Blocked By:
 Blocking:   |  Reproduced by developer:  0
Analyzed by developer:  0|
-+-

Comment (by oromit):

 nvenc does not support encoding interlaced fields as one interleaved
 frame.
 Instead, it emits two independent fields per frame. (no support for MBAFF)

 Due to each field needing its own timestamp, but being in the same packet
 with only one shared timestamp, FFmpeg does not properly support handling
 those coming out of an encoder, and how well it works is pretty much up to
 luck depending on the container and transport method in use.

 I looked into it a while ago, but concluded that fixing that would be a
 major non-trivial change to pretty much the entire FFmpeg codebase, which
 I'm not going to be able to make on my own. I'd even say it's unlikely
 that this will ever be fixed, unless nvidia implements mbaff support.

--
Ticket URL: 
FFmpeg 
FFmpeg issue tracker
___
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-trac


[FFmpeg-trac] #7080(undetermined:new): ffmpeg issue with NVENC and keyframes when encoding interlaced video

2018-03-11 Thread FFmpeg
#7080: ffmpeg issue with NVENC and keyframes when encoding interlaced video
-+-
 Reporter:  malakudi | Type:  defect
   Status:  new  | Priority:  normal
Component:   |  Version:  3.4
  undetermined   |   Blocked By:
 Keywords:  nvenc|  Reproduced by developer:  0
  interlaced ildct keyframe  |
 Blocking:   |
Analyzed by developer:  0|
-+-
 Summary of the bug: When encoding interlaced H264 video with NVENC codec,
 there is an issue with keyframes which affects hls output or flv rtmp
 output. It doesn't affect file output. Issue is similar to the one
 originally reported in ticket 5440.

 How to reproduce:
 {{{
 ffmpeg -f mpegts -i sample.ts -flags +ildct+ilme -vcodec h264_nvenc
 -preset slow -b:v 2200k -profile:v high -level 4.1 -c:a aac -ac 2 -b:a
 128k -f hls -hls_time 8 playlist.m3u8
 ffmpeg version 3.4.2 Copyright (c) 2000-2018 the FFmpeg developers
   built with gcc 6.3.0 (Debian 6.3.0-18) 20170516
   configuration: --disable-decoder=amrnb --disable-decoder=libopenjpeg
 --disable-mips32r2 --disable-mips32r6 --disable-mips64r6 --disable-mipsdsp
 --disable-mipsdspr2 --disable-mipsfpu --disable-msa --disable-libopencv
 --disable-podpages --disable-stripping --enable-avfilter --enable-
 avresample --enable-gcrypt --enable-gnutls --enable-gpl --enable-libass
 --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio
 --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-
 libfribidi --enable-libgme --enable-libgsm --enable-libilbc --enable-
 libkvazaar --enable-libmp3lame --enable-libopencore-amrnb --enable-
 libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-
 libopenmpt --enable-libopus --enable-libpulse --enable-librubberband
 --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex
 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-
 libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx265
 --enable-libxvid --enable-libzvbi --enable-nonfree --enable-opengl
 --enable-openssl --enable-postproc --enable-pthreads --enable-shared
 --enable-version3 --enable-libwebp --incdir=/usr/include/x86_64-linux-gnu
 --libdir=/usr/lib/x86_64-linux-gnu --prefix=/usr --toolchain=hardened
 --enable-frei0r --enable-chromaprint --enable-libx264 --enable-libiec61883
 --enable-libdc1394 --enable-vaapi --disable-opencl --enable-libmfx
 --disable-altivec --shlibdir=/usr/lib/x86_64-linux-gnu
   libavutil  55. 78.100 / 55. 78.100
   libavcodec 57.107.100 / 57.107.100
   libavformat57. 83.100 / 57. 83.100
   libavdevice57. 10.100 / 57. 10.100
   libavfilter 6.107.100 /  6.107.100
   libavresample   3.  7.  0 /  3.  7.  0
   libswscale  4.  8.100 /  4.  8.100
   libswresample   2.  9.100 /  2.  9.100
   libpostproc54.  7.100 / 54.  7.100
 Input #0, mpegts, from 'sample.ts':
   Duration: 00:01:02.56, start: 1.40, bitrate: 13795 kb/s
   Program 1
 Metadata:
   service_name: Service01
   service_provider: FFmpeg
 Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B),
 yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], Closed
 Captions, 25 fps, 25 tbr, 90k tbn, 50 tbc
 Stream #0:1[0x101](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000
 Hz, stereo, fltp, 384 kb/s
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_nvenc))
   Stream #0:1 -> #0:1 (ac3 (native) -> aac (native))
 Press [q] to stop, [?] for help
 [hls @ 0x5563975f08c0] Opening 'playlist0.ts' for writing
 Output #0, hls, to 'playlist.m3u8':
   Metadata:
 encoder : Lavf57.83.100
 Stream #0:0: Video: h264 (h264_nvenc) (High), yuv420p, 1920x1080 [SAR
 1:1 DAR 16:9], q=-1--1, 2200 kb/s, 25 fps, 90k tbn, 25 tbc
 Metadata:
   encoder : Lavc57.107.100 h264_nvenc
 Side data:
   cpb: bitrate max/min/avg: 0/0/220 buffer size: 440
 vbv_delay: -1
 Stream #0:1(eng): Audio: aac (LC), 48000 Hz, stereo, fltp, 128 kb/s
 Metadata:
   encoder : Lavc57.107.100 aac
 [hls @ 0x5563975f08c0] Opening 'playlist.m3u8.tmp' for writing/A dup=36
 drop=0 speed=3.07x
 frame= 1564 fps= 76 q=36.0 Lsize=N/A time=00:01:02.52 bitrate=N/A dup=36
 drop=0 speed=3.06x
 video:16977kB audio:945kB subtitle:0kB other streams:0kB global
 headers:0kB muxing overhead: unknown
 [aac @ 0x556397828420] Qavg: 1400.956
 }}}
 ffmpeg creates hls with only one segment although it should split to
 keyframe and create 7 segments. The single file created does not have
 keyframes as can be seen from command:
 {{{
 ffprobe -show_frames playlist0.ts 2> /dev/null | grep pict_type=I | wc -l
 0
 }}}

 If run same command without +ildct+ilme,