<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:13pt"><div>Hi, all,</div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 17.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">I tried to build a streaming server to receive multimedia data from **.m3u8 on the network and then stream it out with rtsp.</div><div style="color: rgb(0, 0, 0); font-size: 17.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">The browser on android phone played with video and audio if I did it with VLC.</div><div style="color: rgb(0, 0, 0); font-size: 17.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">But the browser played with only audio and no video (black screen) if I did it with demo code of libvlc from
wiki.</div><div style="color: rgb(0, 0, 0); font-size: 17.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">I don't know the difference between the two mode.</div><div style="color: rgb(0, 0, 0); font-size: 17.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Demo code is as follows:</div><div style="color: rgb(0, 0, 0); font-size: 17.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">=========================================</div><div style="color: rgb(0, 0, 0); font-size: 17.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">// vlc2stream.cpp : Defines the entry point for the console application.<br><br>#include "stdafx.h"<br>#include <conio.h><br>#include <vlc/vlc.h><br>#include
<Windows.h><br>int _tmain(int argc, _TCHAR* argv[])<br>{<br> libvlc_instance_t * inst;<br> libvlc_media_player_t *mp;<br> libvlc_media_t *m;<br> libvlc_log_t *log;<br> <br> /* Load the VLC engine */<br> inst = libvlc_new (0, NULL);<br> <br> // logging<br> log = libvlc_log_open (inst); <br> libvlc_set_log_verbosity (inst, 2);<br> unsigned int level = libvlc_get_log_verbosity (inst);<br> printf ("vlc log verbosity level = %d\n", level); <br> <br> /* Create a new item */<br> m = libvlc_media_new_path (inst, "http://192.168.1.186:1000/601.m3u8");<br> // media option<br>
const char *options[]=<br> {<br> ":sout=#transcode{acodec=mp4a,ab=32,channels=2,samplerate=44100,vcodec=h264,vb=350,fps=15,scale=1}",<br> ":sout=#standard{mux=mp4}",<br> ":sout=#duplicate{dst=rtp{sdp=rtsp://:8554/601},dst=display}",<br> ":sout-keep"<br> };<br><br> for (int i = 0; i < sizeof(options) / sizeof(options[0]); i++)<br> libvlc_media_add_option (m, options[i]);<br> <br> /* Create a media player playing environement */<br> mp = libvlc_media_player_new_from_media (m);<br> <br> /* No need to keep the media now */<br> libvlc_media_release (m);<br> <br> #if
0<br> /* This is a non working code that show how to hooks into a window,<br> * if we have a window around */<br> libvlc_media_player_set_xdrawable (mp, xdrawable);<br> /* or on windows */<br> libvlc_media_player_set_hwnd (mp, hwnd);<br> /* or on mac os */<br> libvlc_media_player_set_nsobject (mp, view);<br> #endif<br> <br> /* play the media_player */<br> libvlc_media_player_play (mp);<br> <br> while (!kbhit())<br> Sleep (100); /* Let it play a bit */<br> <br> /* Stop playing */<br> libvlc_media_player_stop (mp);<br> <br> /* Free the
media_player */<br> libvlc_media_player_release (mp); <br> <br> libvlc_release (inst);<br> <br> <br> printf ("message in log = %d\n", libvlc_log_count (log));<br> system("pause");<br><br> return 0;<br>}<br></div><div style="color: rgb(0, 0, 0); font-size: 17.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">=========================================</div><div style="color: rgb(0, 0, 0); font-size: 17.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">I think problem comes from the variable options[] in the code which is based on the demo, the document to vlc command and <br></div><div style="color: rgb(0, 0, 0); font-size: 17.3333px; font-family: times new roman,new york,times,serif;
background-color: transparent; font-style: normal;">vlc software. Streaming with vlc software will generate a stream output string on the dialog "option setup".</div><div style="color: rgb(0, 0, 0); font-size: 17.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">I tried a lot of command in the options[] but no result.</div><div style="color: rgb(0, 0, 0); font-size: 17.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Anyone can help me?</div><div style="color: rgb(0, 0, 0); font-size: 17.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 17.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Thanks in advance.</div><div style="color: rgb(0, 0, 0); font-size:
17.3333px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Omar</div></div></body></html>