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
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
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
Hello, are you building the sample with the same OS that you are running on the device? (Gingerbread, ICS, etc?) If so, which OS?
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?