[streaming] [imp] help to get stream on buffer

Rajiv <[email protected]> Tue, 20 Jan 2015 05:46:14 +0530
Newsgroups gmane.comp.video.videolan.vls.general
Message-ID <CAJadeXeQqtEiEzB-9BPxO5m_f-fhtA=edT-J071gmxaSmAPhMw@mail.gmail.com>
--===============5777550417236477272==
Content-Type: multipart/alternative; boundary=047d7b10ce9707daac050d0a5ae1

--047d7b10ce9707daac050d0a5ae1
Content-Type: text/plain; charset=UTF-8

Hello experts,

I am working to get stream from file to my buffer so that i can send it via
my custom port/protocol and i am facing couple of issues, so please help me
out

where i am:

* After reading tutorial from
https://wiki.videolan.org/Stream_to_memory_(smem)_tutorial/ i am able to
compile and run
* I have done following changes for smem options to work with video (please
refer to complete code mentioned at the end)

[code]sprintf(smem_options,
"#transcode{vcodec=RV32}:smem{video-postrender-callback=%lld,video-prerender-callback=%lld}",
                // We are using transcode because smem only support raw
audio and video formats
                 (long long int)(intptr_t)(void*)&handleStream, (long long
int)(intptr_t)(void*)&prepareRender);[/code]

* i can see that both prerender and postrenders are being called and data
is being supplied


myProblems:

* currently to test the output i am dumping the buffer directly to file,
some thing like [code]fwrite (p_pixel_buffer, sizeof(char), i_size,
myfile); [/code]
but dumped file is not being read either by vlc player or any other
streaming player so i am sure i am  missing here something, because if i
ask vlc player to write directly to file by giving full transcode values
then things are fine [code]sprintf(smem_options,
"#transcode{vcodec=theo,vb=800,acodec=vorb,ab=128,channels=2,samplerate=44100}:file{dst=stream-output.ogg}");[/code]]

myQuestions

* is reading from buffer correct? because i read [quote]First, a quick
warning: starting with VLC2.2 (current git version, to be released soon),
the size parameter is a size_t. There's no API for smem (yet? hopefully
this will change), which sucks, so this would silently break your
application.[/quote] from
http://stackoverflow.com/questions/23092940/get-frame-from-video-with-libvlc-smem-and-convert-it-to-opencv-mat-c

if yes then
      * is there any alternative API where i can hook and get buffer?

if not then
    * what wrong i am doing and what extra work i have to do to get this
done?

any pointer/sample program would be great help


PS:
* here is the complete code i am running http://pastebin.com/Dp8rSHuM
* log file out for the run http://pastebin.com/z5iVD0Jb
Regards,
Rajiv

--047d7b10ce9707daac050d0a5ae1
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hello experts,</div><div><br></div><div>I am working =
to get stream from file to my buffer so that i can send it via my custom po=
rt/protocol and i am facing couple of issues, so please help me out</div><d=
iv><br></div><div>where i am:</div><div><br></div><div>* After reading tuto=
rial from <a href=3D"https://wiki.videolan.org/Stream_to_memory_(smem)_tuto=
rial/">https://wiki.videolan.org/Stream_to_memory_(smem)_tutorial/</a> i am=
 able to compile and run</div><div>* I have done following changes for smem=
 options to work with video (please refer to complete code mentioned at the=
 end)</div><div><br></div><div>[code]sprintf(smem_options, &quot;#transcode=
{vcodec=3DRV32}:smem{video-postrender-callback=3D%lld,video-prerender-callb=
ack=3D%lld}&quot;,</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 // We are using transcode because smem only support raw audio an=
d video formats</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0(long long int)(intptr_t)(void*)&amp;handleStream, (long long =
int)(intptr_t)(void*)&amp;prepareRender);[/code]</div><div><br></div><div>*=
 i can see that both prerender and postrenders are being called and data is=
 being supplied</div><div><br></div><div><br></div><div>myProblems:</div><d=
iv><br></div><div>* currently to test the output i am dumping the buffer di=
rectly to file, some thing like [code]fwrite (p_pixel_buffer, sizeof(char),=
 i_size, myfile); [/code]</div><div>but dumped file is not being read eithe=
r by vlc player or any other streaming player so i am sure i am =C2=A0missi=
ng here something, because if i ask vlc player to write directly to file by=
 giving full transcode values then things are fine [code]sprintf(smem_optio=
ns, &quot;#transcode{vcodec=3Dtheo,vb=3D800,acodec=3Dvorb,ab=3D128,channels=
=3D2,samplerate=3D44100}:file{dst=3Dstream-output.ogg}&quot;);[/code]]</div=
><div><br></div><div>myQuestions</div><div><br></div><div>* is reading from=
 buffer correct? because i read [quote]First, a quick warning: starting wit=
h VLC2.2 (current git version, to be released soon), the size parameter is =
a size_t. There&#39;s no API for smem (yet? hopefully this will change), wh=
ich sucks, so this would silently break your application.[/quote] from <a h=
ref=3D"http://stackoverflow.com/questions/23092940/get-frame-from-video-wit=
h-libvlc-smem-and-convert-it-to-opencv-mat-c">http://stackoverflow.com/ques=
tions/23092940/get-frame-from-video-with-libvlc-smem-and-convert-it-to-open=
cv-mat-c</a></div><div>=C2=A0</div><div>if yes then=C2=A0</div><div>=C2=A0 =
=C2=A0 =C2=A0 * is there any alternative API where i can hook and get buffe=
r?</div><div><br></div><div>if not then=C2=A0</div><div>=C2=A0 =C2=A0 * wha=
t wrong i am doing and what extra work i have to do to get this done?</div>=
<div><br></div><div>any pointer/sample program would be great help</div><di=
v><br></div><div><br></div><div>PS:=C2=A0</div><div>* here is the complete =
code i am running <a href=3D"http://pastebin.com/Dp8rSHuM">http://pastebin.=
com/Dp8rSHuM</a></div><div>* log file out for the run <a href=3D"http://pas=
tebin.com/z5iVD0Jb">http://pastebin.com/z5iVD0Jb</a></div><div><div class=
=3D"gmail_signature">Regards,<br>Rajiv=C2=A0 </div></div>
</div>

--047d7b10ce9707daac050d0a5ae1--

--===============5777550417236477272==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
streaming mailing list
To unsubscribe or modify your subscription options:
https://mailman.videolan.org/listinfo/streaming

--===============5777550417236477272==--