How to load proprietary OMX components with GStreamer & Bellagio - gstreamer

I'm trying to stream the video of an IP Camera that exposes what I believe to be OMX components.
To grab the stream I've installed and configured GStreamer with gst-omx and Bellagio, but I can't get Bellagio to recognize and register the components.
I don't have any specific question, but would be very grateful for any pointers on how to wire this thing up.
Below are the components.
An analysis with Cutter revealed that libOMX_BELA.so has much in common with Bellagio's libomxil-bellagio.so.0.
$ ls /lib | grep OMX
libOMX_ACODEC.so
libOMX_ALSA.so
libOMX_ASPL.so
libOMX_AVQE_A.so
libOMX_BELA.so
libOMX_IJPE.so
libOMX_IJPE_ENC_HW.so
libOMX_IJPE_ENC_SW.so
libOMX_IJPE_MEM_MGR.so
libOMX_VMFE.so
libOMX_VSPL.so
libOMX_VSRC.so
libOMX_VVHE.so
Output from gst-inspect-1.0
$ ./gst-inspect-1.0
omx: omxmpeg2dec: OpenMAX MPEG2 Video Decoder
omx: omxmp3dec: OpenMAX MP3 Audio Decoder
omx: omxaacenc: OpenMAX AAC Audio Encoder
omx: omxmpeg4videoenc: OpenMAX MPEG4 Video Encoder
omx: omxh264dec: OpenMAX H.264 Video Decoder
omx: omxmpeg4videodec: OpenMAX MPEG4 Video Decoder
staticelements: bin: Generic bin
staticelements: pipeline: Pipeline object
Total count: 2 plugins, 8 features
Trying to register the components with omxregister-bellagio, nothing gets registered:
# ./omxregister-bellagio -v /lib
Scanning directory /lib/
Scanning library /lib/libOMX_ACODEC.so
Scanning library /lib/libOMX_ALSA.so
Scanning library /lib/libOMX_ASPL.so
Scanning library /lib/libOMX_AVQE_A.so
OMX-could not load /lib/libOMX_BELA.so: /lib/libOMX_BELA.so: undefined symbol: sqrt
Scanning library /lib/libOMX_IJPE.so
Scanning library /lib/libOMX_IJPE_ENC_HW.so
Scanning library /lib/libOMX_IJPE_ENC_SW.so
Scanning library /lib/libOMX_IJPE_MEM_MGR.so
Scanning library /lib/libOMX_VMFE.so
Scanning library /lib/libOMX_VSPL.so
Scanning library /lib/libOMX_VSRC.so
Scanning library /lib/libOMX_VVHE.so
0 OpenMAX IL ST static components in 0 libraries succesfully scanned

Related

cannot have the v4l2h264dec plugins on iMX8m mini

I'm building the custom yocto image for iMX8m mini.
It builds gstreamer-1.18.5.imx
At first, I am seeing video4linux2 shared lib was installed in rootfs with default package configuration options as mentioned at gstreamer1.0-plugins-good_1.18.5.imx.bb
The build succeeded.
But on the target board the $gst-inspect-1.0 | grep v4l2 only outputs 3 plugins:
v4l2src
v4l2sink
v4l2device...
I'm actually looking forward is below video decoder plugins-
I don't have it and I don't really understand why it's not there whereas the yocto recipes have all succeeded.
Can anyone suggest something which I have to look for to fix this issue

ffmpeg/Libavcodec couldn't find codec

I want to make a transcoding video app from h.264 to h.265.
I have a problem with libavcodec library. I have this library in my project, all function is working, but when i'm trying to set codec :
avcodec_find_decoder_by_name("libx265");
function couldn't find it. Hovewer, when i give "hevc" instead of "libx265" function is working, but it's not the same.
Please for help :)
There is no decoder named libx265
libx265 is only an encoder.
FFmpeg has a native, built-in HEVC/H.265 decoder
It is named hevc. You don't have to do anything special to include or enable it.
There are also several hardware accelerated HEVC decoders that may be available for your system: hevc_cuvid, hevc_mediacodec, hevc_qsv, hevc_rkmpp, and hevc_v4l2m2m.
ffmpeg has implemented codecs (lets call them builtin) and wrappers to third party codecs. It seems/could be that the h265 codec is just a wrapper, that means you have to install a h265 decoder. Besides, did you specify the h265 codec when you configured ffmpeg? Did you build it yourself or pre build via package manager?
Try 'ffmpeg -decoders' at the command line and search for h265.

MP4 file created using gstreamer doesn't be played on Window Media Player

I created mp4 file using gstreamer.
gst-launch-1.0 videotestsrc num-buffers=10 ! "video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720, framerate=(fraction)30/1" ! videoconvert ! avenc_mpeg4 ! avmux_mp4 ! filesink location=/tmp/test.mp4
And i can play it using Mplayer , VLC etc.
But i can't play it on Windows Media Player.
I checked MP4 box. but it seems like it doesn't have problem.
How can i try other way?
[Mplayer]
$ mplayer test.mp4
MPlayer 1.3.0 (Debian), built with gcc-7 (C) 2000-2016 MPlayer Team
do_connect: could not connect to socket
connect: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
Playing test.mp4.
libavformat version 57.83.100 (external)
libavformat file format detected.
[mov,mp4,m4a,3gp,3g2,mj2 # 0x7fc21b56d2a0]Protocol name not provided, cannot determine if input is local or a network protocol, buffers and access patterns cannot be configured optimally without knowing the protocol
[lavf] stream 0: video (mpeg4), -vid 0
VIDEO: [MP4V] 1280x720 24bpp 29.970 fps 11338.9 kbps (1384.1 kbyte/s)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 57.107.100 (external)
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
Clip info:
major_brand: isom
minor_version: 512
compatible_brands: isomiso2mp41
creation_time: 2020-04-09T11:11:51.000000Z
encoder: Lavf57.71.100
Load subtitles in ./
Audio: no sound
Starting playback...
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [vdpau] 1280x720 => 1280x720 Planar YV12
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [vdpau] 1280x720 => 1280x720 Planar YV12
V: 0.3 0/ 0 ??% ??% ??,?% 0 0
Exiting... (End of file)
See https://support.microsoft.com/en-us/help/316992/file-types-supported-by-windows-media-player
MP4 Video file (.mp4, .m4v, .mp4v, .3g2, .3gp2, .3gp, .3gpp)
[..] Windows Media Player does not support the playback of the .mp4 file format. You can play back .mp4 media files in Windows Media Player when you install DirectShow-compatible MPEG-4 decoder packs [..]

I am using ffmpeg library in my program to record video and audio

I want to record video coming from a camcorder to a wmv file. I am using ffmpeg libraries and I have it saving the video as an "avi" file. However the requirements of the project is to output a wmv file. Can anyone help me discover how to set up the video and audio codecs?
You can configure for video codec as MPEG4 and audio codec as Windows media audio 2 to get the .wmv file format.
ffmpeg -i input.mp4 -b:v 2M -vcodec msmpeg4 -acodec wmav2 output.wmv
When you use ffmpeg to generate WMV format the output video quality may be slightly less than other format. So it is better to set the qscale value to get better quality video.

Video codec for H264 with opencv

I am trying to create a movie using opencv and I need that output file be in H264 format.
I used the following fourcc in opencv, but I am getting error that suitable codec is not installed.
fourcc=CV_FOURCC('H','2','6','4') ;
When I run my application I get the following error message:
Could not find encoder for codec id 28: Encoder not found
What do I need to be able to use this codec in OpenCV?
H264 is not a codec, but rather a standard, while for example x264 is an encoder that implements the H264 standard (CV_FOURCC('X','2','6','4') ;).
OpenCV can write videos using FFMPEG or VFW. You need to compile FFPMEG with x264-support (instructions can be found on FFMPEG's website)
If you are using VFW: Take a look at http://sourceforge.net/projects/x264vfw/