Switch to software decoding after packet loss

macOS specific usage questions
md
Blank Cone
Blank Cone
Posts: 66
Joined: 28 Jun 2005 11:03

Switch to software decoding after packet loss

Postby md » 07 Jan 2022 11:40

With the latest 3.0.16 release, VLC plays 4K HEVC content on iMAC using hardware decoding on the GPU with CPU usage around 17%.

main debug: selecting program id=2
main debug: looking for packetizer module matching "any": 25 candidates
main debug: using packetizer module "hevc"
main debug: looking for video decoder module matching "any": 16 candidates
videotoolbox info: Using Video Toolbox to decode 'hevc'
main debug: using video decoder module "videotoolbox"


However, after a small packet loss in the incoming RTP/UDP stream, hardware decoder exits with an error and VLC does not attempt to restart it - instead it switches to software decoding, with CPU usage around 221 %.

rtp warning: 2 packet(s) lost
ts warning: discontinuity received 0x3 instead of 0x5 (pid=101)
videotoolbox warning: vt session error: 'kVTVideoDecoderBadDataErr'
videotoolbox error: decoder failure, Abort.
main warning: Reloading the decoder module
main debug: removing module "videotoolbox"
main debug: looking for video decoder module matching "any": 16 candidates
avcodec debug: using ffmpeg Lavc58.6.103
avcodec debug: CPU flags: 0x000fd3db
avcodec debug: allowing 7 thread(s) for decoding
avcodec debug: codec (hevc) started
avcodec debug: using frame thread mode with 7 threads
main debug: using video decoder module "avcodec"

Packet loss is unavoidable when streams are delivered over RTP/UDP, so VLC needs to be prepared to handle such events without falling back to software decoding.

md
Blank Cone
Blank Cone
Posts: 66
Joined: 28 Jun 2005 11:03

Re: Switch to software decoding after packet loss

Postby md » 07 Jan 2022 17:30

The described problem was created by this commit:

https://code.videolan.org/videolan/vlc/ ... a844bc5c38

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: Switch to software decoding after packet loss

Postby fkuehne » 07 Jan 2022 18:06

Can you dump the stream and provide it as a sample file for offline debugging?
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

md
Blank Cone
Blank Cone
Posts: 66
Joined: 28 Jun 2005 11:03

Re: Switch to software decoding after packet loss

Postby md » 08 Jan 2022 08:45

Sure, I've uploaded file hevc3.ts to streams.videolan.org


Return to “VLC media player for macOS Troubleshooting”

Who is online

Users browsing this forum: No registered users and 7 guests

cron