Choppy video and avcodec-hw

This forum is about all development around libVLC.
Gianpaolo64
New Cone
New Cone
Posts: 1
Joined: 10 Jun 2015 10:26

Choppy video and avcodec-hw

Postby Gianpaolo64 » 10 Jun 2015 10:55

I am developing a small windows program that plays video using libVLC, I have a weird issue, 4k video are choppy when played by my program but they plays well from vlc.
I enabled logging and noticed that when video is played by my program there are the following lines:

avcodec debug: allowing 4 thread(s) for decoding
avcodec warning: threaded frame decoding is not compatible with DXVA2, disabled
avcodec debug: avcodec codec (H264 - MPEG-4 AVC (part 10)) started
avcodec debug: using slice thread mode with 4 threads

but when played by VLC:

avcodec debug: allowing 4 thread(s) for decoding
avcodec debug: avcodec codec (H264 - MPEG-4 AVC (part 10)) started
avcodec debug: using frame thread mode with 4 threads

By looking at the vlc source code I see that the value of "avcodec-hw" option disables threaded frame decoding and I guess this causes the choppy video, if I run: "vlc --avcodec-hw myvideo.mp4" I get the same log output and the same choppy video.
So I tried to set "avcodec-hw=none" for libVlc from my program but it seems there is no way, I tried the following:
1) I added the option --avcodec-hw=none to libvlc_new() call.
2) Uncommented avcodec-hw=none in the default config file
3) Specified my own config file with --config and the files contains avcodec-hw=none

It seems that option is not seen by libVlc, I also tried to set the option avcodec-threads just to see whether my method of setting options was wrong but in this case from the log I see the number of thread reflects exactly the number I set with avcodec-threads with all three methods listed above.

I am using VLC v2.2.1 and libvlc_new is called with the following options:
--plugin-path
--no-one-instance
--no-stats
--no-media-library
--no-ignore-config

Is there a way to set avcodec-hw=none so that frame theading doesn't get disabled ?

Thanks,
Gianpaolo

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Choppy video and avcodec-hw

Postby Jean-Baptiste Kempf » 09 Jul 2015 21:33

DxVA is supposedly faster than normal threaded decoding.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 9 guests