video problem to playing on android phone

About encoding, codec settings, muxers and filter usage
omar-vlc
New Cone
New Cone
Posts: 5
Joined: 22 Feb 2013 06:56

video problem to playing on android phone

Postby omar-vlc » 22 Feb 2013 07:16

I've asked this question in the vlc and vlc-devel mailing-lists. I think I'd better to do it here again to get any possible information. Thanks in advance.

I tried to build a streaming server on Windows to receive multimedia data from **.m3u8 on the network and then stream it out with rtsp.
The browser on android phone played with video and audio if I did it with VLC.
But the browser played with only audio and no video (black screen) if I did it with demo code of libvlc from wiki.
I don't know the difference between the two mode.
Demo code is as follows:

Code: Select all

// vlc2stream.cpp : Defines the entry point for the console application. #include "stdafx.h" #include <conio.h> #include <vlc/vlc.h> #include <Windows.h> int _tmain(int argc, _TCHAR* argv[]) { libvlc_instance_t * inst; libvlc_media_player_t *mp; libvlc_media_t *m; libvlc_log_t *log; /* Load the VLC engine */ inst = libvlc_new (0, NULL); // logging log = libvlc_log_open (inst); libvlc_set_log_verbosity (inst, 2); unsigned int level = libvlc_get_log_verbosity (inst); printf ("vlc log verbosity level = %d\n", level); /* Create a new item */ m = libvlc_media_new_path (inst, "http://192.168.1.186:1000/601.m3u8"); // media option const char *options[]= { ":sout=#transcode{acodec=mp4a,ab=32,channels=2,samplerate=44100,vcodec=h264,vb=350,fps=15,scale=1}", ":sout=#standard{mux=mp4}", ":sout=#duplicate{dst=rtp{sdp=rtsp://:8554/601},dst=display}", ":sout-keep" }; for (int i = 0; i < sizeof(options) / sizeof(options[0]); i++) libvlc_media_add_option (m, options[i]); /* Create a media player playing environement */ mp = libvlc_media_player_new_from_media (m); /* No need to keep the media now */ libvlc_media_release (m); #if 0 /* This is a non working code that show how to hooks into a window, * if we have a window around */ libvlc_media_player_set_xdrawable (mp, xdrawable); /* or on windows */ libvlc_media_player_set_hwnd (mp, hwnd); /* or on mac os */ libvlc_media_player_set_nsobject (mp, view); #endif /* play the media_player */ libvlc_media_player_play (mp); while (!kbhit()) Sleep (100); /* Let it play a bit */ /* Stop playing */ libvlc_media_player_stop (mp); /* Free the media_player */ libvlc_media_player_release (mp); libvlc_release (inst); printf ("message in log = %d\n", libvlc_log_count (log)); system("pause"); return 0; }
I think problem comes from the variable options[] in the code which is based on the demo, the document to vlc command and
vlc software. Streaming with vlc software will generate a stream output string on the dialog "option setup".
I tried a lot of commands in the options[] but no result.
Anyone can help me?

omar-vlc
New Cone
New Cone
Posts: 5
Joined: 22 Feb 2013 06:56

Re: video problem to playing on android phone

Postby omar-vlc » 28 Feb 2013 07:52

Anybody home?

mundu
Blank Cone
Blank Cone
Posts: 53
Joined: 25 May 2011 19:56
VLC version: 2.1.5
Operating System: Linux

Re: video problem to playing on android phone

Postby mundu » 08 Mar 2013 14:25

Do you really need VLC? I prefer transcoding all my videos to H264 + MPEG-TS if need be and stream it any http web server(Apache). Much more reliable. Less CPU load, only during transcoding, which can be done prior to the streaming. During idle hours for example.


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 8 guests