Forums - H264 encoder API : MediaServer vs OMX

5 posts / 0 new
Last post
H264 encoder API : MediaServer vs OMX
dfasd_ffff
Join Date: 18 Apr 12
Posts: 2
Posted: Mon, 2012-04-30 01:32

For using the H264 encoder, there is the sample qcom_video_codec_sample_1_3_1.zip.

I have a Galaxy S2 with Android Ginberbread and this encoder sample works fine.

In this sample, OMX interface are used for accessing the HW H264 encoder. I am wondering if this same encoder can be accessed by using higher level interfaces, like 'MediaRecorder', which allows setting:

    - the source with method Video(VIDEO_SOURCE_CAMERA) or setVideo(VIDEO_SOURCE_GRALLOC_BUFFER) (on Ice Scream Sandwitch only)

    - the encoder (setVideoEncoder(VIDEO_ENCODER_H264)

    - output format setVideo(OUTPUT_FORMAT_MPEGTS)

If YES, is there a Qualcomm sample available using those interfaces.

 

Regards, Franck

 

 

  • Up0
  • Down0
Steve L (not verified)
Posted: Tue, 2012-05-01 17:32

 

IOMX allows for the flexibility to configure the different encoder parameters, as opposed to the MediaRecorder class where we do not . Additionally, iOMX provides access to the direct bitstream where MediaRecorder just outputs directly to a file.

 

We don't have any example using MediaRecorder, but if your goal is to use MediaRecorder and you want to encode to either H264, H263, or MPEG4, MediaRecorder may work fine for you

 

  • Up0
  • Down0
krish
Join Date: 17 May 12
Posts: 3
Posted: Tue, 2012-06-12 02:39


Hello Steve L ,

Thanks for providing information.
I am using sanpdragon msm8660 hardware for development and booting the Android via SDCARD.
After executing the qcom encoder sample executable ,facing the error as "/dev/msm_vidc_enc" device not found.even same device file present in device.see output of availability check in hardware.

# ls -l /dev/msm_vidc_enc
crw-rw---- system   audio    244,   0 1970-01-01 01:19 msm_vidc_enc

Result has not change even after changing the permission of device file.As per my understanding "/dev/msm_vidc_enc" takes the raw data from application ,encode using available hardware encoder and give encoded data to application for storing into output file.

output LOG

# qcom_omx_sample -e /data/sample.176x144.yuv /data/encode1.h264 320 240
Hardware version: 8x60

Encoding /data/sample.176x144.yuv to /data/encode1.h264
QCOMOMXINTERFACE encode_file:655
QCOMOMXINTERFACE - QcomOmxInterfaceEncoder :21 
QCOMOMXINTERFACE: MEDIA PLAYER SERVICE OMX Instance
QCOMOMXINTERFACE: QUERY FOR OMX COMPONENT: OMX.qcom.video.encoder.avc
QCOMOMXINTERFACE: LIST NODES
QCOMOMXINTERFACE: -- OMX.qcom.audio.decoder.Qcelp13
QCOMOMXINTERFACE: -- OMX.qcom.audio.decoder.aac
QCOMOMXINTERFACE: -- OMX.qcom.audio.decoder.evrc
QCOMOMXINTERFACE: -- OMX.qcom.audio.decoder.multiaac
QCOMOMXINTERFACE: -- OMX.qcom.audio.decoder.wma
QCOMOMXINTERFACE: -- OMX.qcom.audio.decoder.wma10Pro
QCOMOMXINTERFACE: -- OMX.qcom.audio.decoder.wmaLossLess
QCOMOMXINTERFACE: -- OMX.qcom.audio.encoder.aac
QCOMOMXINTERFACE: -- OMX.qcom.audio.encoder.amrnb
QCOMOMXINTERFACE: -- OMX.qcom.audio.encoder.evrc
QCOMOMXINTERFACE: -- OMX.qcom.audio.encoder.qcelp13
QCOMOMXINTERFACE: -- OMX.qcom.video.decoder.avc
QCOMOMXINTERFACE: -- OMX.qcom.video.decoder.divx
QCOMOMXINTERFACE: -- OMX.qcom.video.decoder.divx311
QCOMOMXINTERFACE: -- OMX.qcom.video.decoder.divx4
QCOMOMXINTERFACE: -- OMX.qcom.video.decoder.h263
QCOMOMXINTERFACE: -- OMX.qcom.video.decoder.mpeg2
QCOMOMXINTERFACE: -- OMX.qcom.video.decoder.mpeg4
QCOMOMXINTERFACE: -- OMX.qcom.video.decoder.vc1
QCOMOMXINTERFACE: -- OMX.qcom.video.decoder.wmv
QCOMOMXINTERFACE: -- OMX.qcom.video.encoder.avc
QCOMOMXINTERFACE: Component found: OMX.qcom.video.encoder.avc
QCOMOMXINTERFACE - OBSERVER IS SET!
QCOMOMXINTERFACE - Could not allocate node: OMX.qcom.video.encoder.avc -- error -2147483648
QCOMOMXINTERFACE - Create :61  setupResult error
QCOMOMXINTERFACE - ERROR creating encoder: 4 (Could not Allocate OpenMax Component)QCOMOMXINTERFACE encode_file:675 errorcode=4
Script Result: Could not Allocate OpenMax Component
# logcat
--------- beginning of /dev/log/system
D/PowerManagerService(  160): acquireWakeLock flags=0x1 tag=AlarmManager
D/PowerManagerService(  160): releaseWakeLock flags=0x1 tag=AlarmManager
--------- beginning of /dev/log/main
E/OMX-VENC-720p(  113):
E/OMX-VENC-720p(  113):  omx_video(): Inside Constructor()
E/OMX-VENC-720p(  113):
E/OMX-VENC-720p(  113):  omx_venc(): Inside component_init()
E/OMX-VENC-720p(  113): ERROR: Omx_venc::Comp Init Returning failure strerror=No such device
E/OMX-VENC-720p(  113):
E/OMX-VENC-720p(  113): ERROR: venc_open failed
E/OMX-VENC-720p(  113):
E/OMX-VENC-720p(  113):  ~omx_video(): Inside Destructor()
E/OMX-VENC-720p(  113): omx_video: Waiting on Msg Thread exit
E/OMX-VENC-720p(  113): omx_video: Waiting on Async Thread exit
E/OMX-VENC-720p(  113):
E/OMX-VENC-720p(  113):  m_etb_count = 0, m_fbd_count = 0
E/OMX-VENC-720p(  113): omx_video: Destructor exit
E/OMX-VENC-720p(  113): Exiting 7x30 OMX Video Encoder ...
E/OMXMaster(  113): makeComponentInstance:130 error err=-2147479552
E/        (  553): Could not Allocate OpenMax Component
D/PowerManagerService(  160): acquireWakeLock flags=0x1 tag=sleep_broadcast
D/PowerManagerService(  160): acquireWakeLock flags=0x1 tag=ActivityManager-Sleep
D/PowerManagerService(  160): releaseWakeLock flags=0x1 tag=ActivityManager-Sleep
V/DATA    (  260): [DCT(0) ] intent received :android.intent.action.SCREEN_OFF
I/PowerManagerService(  160): Increasing sampling rate.
I/PowerManagerService(  160): Increasing sampling rate.
D/PowerManagerService(  160): releaseWakeLock flags=0x1 tag=sleep_broadcast
D/PowerManagerService(  160): acquireWakeLock flags=0x1 tag=AlarmManager
D/PowerManagerService(  160): acquireWakeLock flags=0x1 tag=show keyguard
D/PowerManagerService(  160): releaseWakeLock flags=0x1 tag=AlarmManager
D/LockScreen(  160): Keyguard screen = 1
D/LockScreen(  160): updateLayout: status=SimMissingsubscription=0
D/LockScreen(  160): updateLayout: status=SimMissingsubscription=0
D/PowerManagerService(  160): releaseWakeLock flags=0x1 tag=show keyguard

can you provide information what could be the issue ?any specific need to change ?

Regards,
Krish

  • Up0
  • Down0
[email protected] (not verified)
Posted: Wed, 2012-08-01 11:42

Hello, are you building the sample with the same OS that you are running on the device? (Gingerbread, ICS, etc?)  If so, which OS?

  • Up0
  • Down0
Gradon
Join Date: 19 Sep 13
Posts: 6
Posted: Mon, 2013-12-30 17:54

Following the description in the zip file. Download the source of the whole OS (I am using JB), add those particular files, and re-build the whole OS? It seems to be a bit complicated just to use a hardware accelerated h264. Why is .so is not available on both device/development side available by default?

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.