Get RV24 with imem from Intel RealSense camera and broadcast it

This forum is about all development around libVLC.
vlad-29
New Cone
New Cone
Posts: 7
Joined: 17 Nov 2016 11:40

Get RV24 with imem from Intel RealSense camera and broadcast it

Postby vlad-29 » 28 Nov 2016 09:35

Hello, I'm trying to broadcast segmented frames from RealSense SR300 camera. I'm using imem module to input segmented frames in RV24 but get nothing. I have used parts of code for imem callbacks from here https://forum.videolan.org/viewtopic.php?t=122178
Here is my code:

Code: Select all

uint8_t * buffertobroadcast; buffertobroadcast = (uint8_t*)malloc(640*480*3); memset(buffertobroadcast, 10, 640*480*3);// put something into buffer until realsense camera put here frames int mNumInputs = 1; int mSampleFreq = 25; char *vlc_args[12]; vlc_args[0] = "-vvvvv"; vlc_args[1] = (char*)calloc(200, 1); sprintf(vlc_args[1], "--imem-get=%ld", myImemGetCallback); vlc_args[2] = (char*)calloc(200, 1); sprintf(vlc_args[2], "--imem-release=%ld", myImemReleaseCallback); vlc_args[3] = (char*)calloc(200, 1); sprintf(vlc_args[3], "--imem-cat=2"); //CAT 1 == AUDIO vlc_args[4] = (char*)calloc(200, 1); sprintf(vlc_args[4], "--imem-data=%ld", buffertobroadcast);/** my context custom data to be passed callbacks **/ vlc_args[5] = "--imem-id=0"; vlc_args[6] = (char*)calloc(200, 1); sprintf(vlc_args[6], "--imem-codec=RV24"); //CODEC, format of the data passed to vlc in the buffers vlc_args[7] = (char*)calloc(200, 1); sprintf(vlc_args[7], "--imem-width=640"); vlc_args[8] = (char*)calloc(200, 1); sprintf(vlc_args[8], "--imem-height=480"); vlc_args[9] = (char*)calloc(200, 1); sprintf(vlc_args[9], "--imem-channels=%d", mNumInputs); //number of channels vlc_args[10] = (char *)calloc(200, 1); sprintf(vlc_args[10], "--imem-samplerate=%d", mSampleFreq); //sample frequency //vlc_args[11] = "--imem-fps=2.000000"; libvlc_instance_t * inst; libvlc_media_player_t *mp; libvlc_media_t *m; /* Load the VLC engine */ inst = libvlc_new(11, vlc_args); // запуск VLC с аргументами для imem m = libvlc_media_new_location(inst, "imem://"); // проигрывать из памяти mp = libvlc_media_player_new_from_media(m); libvlc_media_release(m); //libvlc_vlm_add_broadcast(inst, "strm", "imem://", "#transcode{vcodec=mp1v,vb=800}:standard{access=http,mux=mpg,dst=127.0.0.1:8080}", 0, NULL, 1, 0);// broadcasting didn't work so i comment it and tryed to play the frames in window //libvlc_vlm_play_media(inst, "strm"); libvlc_media_player_play(mp); //realsense stuff to fill the buffer in "while()" cycle until program not closed libvlc_media_player_stop(mp); /* Free the media_player */ libvlc_media_player_release(mp); libvlc_release(inst);
I think this code should give me window with image from realsense camera but i get nothing.
Here is the log:

Code: Select all

Starting D:\FF_3DSeg\bin/Win32/FF_3DSeg_d.exe [0155364c] core libvlc debug: VLC media player - 2.2.4 Weatherwax [0155364c] core libvlc debug: Copyright © 1996-2016 the VideoLAN team [0155364c] core libvlc debug: revision 2.2.4-0-g888b7e89 [0155364c] core libvlc debug: configured with ../extras/package/win32/../../../configure '--enable-update-check' '--enable-lua' '--enable-faad' '-- enable-flac' '--enable-theora' '--enable-twolame' '--enable-quicktime' '--enable-avcodec' '--enable-merge-ffmpeg' '--enable-dca' '--enable-mpc' '-- enable-libass' '--enable-x264' '--enable-schroedinger' '--enable-realrtsp' '--enable-live555' '--enable-dvdread' '--enable-shout' '--enable-goom' '-- enable-caca' '--disable-sdl' '--enable-qt' '--enable-skins2' '--enable-sse' '--enable-mmx' '--enable-libcddb' '--enable-zvbi' '--disable-telx' '-- enable-nls' '--host=i686-w64-mingw32' 'host_alias=i686-w64-mingw32' [0155364c] core libvlc debug: using multimedia timers as clock source [0155364c] core libvlc debug: min period: 1 ms, max period: 1000000 ms [0155364c] core libvlc debug: searching plug-in modules [0155364c] core libvlc debug: loading plugins cache file D:\FF_3DSeg\plugins\plugins.dat [0155364c] core libvlc debug: recursively browsing `D:\FF_3DSeg\plugins' [0155364c] core libvlc debug: saving plugins cache D:\FF_3DSeg\plugins\plugins.dat [0155364c] core libvlc debug: plug-ins loaded: 419 modules [0155364c] core libvlc debug: translation test: code is "ru" [0155364c] core libvlc debug: CPU has capabilities MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 FPU [0314d614] core generic debug: creating audio output [0316b6cc] core audio output debug: looking for audio output module matching "any": 6 candidates [0316b6cc] directsound audio output debug: found 2 devices [0316b6cc] core audio output debug: using audio output module "directsound" [0314d614] core generic debug: keeping audio output [03153f1c] core input debug: Creating an input for 'imem://' [03153f1c] core input debug: using timeshift granularity of 50 MiB, in path 'C:\Users\STUDEN~1\AppData\Local\Temp' [03153f1c] core input debug: `imem://' gives access `imem' demux `' path `' [03153f1c] core input debug: specified demux `any' [03153f1c] core input debug: creating demux: access='imem' demux='any' location='' file='(null)' [0313d90c] core demux debug: looking for access_demux module matching "imem": 12 candidates [0313d90c] imem demux debug: Using get(013a1fb0), release(013a2070), data(02fcf040), cookie((null)) [0313d90c] imem demux debug: Video RV24 640x480 SAR 0:0 frame rate 0/0 [03153f1c] core input debug: selecting program id=0 [0313d90c] core demux debug: using access_demux module "imem" [030ea8bc] core decoder debug: looking for decoder module matching "any": 43 candidates <Hold Ctrl during startup to select from menu of video profiles> [030ea8bc] rawvideo decoder warning: invalid frame rate 0/0, using 25 fps instead [030ea8bc] core decoder debug: using decoder module "rawvideo" [030f9074] core demux meta debug: looking for meta reader module matching "any": 2 candidates [030f9074] lua demux meta debug: Trying Lua scripts in C:\Users\student-math\AppData\Roaming\vlc\lua\meta\reader [030f9074] lua demux meta debug: Trying Lua scripts in D:\FF_3DSeg\lua\meta\reader [030f9074] lua demux meta debug: Trying Lua playlist script D:\FF_3DSeg\lua\meta\reader\filename.luac [030f9074] core demux meta debug: no meta reader modules matched [03153f1c] core input debug: `imem://' successfully opened Streaming from Intel(R) RealSense(TM) 3D Camera SR300 Firmware: 3.17.0.0 Color: 640x360x30 Depth: 640x480x30 You are now in the ideal operating range.
Here is [03153f1c] core input debug: `imem://' successfully opened but there are neither errors nor image. What is my mistake? How to look for errors?

Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 34 guests