Force hardware decoding

VLC for Android and Chrome OS specific usage questions
gregoiregentil
Blank Cone
Blank Cone
Posts: 27
Joined: 30 Jan 2013 07:48

Force hardware decoding

Postby gregoiregentil » 02 Aug 2013 22:00

Hello,

I would like to force hardware decoding for an h264 stream.

Question #1: which hardware is currently supported for hardware decoding?

Question #2: I guess that the following log is software decoding. Correct? :-(

Code: Select all

D/VLC ( 9437): main input: Creating an input for 'rtsp://192.168.10.4:8554/stream' D/VLC ( 9437): main stream output: using sout chain=`stream_out_duplicate{dst=display,dst=std{access=file,mux=ts,dst=/sdcard/MeCam/20130802_122921/video.mpg}}' D/VLC ( 9437): main stream output: stream=`stream_out_duplicate' D/VLC ( 9437): main stream out: looking for sout stream module matching "stream_out_duplicate": 20 candidates D/audio_hw_primary( 180): adev_open_input_stream: enter D/audio_hw_primary( 180): adev_open_input_stream: exit D/VLC ( 9437): stream_out_duplicate stream out: creating 'duplicate' D/VLC ( 9437): stream_out_duplicate stream out: * adding `display' D/VLC ( 9437): main stream output: stream=`display' D/VLC ( 9437): main stream out: looking for sout stream module matching "display": 20 candidates D/VLC ( 9437): main stream out: using sout stream module "stream_out_display" D/VLC ( 9437): stream_out_duplicate stream out: * adding `std{access=file,mux=ts,dst=/sdcard/MeCam/20130802_122921/video.mpg}' D/VLC ( 9437): main stream output: stream=`std' D/VLC ( 9437): main stream out: looking for sout stream module matching "std": 20 candidates D/VLC ( 9437): main stream out: set config option: sout-standard-access to file D/VLC ( 9437): main stream out: set config option: sout-standard-mux to ts D/VLC ( 9437): main stream out: set config option: sout-standard-dst to /sdcard/MeCam/20130802_122921/video.mpg D/VLC ( 9437): main access out: looking for sout access module matching "file": 7 candidates D/VLC ( 9437): access_output_file access out: file access output opened (/sdcard/MeCam/20130802_122921/video.mpg) D/VLC ( 9437): main access out: using sout access module "access_output_file" D/VLC ( 9437): main mux: looking for sout mux module matching "ts": 10 candidates D/VLC ( 9437): mux_ts mux: shaping=200000 pcr=70000 dts_delay=400000 D/VLC ( 9437): main mux: using sout mux module "mux_ts" D/VLC ( 9437): main stream output: muxer support adding stream at any time D/VLC ( 9437): stream_out_standard stream out: using `file/ts:///sdcard/MeCam/20130802_122921/video.mpg' D/VLC ( 9437): main stream out: using sout stream module "stream_out_standard" D/VLC ( 9437): main stream out: using sout stream module "stream_out_duplicate" D/VLC ( 9437): main input: using timeshift granularity of 50 MiB, in path '/tmp' D/audio_hw_primary( 180): in_standby: enter D/audio_hw_primary( 180): in_standby: exit: status(0) D/VLC ( 9437): main input: `rtsp://192.168.10.4:8554/stream' gives access `rtsp' demux `' path `192.168.10.4:8554/stream' D/VLC ( 9437): main input: creating demux: access='rtsp' demux='' location='192.168.10.4:8554/stream' file='(null)' D/VLC ( 9437): main demux: looking for access_demux module matching "rtsp": 4 candidates D/VLC ( 9437): live555 demux: version 2012.12.18 D/audio_hw_primary( 180): in_set_parameters: enter: kvpairs=input_source=1;routing=-2147483644 D/audio_hw_primary( 180): in_set_parameters: exit: status(11) D/audio_hw_primary( 180): start_input_stream: enter: usecase(3) D/audio_hw_primary( 180): select_devices: out_snd_device(0: none) in_snd_device(15: handset-mic) D/audio_hw_primary( 180): enable_snd_device: sending audio calibration for snd_device(15) acdb_id(4) E/ACDB-LOADER( 180): Error: ACDB AudProc vol returned = -8 D/audio_hw_primary( 180): enable_snd_device: snd_device(15: handset-mic) D/audio_hw_primary( 180): enable_audio_route: apply mixer path: audio-record D/audio_hw_primary( 180): start_input_stream: exit D/VLC ( 9437): live555 demux: RTP subsession 'video/H264' D/VLC ( 9437): main input: selecting program id=0 D/VLC ( 9437): live555 demux: setup start: 0.000000 stop:0.000000 D/VLC ( 9437): live555 demux: We have a timeout of 60 seconds D/VLC ( 9437): live555 demux: spawned timeout thread D/VLC ( 9437): live555 demux: play start: 0.000000 stop:0.000000 D/VLC ( 9437): main demux: using access_demux module "live555" D/VLC ( 9437): main decoder: looking for packetizer module matching "any": 20 candidates D/VLC ( 9437): packetizer_h264 decoder: found NAL_SPS (sps_id=0) D/VLC ( 9437): packetizer_h264 decoder: found NAL_PPS (pps_id=0 sps_id=0) D/VLC ( 9437): main decoder: using packetizer module "packetizer_h264" D/VLC ( 9437): main input: starting in async mode D/VLC ( 9437): main demux meta: looking for meta reader module matching "any": 1 candidates D/VLC ( 9437): main demux meta: no meta reader modules matched D/VLC ( 9437): main input: `rtsp://192.168.10.4:8554/stream' successfully opened D/VLC ( 9437): main input: switching to sync mode D/VLC ( 9437): main input: Buffering 0% D/VLC ( 9437): main input: Buffering 7% D/VLC ( 9437): main input: Buffering 15% D/VLC ( 9437): main input: Buffering 24% D/VLC ( 9437): main input: Buffering 32% D/VLC ( 9437): main input: Buffering 41% D/VLC ( 9437): main input: Buffering 49% D/VLC ( 9437): main input: Buffering 58% D/VLC ( 9437): main input: Buffering 66% D/VLC ( 9437): main input: Buffering 75% D/VLC ( 9437): main input: Buffering 83% D/VLC ( 9437): main input: Buffering 92% D/VLC ( 9437): main input: Stream buffering done (503 ms in 500 ms) D/VLC ( 9437): main input: Decoder buffering done in 0 ms D/VLC ( 9437): live555 demux: lost 22852 bytes D/VLC ( 9437): live555 demux: increasing buffer size to 200000 D/VLC ( 9437): main stream output: adding a new sout input (sout_input:0x78312028) D/VLC ( 9437): stream_out_duplicate stream out: duplicated a new stream codec=h264 (es=0 group=0) D/VLC ( 9437): main decoder: looking for decoder module matching "any": 31 candidates D/VLC ( 9437): avcodec decoder: trying to use direct rendering D/VLC ( 9437): avcodec decoder: allowing 4 thread(s) for decoding D/VLC ( 9437): avcodec decoder: avcodec codec (H264 - MPEG-4 AVC (part 10)) started D/VLC ( 9437): avcodec decoder: using frame thread mode with 4 threads D/VLC ( 9437): main decoder: using decoder module "avcodec" D/VLC ( 9437): main packetizer: looking for packetizer module matching "any": 20 candidates D/VLC ( 9437): packetizer_h264 packetizer: found NAL_SPS (sps_id=0) D/VLC ( 9437): packetizer_h264 packetizer: found NAL_PPS (pps_id=0 sps_id=0) D/VLC ( 9437): main packetizer: using packetizer module "packetizer_h264" D/VLC ( 9437): stream_out_duplicate stream out: - added for output 0 D/VLC ( 9437): main mux: adding a new input D/VLC ( 9437): mux_ts mux: adding input codec=h264 pid=68 D/VLC ( 9437): mux_ts mux: new PCR PID is 68 D/VLC ( 9437): stream_out_duplicate stream out: - added for output 1 W/VLC ( 9437): main mux: late buffer for mux input (116866) D/VLC ( 9437): avcodec decoder: available software decoder output format 0 (yuv420p) D/VLC ( 9437): main spu text: looking for text renderer module matching "any": 1 candidates D/VLC ( 9437): freetype spu text: using fontsize: 2 D/VLC ( 9437): main spu text: using text renderer module "freetype" D/VLC ( 9437): main scale: looking for video filter2 module matching "any": 32 candidates D/VLC ( 9437): swscale scale: 32x32 chroma: YUVA -> 16x16 chroma: RGBA with scaling using Bicubic (good quality) D/VLC ( 9437): main scale: using video filter2 module "swscale" D/VLC ( 9437): main scale: looking for video filter2 module matching "any": 32 candidates D/VLC ( 9437): yuvp scale: YUVP to YUVA converter D/VLC ( 9437): main scale: using video filter2 module "yuvp" D/VLC ( 9437): main video output: Deinterlacing available D/VLC ( 9437): main video output: deinterlace 0, mode blend, is_needed 0 D/VLC ( 9437): main video output: Opening vout display wrapper D/VLC ( 9437): main vout display: looking for vout display module matching "any": 2 candidates D/VLC ( 9437): android_surface vout display: Pixel format RV32 D/VLC ( 9437): main vout display: VoutDisplayEvent 'fullscreen' 0 D/VLC ( 9437): main vout display: using vout display module "android_surface" D/VLC ( 9437): main vout display: A filter to adapt decoder to display is needed D/VLC ( 9437): main filter: looking for video filter2 module matching "any": 32 candidates D/VLC ( 9437): yuv_rgb_neon filter: I420(1280x720) to RV32(1280x720) D/VLC ( 9437): main filter: using video filter2 module "yuv_rgb_neon" D/VLC ( 9437): main vout display: Filter 'yuv_rgb_neon' (0x798c5c6c) appended to chain D/VLC ( 9437): main video output: original format sz 1280x720, of (0,0), vsz 1280x720, 4cc I420, sar 1:1, msk r0x0 g0x0 b0x0 D/VLC ( 9437): avcodec decoder: enabling direct rendering E/VLC ( 9437): main vout display: Failed to change zoom E/VLC ( 9437): main vout display: Failed to set on top E/VLC ( 9437): main vout display: Failed to change source AR W/VLC ( 9437): yuv_rgb_neon filter: can't get output picture W/VLC ( 9437): yuv_rgb_neon filter: can't get output picture D/VLC ( 9437): main vout display: auto hiding mouse cursor D/VLC ( 9437): live555 demux: tk->rtpSource->hasBeenSynchronizedUsingRTCP() E/VLC ( 9437): main input: ES_OUT_RESET_PCR called D/VLC ( 9437): main input: Buffering 0% D/VLC ( 9437): main input: Buffering 8% D/VLC ( 9437): main input: Buffering 16% D/VLC ( 9437): main input: Buffering 24% D/VLC ( 9437): main input: Buffering 33% D/VLC ( 9437): main input: Buffering 41% D/VLC ( 9437): main input: Buffering 50% D/VLC ( 9437): main input: Buffering 58% D/VLC ( 9437): main input: Buffering 66% D/VLC ( 9437): main input: Buffering 75% D/VLC ( 9437): main input: Buffering 75% D/VLC ( 9437): main input: Buffering 75% D/VLC ( 9437): main input: Buffering 83% D/VLC ( 9437): main input: Buffering 91% D/VLC ( 9437): main input: Buffering 99% D/VLC ( 9437): main input: Stream buffering done (539 ms in 518 ms) D/VLC ( 9437): main input: Decoder buffering done in 0 ms D/dalvikvm( 9437): GC_FOR_ALLOC freed 5420K, 15% free 32857K/38316K, paused 76ms, total 76ms W/VLC ( 9437): mux_ts mux: packet with too strange dts (dts=10764539955,old=10764551112,pcr=10764551112) D/dalvikvm( 511): GC_CONCURRENT freed 2084K, 24% free 17531K/23020K, paused 2ms+4ms, total 72ms D/dalvikvm( 9437): GC_FOR_ALLOC freed 7879K, 13% free 32853K/37448K, paused 17ms, total 17ms
Question #3: How can I force hardware decoding? Would it be correct to add libvlc_media_add_option(p_md, ":codec=iomx"); at the end of new_media in libvlcjni.c?

gregoiregentil
Blank Cone
Blank Cone
Posts: 27
Joined: 30 Jan 2013 07:48

Re: Force hardware decoding

Postby gregoiregentil » 03 Aug 2013 01:22

After investigations, hardware decoding works on my device and iomx is the right thing but it seems that hardware decoding is NOT selected when it's a RTSP stream. If I dump the stream with VLC and plays it after, it decodes with hardware.

So, why hardware decoding is disabled when receiving a stream and can I fix that?

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: Force hardware decoding

Postby edwardw » 05 Aug 2013 05:49

Yes, the log is using software decoding via libav.

And iomx does not support decoding all formats, so VLC will use software decoding for whatever iomx cannot do.

And #3: if you do that any video that the chip cannot decode will not be able to be played.

busybeeCS
Blank Cone
Blank Cone
Posts: 37
Joined: 24 Aug 2013 08:06

Re: Force hardware decoding

Postby busybeeCS » 27 Aug 2013 03:34

Yes, the log is using software decoding via libav.

And iomx does not support decoding all formats, so VLC will use software decoding for whatever iomx cannot do.

And #3: if you do that any video that the chip cannot decode will not be able to be played.
i dont beleive "VLC will use software decoding for whatever iomx cannot do", if so, it should provide a mechanism to help us to detect whether the device support hard decoding or not,and some people would not see black screen when using hard decoding while using soft decoding goes well.

if u think u are right,can u provide same evidence?

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: Force hardware decoding

Postby edwardw » 27 Aug 2013 09:27

Yes, the log is using software decoding via libav.

And iomx does not support decoding all formats, so VLC will use software decoding for whatever iomx cannot do.

And #3: if you do that any video that the chip cannot decode will not be able to be played.
i dont beleive "VLC will use software decoding for whatever iomx cannot do", if so, it should provide a mechanism to help us to detect whether the device support hard decoding or not,and some people would not see black screen when using hard decoding while using soft decoding goes well.

if u think u are right,can u provide same evidence?
Firstly, please write proper English.

Secondly, where are your patches then?

busybeeCS
Blank Cone
Blank Cone
Posts: 37
Joined: 24 Aug 2013 08:06

Re: Force hardware decoding

Postby busybeeCS » 27 Aug 2013 11:53

Yes, the log is using software decoding via libav.

And iomx does not support decoding all formats, so VLC will use software decoding for whatever iomx cannot do.

And #3: if you do that any video that the chip cannot decode will not be able to be played.
i dont beleive "VLC will use software decoding for whatever iomx cannot do", if so, it should provide a mechanism to help us to detect whether the device support hard decoding or not,and some people would not see black screen when using hard decoding while using soft decoding goes well.

if u think u are right,can u provide same evidence?
Firstly, please write proper English.

Secondly, where are your patches then?
sry for my unproper english,i will improve myself.
what do u mean by "where are your patches"?i cannot get it.

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: Force hardware decoding

Postby edwardw » 27 Aug 2013 12:01

If you think that you have a reliable mechanism to detect whether the device supports hardware decoding, then please share the mechanism in question...


Return to “VLC for Android and Chrome OS”

Who is online

Users browsing this forum: No registered users and 12 guests