-
Notifications
You must be signed in to change notification settings - Fork 24
When using --avhw while transcoding some source, random fragments can be lost. #101
Description
If issue requires to be passed to developers of particular component, tell me, please.
Issue description:
I have series of videos (films to be more specific) which i wanted to transcode to reduce size before remuxing package further (additing or forcing subtitles, and tweaking audio tracks).
Videos are encoded in AVC in .mkv container, nothing special or unique.
By default VCEEnc reasonably in my eyes uses --avhw. But something weird is happening with these particular videos.
When i do transcoding (i tried AVC, HEVC and preanalysis on and off), in at least 2 videos whole fragments are skipped. By "skipped" i mean literally black screen and no sound. Sound can stop later than black screen starts and start earlier than it ends. Fast forwarding to "skipped" fragment is also impossible it will default to some time at middle of skipped fragment. VCEEnc literally doesn't code these frames at all.
Such thing does not happen if i force --avsw instead.
Sources and transcoded samples:
Sadly these files ARE big enough (16GB for source and 8GB for transcoded ones), so i cut a fragment.
Source [it is there but for... potentially legal reasons i won't share it publicly]: -----
Source fragment that is being corrupted [Main difference is that in corrupted frament there is sound which lasts for full 23 minutes of encoded fragment, while actual video is only 2 seconds. In source transcoding, sound also goes blank]:
https://drive.google.com/file/d/17SqY4eXRZ8-QrJQR50ABo8z2lwdxfY02/view?usp=sharing
Corrupted video - fragment (--avhw) [In transcoded file from source broken fragment starts at 1:04:34, no sound and video. Sound appears at 1:27:43, while video appears at 1:30:22]:
https://drive.google.com/file/d/1vrd68dxFwPHXvvmCoXo2nxHgfJS-IBsc/view?usp=sharing
Logs and MediaInfo:
MediaInfo - Source [i will only link relevant tracks]:
General
Unique ID : 248221216510330680836342581051138536386 (0xBABDAAD8D2890A039315605C597473C2)
Complete name : C:\Users\DimkaTsv\Videos\Processing\Star.Wars.Episode.II.Attack.Of.The.Clones.2002.HDTV.1080p.mkv
Format : Matroska
Format version : Version 2
File size : 19.5 GiB
Duration : 2 h 22 min
Overall bit rate mode : Variable
Overall bit rate : 19.6 Mb/s
Frame rate : 23.976 FPS
Encoded date : 2010-06-02 14:33:07 UTC
Writing application : mkvmerge v3.3.0 ('Language') built on Mar 24 2010 14:59:24
Writing library : libebml v0.8.0 + libmatroska v0.9.0
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L4
Format settings : CABAC / 2 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference fra : 2 frames
Muxing mode : Container profile=
Codec ID : V_MPEG4/ISO/AVC
Duration : 2 h 22 min
Bit rate mode : Variable
Bit rate : 16.3 Mb/s
Maximum bit rate : 40.0 Mb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.327
Stream size : 16.2 GiB (83%)
Title : Star.Wars.Episode.II.Attack.Of.The.Clones.2002.HDTV.1080p
Language : English
Default : No
Forced : No
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Audio #1
ID : 2
Format : AC-3
Format/Info : Audio Coding 3
Commercial name : Dolby Digital
Codec ID : A_AC3
Duration : 2 h 22 min
Bit rate mode : Constant
Bit rate : 448 kb/s
Channel(s) : 6 channels
Channel layout : L R C LFE Ls Rs
Sampling rate : 48.0 kHz
Frame rate : 31.250 FPS (1536 SPF)
Compression mode : Lossy
Stream size : 457 MiB (2%)
Title : Dubbed
Language : Russian
Service kind : Complete Main
Default : Yes
Forced : No
VCEEnc - corrupted fragment log
C:\Users\-----\Videos\Processing>C:\Users\DimkaTsv\Desktop\Utilites\VCE_Encoder\VCEEncC_x64\\VCEEncC64.exe -i C:\Users\-----\Videos\Processing\[source]Star.Wars.Episode.II.Attack.Of.The.Clones.2002.HDTV.1080p_fragmented.mkv -o "[source]Star.Wars.Episode.II.Attack.Of.The.Clones.2002.HDTV.1080p_fragmented_processed.mkv" --codec avc --profile main --level 5.1 --preset balanced --ref 4 --ltr 3 --vbr 7500 --max-bitrate 15000 --qp-max 36 --audio-copy --chapter-copy --log vceencc_log.txt --log-level info
-----------------------------------------------------------------------------------------------
[source]Star.Wars.Episode.II.Attack.Of.The.Clones.2002.HDTV.1080p_fragmented_processed.mkv
-----------------------------------------------------------------------------------------------
VCEEnc (x64) 8.21 (r1577) by rigaya, Dec 10 2023 04:01:37 (VC 1937/Win)
OS: Windows 11 x64 (22631) [UTF-8]
CPU: AMD Ryzen 7 5800X3D 8-Core Processor [4.48GHz] (8C/16T)
GPU: AMD Radeon RX 7800 XT [31.0.24002.92]
AMF: Runtime 1.4.33 / SDK 1.4.30
Input Info: avvce: H.264/AVC, 1920x1080, 24000/1001 fps
Output: H.264/AVC Main @ Level 5.1
1920x1080p 1:1 23.976fps (24000/1001fps)
avwriter: h264, ac3 => matroska
Quality: balanced
VBR: 7500 kbps
Max bitrate: 15000 kbps
QP: Min: 0:0, Max: 36:36
VBV Bufsize: 7500 kb
Bframes: 0 frames
Pre Analysis: off
Ref frames: 4 frames
LTR frames: 3 frames
Motion Est: Q-pel
Slices: 1
GOP Len: 240 frames
Others: skipframe:on deblock
encoded 50 frames, 1.58 fps, 8003.44 kbps, 1.99 MB
encode time 0:00:31, CPU: 0.2%, VE: 91.0%
frame type IDR 1
frame type I 1, avgQP 24.00, total size 0.11 MB
frame type P 49, avgQP 20.92, total size 1.88 MB
I won't give you debug log, as it was more than 1GB of text.
But default log also presented some info.
VCEEnc log - avhw = corrupted result
C:\Users\-----\Videos\Processing>C:\Users\DimkaTsv\Desktop\Utilites\VCE_Encoder\VCEEncC_x64\\VCEEncC64.exe -i C:\Users\-----\Videos\Processing\Star.Wars.Episode.II.Attack.Of.The.Clones.2002.HDTV.1080p.mkv -o "Star.Wars.Episode.II.Attack.Of.The.Clones.2002.HDTV.1080p_processed.mkv" --codec avc --profile main --level 5.1 --preset balanced --ref 4 --ltr 3 --vbr 7500 --max-bitrate 15000 --qp-max 36 --audio-copy --chapter-copy --log vceencc_log.txt --log-level info
--------------------------------------------------------------------------------
Star.Wars.Episode.II.Attack.Of.The.Clones.2002.HDTV.1080p_processed.mkv
--------------------------------------------------------------------------------
VCEEnc (x64) 8.21 (r1577) by rigaya, Dec 10 2023 04:01:37 (VC 1937/Win)
OS: Windows 11 x64 (22631) [UTF-8]
CPU: AMD Ryzen 7 5800X3D 8-Core Processor [4.48GHz] (8C/16T)
GPU: AMD Radeon RX 7800 XT [31.0.24002.92]
AMF: Runtime 1.4.33 / SDK 1.4.30
Input Info: avvce: H.264/AVC, 1920x1080, 24000/1001 fps
Output: H.264/AVC Main @ Level 5.1
1920x1080p 1:1 23.976fps (24000/1001fps)
avwriter: h264, ac3, ac3, ac3, ac3, ac3, ac3, ac3 => matroska
Quality: balanced
VBR: 7500 kbps
Max bitrate: 15000 kbps
QP: Min: 0:0, Max: 36:36
VBV Bufsize: 7500 kb
Bframes: 0 frames
Pre Analysis: off
Ref frames: 4 frames
LTR frames: 3 frames
Motion Est: Q-pel
Slices: 1
GOP Len: 240 frames
Others: skipframe:on deblock
encoded 167657 frames, 415.03 fps, 7379.79 kbps, 6151.75 MB
encode time 0:06:43, CPU: 1.4%, GPU: 3.3%, VE: 100.0%
frame type IDR 699
frame type I 699, avgQP 19.58, total size 70.77 MB
frame type P 166958, avgQP 20.62, total size 6080.98 MB
--------------------------------------------------------------------------------
Star.Wars.Episode.II.Attack.Of.The.Clones.2002.HDTV.1080p_processed.mkv
--------------------------------------------------------------------------------
Input #0, matroska,webm, from 'C:\Users\-----\Videos\Processing\Star.Wars.Episode.II.Attack.Of.The.Clones.2002.HDTV.1080p.mkv':
Metadata:
encoder : libebml v0.8.0 + libmatroska v0.9.0
creation_time : 2010-06-02T14:33:07.000000Z
Duration: 02:22:29.09, start: 0.000000, bitrate: 19550 kb/s
Stream #0:0(eng): Video: h264 (Main), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn
Metadata:
title : Star.Wars.Episode.II.Attack.Of.The.Clones.2002.HDTV.1080p
Stream #0:1(rus): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s (default)
Metadata:
title : Dubbed
Stream #0:2(rus): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Metadata:
title : Tycoon
Stream #0:3(rus): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Metadata:
title : Zhivov
Stream #0:4(rus): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Metadata:
title : Gavrilov
Stream #0:5(rus): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Metadata:
title : Glanz
Stream #0:6(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Metadata:
title : English
Stream #0:7(eng): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Metadata:
title : Comments
Stream #0:8(rus): Subtitle: subrip (default)
Metadata:
title : forced subtitles
Stream #0:9(rus): Subtitle: subrip
Metadata:
title : Full
VCEEnc (x64) 8.21 (r1577) by rigaya, Dec 10 2023 04:01:37 (VC 1937/Win)
OS: Windows 11 x64 (22631) [UTF-8]
CPU: AMD Ryzen 7 5800X3D 8-Core Processor [4.48GHz] (8C/16T)
GPU: AMD Radeon RX 7800 XT [31.0.24002.92]
AMF: Runtime 1.4.33 / SDK 1.4.30
Input Info: avvce: H.264/AVC, 1920x1080, 24000/1001 fps
Output: H.264/AVC Main @ Level 5.1
1920x1080p 1:1 23.976fps (24000/1001fps)
avwriter: h264, ac3, ac3, ac3, ac3, ac3, ac3, ac3 => matroska
Quality: balanced
VBR: 7500 kbps
Max bitrate: 15000 kbps
QP: Min: 0:0, Max: 36:36
VBV Bufsize: 7500 kb
Bframes: 0 frames
Pre Analysis: off
Ref frames: 4 frames
LTR frames: 3 frames
Motion Est: Q-pel
Slices: 1
GOP Len: 240 frames
Others: skipframe:on deblock
Output #0, matroska, to 'Star.Wars.Episode.II.Attack.Of.The.Clones.2002.HDTV.1080p_processed.mkv':
Metadata:
encoding_tool : VCEEnc (x64) 8.21
encoder : Lavf60.16.100
Stream #0:0(eng): Video: h264 (Main) (H264 / 0x34363248), nv12(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 23.98 fps, 1k tbn
Stream #0:1(rus): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), fltp, 448 kb/s (default)
Metadata:
title : Dubbed
Stream #0:2(rus): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), fltp, 448 kb/s
Metadata:
title : Tycoon
Stream #0:3(rus): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), fltp, 448 kb/s
Metadata:
title : Zhivov
Stream #0:4(rus): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), fltp, 448 kb/s
Metadata:
title : Gavrilov
Stream #0:5(rus): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), fltp, 448 kb/s
Metadata:
title : Glanz
Stream #0:6(eng): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), fltp, 448 kb/s
Metadata:
title : English
Stream #0:7(eng): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 192 kb/s
Metadata:
title : Comments
[matroska @ 000002031b3daa00] Starting new cluster due to timestamp
[matroska @ 000002031b3daa00] Starting new cluster due to timestamp
[matroska @ 000002031b3daa00] Starting new cluster due to timestamp
[matroska @ 000002031b3daa00] Starting new cluster due to timestamp
...
... (a LOT!!! of those)
...
[matroska @ 000002031b3daa00] Starting new cluster due to timestamp
[matroska @ 000002031b3daa00] Starting new cluster due to timestamp
encoded 167657 frames, 415.03 fps, 7379.79 kbps, 6151.75 MB
encode time 0:06:43, CPU: 1.4%, GPU: 3.3%, VE: 100.0%
frame type IDR 699
frame type I 699, avgQP 19.58, total size 70.77 MB
frame type P 166958, avgQP 20.62, total size 6080.98 MB
VCEEnc log - avsw = correctly transcoded file:
C:\Users\-----\Videos\Processing>C:\Users\DimkaTsv\Desktop\Utilites\VCE_Encoder\VCEEncC_x64\\VCEEncC64.exe -i C:\Users\-----\Videos\Processing\Star.Wars.Episode.II.Attack.Of.The.Clones.2002.HDTV.1080p.mkv -o "Star.Wars.Episode.II.Attack.Of.The.Clones.2002.HDTV.1080p_processed.mkv" --avsw --codec avc --profile main --level 5.1 --preset balanced --ref 4 --ltr 3 --vbr 7500 --max-bitrate 15000 --qp-max 36 --audio-copy --chapter-copy --log vceencc_log.txt --log-level info
--------------------------------------------------------------------------------
Star.Wars.Episode.II.Attack.Of.The.Clones.2002.HDTV.1080p_processed.mkv
--------------------------------------------------------------------------------
VCEEnc (x64) 8.21 (r1577) by rigaya, Dec 10 2023 04:01:37 (VC 1937/Win)
OS: Windows 11 x64 (22631) [UTF-8]
CPU: AMD Ryzen 7 5800X3D 8-Core Processor [4.48GHz] (8C/16T)
GPU: AMD Radeon RX 7800 XT [31.0.24002.92]
AMF: Runtime 1.4.33 / SDK 1.4.30
Input Info: avsw: h264(yv12)->nv12 [AVX2], 1920x1080, 24000/1001 fps
Output: H.264/AVC Main @ Level 5.1
1920x1080p 1:1 23.976fps (24000/1001fps)
avwriter: h264, ac3, ac3, ac3, ac3, ac3, ac3, ac3 => matroska
Quality: balanced
VBR: 7500 kbps
Max bitrate: 15000 kbps
QP: Min: 0:0, Max: 36:36
VBV Bufsize: 7500 kb
Bframes: 0 frames
Pre Analysis: off
Ref frames: 4 frames
LTR frames: 3 frames
Motion Est: Q-pel
Slices: 1
GOP Len: 240 frames
Others: skipframe:on deblock
encoded 204759 frames, 481.31 fps, 7400.85 kbps, 7534.55 MB
encode time 0:07:05, CPU: 2.2%, GPU: 4.6%, VE: 66.2%
frame type IDR 854
frame type I 854, avgQP 19.47, total size 87.82 MB
frame type P 203905, avgQP 20.54, total size 7446.73 MB
--------------------------------------------------------------------------------
Star.Wars.Episode.II.Attack.Of.The.Clones.2002.HDTV.1080p_processed.mkv
--------------------------------------------------------------------------------
Input #0, matroska,webm, from 'C:\Users\-----\Videos\Processing\Star.Wars.Episode.II.Attack.Of.The.Clones.2002.HDTV.1080p.mkv':
Metadata:
encoder : libebml v0.8.0 + libmatroska v0.9.0
creation_time : 2010-06-02T14:33:07.000000Z
Duration: 02:22:29.09, start: 0.000000, bitrate: 19550 kb/s
Stream #0:0(eng): Video: h264 (Main), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn
Metadata:
title : Star.Wars.Episode.II.Attack.Of.The.Clones.2002.HDTV.1080p
Stream #0:1(rus): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s (default)
Metadata:
title : Dubbed
Stream #0:2(rus): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Metadata:
title : Tycoon
Stream #0:3(rus): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Metadata:
title : Zhivov
Stream #0:4(rus): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Metadata:
title : Gavrilov
Stream #0:5(rus): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Metadata:
title : Glanz
Stream #0:6(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Metadata:
title : English
Stream #0:7(eng): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Metadata:
title : Comments
Stream #0:8(rus): Subtitle: subrip (default)
Metadata:
title : forced subtitles
Stream #0:9(rus): Subtitle: subrip
Metadata:
title : Full
VCEEnc (x64) 8.21 (r1577) by rigaya, Dec 10 2023 04:01:37 (VC 1937/Win)
OS: Windows 11 x64 (22631) [UTF-8]
CPU: AMD Ryzen 7 5800X3D 8-Core Processor [4.48GHz] (8C/16T)
GPU: AMD Radeon RX 7800 XT [31.0.24002.92]
AMF: Runtime 1.4.33 / SDK 1.4.30
Input Info: avsw: h264(yv12)->nv12 [AVX2], 1920x1080, 24000/1001 fps
Output: H.264/AVC Main @ Level 5.1
1920x1080p 1:1 23.976fps (24000/1001fps)
avwriter: h264, ac3, ac3, ac3, ac3, ac3, ac3, ac3 => matroska
Quality: balanced
VBR: 7500 kbps
Max bitrate: 15000 kbps
QP: Min: 0:0, Max: 36:36
VBV Bufsize: 7500 kb
Bframes: 0 frames
Pre Analysis: off
Ref frames: 4 frames
LTR frames: 3 frames
Motion Est: Q-pel
Slices: 1
GOP Len: 240 frames
Others: skipframe:on deblock
[h264 @ 000002a9c481a440] Late SEI is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[h264 @ 000002a9c481a440] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
[h264 @ 000002a9c5a54c00] Late SEI is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[h264 @ 000002a9c5a54c00] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
[h264 @ 000002a9c5ceb7c0] Late SEI is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[h264 @ 000002a9c5ceb7c0] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
[h264 @ 000002a9c5da6900] Late SEI is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[h264 @ 000002a9c5da6900] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
[h264 @ 000002a9c5e61a00] Late SEI is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
...
... (a LOT of those, and yes, closer to end of transcoding text became not as pretty and properly aligned)
...
[h264 @ 000002a9c5f2fb80] Late SEI is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[h264 @ 000002a9c5f2fb80] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
[h264 @ 000002a9c5f2cb80] Late SEI is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[h264 @ 000002a9c481a440] Late SEIIf you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
[h264 @ 000002a9c481a440] is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[h264 @ 000002a9c481a440] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
encoded 204759 frames, 481.31 fps, 7400.85 kbps, 7534.55 MB
encode time 0:07:05, CPU: 2.2%, GPU: 4.6%, VE: 66.2%
frame type IDR 854
frame type I 854, avgQP 19.47, total size 87.82 MB
frame type P 203905, avgQP 20.54, total size 7446.73 MB
==============
As you can notice, in corrupted video with avhw VCEEnc was only able to encode 167657 frames (166958 Q-frames and 699 I-frames), while for correctly encoded video with avsw it was able to encode 204759 frames (203905 Q-frames and 854 I-frames respectively). Also corrupted video stream takes 6157.75 MB, while correct one takes 7534.55 MB