Page 1 of 1

Streaming to localhost on Win7 64 with VLC as service = Fail

Posted: 15 Jan 2011 03:16
by Bondia
Hi all,

I'm trying to stream a DTV channel to an RTMP server on the internet. Due to my DVB-T stick not being recognized on Linux, I'm using a computer with Windows 7 64 bit edition. This machine is new and has plenty of power for the task.

The configuration is as follows: I use VLC to tune in to the station, transcode/resize it to MP4 (in an FLV container) and stream it to localhost through http. At the same time, I start ffmpeg to catch the local stream and then send it to a Flash Media Server through RTMP in the internet.

This approach tend to work in theory. Practically, it has lots of flaws since both programs (VLC and ffmpeg) are crashing/having errors frequently, thus stopping the DTV channel from being continuosly streamed 24/7. Now I'll relate what I've been suffering and the approach taken to (try to) solve it (I'm telling about ffmpeg only for information purposes; I'm aware this is the VLC forum and I'm not asking for support for it):

For instance, I made a .bat file that would restart VLC every time it crashes (which is very frequently), but I quickly encountered the problem of the "VLC recently crashed - do you want to report it?" dialog when restarting it, which prevents the program to start streaming until someone clicks in one of the two options. I searched this forum and the entire internet for a sollution, found the --no-interact --no-qt-privacy-ask --no-qt-error-dialogs ---no-qt-updates-notif parameters and tryied them just to find that the dialog still appears when restarting after a crash.

So I noticed the "tunning as a service" option and thought maybe this way I could avoid the dialog from appearing, and, at the same time, assure it would be permanently running (which I already solved with the .bat file) and it would be starting automatically after a restart (which I also had already done, putting it in the "init" menu).

As I already had the correct parameters I needed to run VLC as a standalone program, I put them "the service way" and ended with this:

vlc -I ntservice --ntservice-install --ntservice-name="VLC_SERVICE" --ntservice-options="-V dummy --no-interact --no-qt-privacy-ask --no-qt-error-dialogs --no-qt-updates-notif dvb-t://frequency=612000000 :dvb-bandwidth=-1 :dvb-caching=300 :sout=#transcode{vcodec=h264,vb=140,fps=25,scale=1,width=320,height=240,acodec=mp4a,ab=48,channels=2,samplerate=22050}:http{mux=ffmpeg{mux=flv},dst=:1221/test} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep"

Then nothing happens, which is good, since when putting wrong parameters VLC would tell me. But there is no service created. I run services.msc and cannot find my VLC_SERVICE service anywhere on the local services list. Moreover, if I run Task Manager I can see a vlc.exe 32 bit process running (a new one will be created each time I run the command above). But this process does nothing; at least it's not doing what it sould do.

I'd like to know if someone has experienced this behaviour when trying to run VLC as a service on Windows 7 (x64), if there is a way to solve this, or at least a way of getting rid of the hateful crash report dialog. I'd like to compile VLC by my own to try to get rid of it but obviously I'd like to try "easier" ways before.

Also I would thank any advise on how to approach the task I'm trying to accomplish. I know there are plenty of programs I could try on Linux simply using pipes and/or using the Video4Linux device for the DVB-T tuner as the input device on the transcoding program, but as Windows don't support it I don't know of any other software appart from this. It would be great if VLC could stream to RTMP servers, but to my knowledge this isn't supported at the momment (and I don't know of any future plans about this).

Thanks in advance to anyone who has had the patience to arrive here! :P

Re: Streaming to localhost on Win7 64 with VLC as service =

Posted: 16 Jan 2011 15:23
by VLC_help
Crash file (crashdump) is added to %appdata%\vlc folder, so you can manually remove it before restart (not very nice, we know).

Re: Streaming to localhost on Win7 64 with VLC as service =

Posted: 16 Jan 2011 21:39
by Bondia
Thanks for replying! Certainly it's a very useful tip; I already deleted that folder several times in order to try to get rid of miscellaneous problems, but never figured out the crash reporting dialog didn't appera when doing that. It's a big help! But just being curious, isn't there any option to disable that dialog? I think it should be optional to disable it in a next version then.

Now any tip on why the service isn't being created would be great too!!! ;)

Re: Streaming to localhost on Win7 64 with VLC as service =

Posted: 18 Jan 2011 16:58
by Bondia
I want to report some success with my configuration. Now VLC is working really stable, without any undesirable crashes in hours, and also deleting the (possible) crashdump file before starting in my .bat file restarts it with minimal hurt.

I'd like to note that most, if not all, crashes of VLC were due to bad DTV reception. Now that I'm sure reception is optimal, it is working perfect. Anyone should check this twice without reporting any problems. In my case it seems the antenna cable was damaged, even it was well before and apparently noone manipulated it.

I still I'm somewhat frustrated of not being able to install VLC as a service. The command I'm trying now is:

vlc -I ntservice --ntservice-install --ntservice-name="VLC_SERVICE" --ntservice-options="-V dummy --no-interact --no-qt-privacy-ask --no-qt-error-dialogs --no-qt-updates-notif -vvv" dvb-t://frequency612000000 :dvb-bandwidth=-1 :dvb-caching=300 :sout=#transcode{vcodec=h264,vb=140,fps=25,scale=1,width=320,height=240,acodec=mp4a,ab=48,channels=2,samplerate=22050}:http{mux=ffmpeg{mux=flv},dst=:1221/test} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep

which at least seems to be a bit more correct since the vlc.exe process that is being created consumes more memory (closer thant when running command-line) than in may previous attemps (about 2 MB), what suggets at least it is receiving the DTV broadcast (when running in command line mode and doing transcoding properly, memory consumption is at about 64 MB :O)

Anyway, I've done further test and now I'm almost sure that VLC is unable to create a service in Win 7 x64. For instance, take the following command:

vlc --ntservice-install --ntservice-name="VLC_SERVICE" --ntservice-options="--no-interact --no-qt-privacy-ask --no-qt-error-dialogs --no-qt-updates-notif ---v" dvb-t://frequency=612000000

It correctly displays a VLC instance, tunes in the correct DTV channel and displays it. Unfortunately, the VLC_SERVICE isn't show in the "services" list, and the vlc.exe process stops when I exit the program.

Re: Streaming to localhost on Win7 64 with VLC as service =

Posted: 19 Jan 2011 18:50
by Bondia
One more problem report... Now I'm experiencing audio/video sync problems after hours running without crashes. I'm sure it is a VLC problem since if I restart ffmpeg nothing gets solved, but it gets synchronized again if I start VLC.

What I ignore is if desync is a problem of playing the DTV channel or if it is induced while doing the transcoding process... Any hint on how to solve this will be greatly appreciated.

Re: Streaming to localhost on Win7 64 with VLC as service =

Posted: 20 Jan 2011 12:47
by VLC_help
What I ignore is if desync is a problem of playing the DTV channel or if it is induced while doing the transcoding process... Any hint on how to solve this will be greatly appreciated.
You can figure that out by doing sout without transcode, or transcode some other kind of stream. Anyway I think bug like that (takes few hours before showing up) is very hard to locate and fix.

Re: Streaming to localhost on Win7 64 with VLC as service =

Posted: 21 Jan 2011 14:51
by Bondia
Thanks again for your reply!

The problem with desync has worsened, even that I appended the "--audio-sync" flag. After hours (almost an entire day) of transcoding it's very noticeable, sometimes as much as MINUTES of delay! Nevertheless, as I relay on other program (ffmpeg) to do the streaming to the RTMP server and it gets hung and needs to be restarted, I take advantage of it and also restart VLC :P