Webcam streaming with mediatomb

bluesmoke
2008-10-06
2013-05-30
  • bluesmoke
    bluesmoke
    2008-10-06

    Hi,

       I want to stream my webcam video output over the network. Is it possible to call vlc from the mediatomb. As my vlc is already streaming webcam, now I just want to merge the two applications such that I can initiate and stop the streaming from my media render.
    Any idea or advice would be appreciated.Thankyou

     
    • Jin
      Jin
      2008-10-06

      You could probably solve this using the external transcoding feature, should not be too difficult.

      You have a hint now, let me know if you get stuck :>

       
    • bluesmoke
      bluesmoke
      2008-10-07

      Hi Jin, Thanks for the hint. Using the transcoding feature first I am trying to trancode a flash file. Doing so I have successfully transcode and transmit a flash file with rtp mode (...standard{access=rtp,mux=ts,dst=my_ip_address}). In this case I can see the transcoded stream with vlc player(using option open network stream) .

         But I want to see it playing on my XBMC's player. To achieve this, I think, I have to put the trancoded data in the fifo from where mediatomb will able to transmit it (i.e....standard{access=file,mux=ps,dst=~/my_fifo}) . Unfortunately the errors like "

      "main private error: cannot add this stream
      stream_out_transcode private error: cannot add this stream

      are becoming the hurdles.
      I hope you can direct me out of the situation,Thanks

       
    • Jin
      Jin
      2008-10-07

      I do not understand your problem, how does your webcam offer the stream? Can you connect to this stream using vlc? If so - why won't the supplied vlcmpeg profile work for you? Why do you want to mess with fifo's manually?

       
    • bluesmoke
      bluesmoke
      2008-10-08

      okey Let I simplify may problem...

      Before transcode my webcam video  I want to transcode first any other file in my disk. I have a maromedia flash file with mimetype=application/octet-stream which I tried to transcode using  given vlcmpeg profile.

      But on accessing the file from my player (XBMC). I am getting some output on my mediatomb console as:

      INFO: Arguments: -I dummy %in --sout #transcode{venc=ffmpeg,vcodec=mp2v,vb=4096,fps=25, aenc=ffmpeg,acodec=mpga,ab=192,samplerate=44100,ch annels=2}:standard{access=file,mux=ps,dst=%out} vlc:quit

      VLC media player 0.8.6a Janus
      starting VLC root wrapper... using UID 1000 (user)
      [00000289] dummy interface: using the dummy interface module...
      [00000306] access_output_file private error: cannot open `/tmp//mt_transcode_892GIU' (Permission denied)
      [00000304] stream_out_standard private error: no suitable sout access module for `file/ps:///tmp//mt_transcode_892GIU'
      [00000301] stream_out_transcode private error: cannot create chain
      [00000300] main stream output error: stream chain failed for `transcode{venc=ffmpeg,vcodec=mp2v,vb=4096,fps=25, aenc=ffmpeg,acodec=mpga,ab=192,samplerate=44100,ch annels=2}:standard{access=file,mux=ps,dst=/tmp//mt_transcode_892GIU}'

      [00000298] main input error: cannot start stream output instance, aborting
      [00000312] dummy demuxer: command `quit'
      [00000283] main playlist: stopping playback

       
    • bluesmoke
      bluesmoke
      2008-10-09

      Hi,

         I am still getting the error mentioned above when I try to play .flv file from A/V media client. Can any body give some advices to overcome the problem...

      To check if the profile is working I  replaced the "%out" (from vlcmpeg profile in config.xml) with a local file path(let say /home/user/trancoded_file). In this case the transcoded data  succesfully save in the mentioned address(/home/user/transcoded_file).

      This means the problem is in "%out" only. It could not write in its deafult fifo but show the error as:

        "access_output_file private error: cannot open
      `/tmp//mt_transcode_892GIU' (Permission denied)"

       
    • Jin
      Jin
      2008-10-09

      You're not running MediaTomb from sudo, aren't you?

      The problem is not with MT and not with the trasncoding profiles but with your overall setup.

       
    • bluesmoke
      bluesmoke
      2008-10-13

      Hi Jin,

          Yes I agree that the problem is not with MT nor with transcoding profile. Actually VLC 0.8.6 installed on my linux box do transcoding but cannot write into fifo instead it gives permission errors. (I dont know whether vlc 0.8.6 is not able to write in fifo or it is creating problems for me only ).

      Now I can get transcoded webcam stream on http://my.ip.address:8080 (using vlc transcoder). My Question is that if it is possible to create a fake item in mediatomb database which maps on this http address instead of mapping at fifo's address.

      Or some other solutions , if you can help in this scenerio???thanks

       
    • Jin
      Jin
      2008-10-13

      As I asked - you are not running MT via sudo, are you aren't you?

      Transcoding works as everyone else, however you will find a forum post with a similar problem, I do not remember exactly, but I think it was related to the use of sudo. So again, the problem is not with MT, not with VLC but is related to your MT setup.

      Please read the transcoding docs again, they explain why the fifo is needed.

      The correct solution would be to simply fix your installation, maybe you could give more details on how exactly you installed the package, how you are starting MT, etc.

       
    • bluesmoke
      bluesmoke
      2008-10-13

      yes i am running it as a super user (via sudo).

      HOW I INSTALLED?

      I added
          deb http://apt.mediatomb.cc/ etch main in the sources.list

      and then
      sudo apt-get update
      sudo apt-get install mediatomb

      and while installing it displays at the shell as :

      Reading package list ... Done
      Building dependency tree... Done
      The following extar packages will be installed:
         mediatomb-daemon
      The gollowin new packages will be installed:
         mediatomb mediatomb-daemon
      ...
      ..

      Get1: http://apt.mediatomb.cc etch/main mediatomb-daemon 0.11.0-1etch1
      Get2: http://apt.mediatomb.cc etch/main mediatomb 0.11.0-1etch1

      Unpacking mediatomb-daemon .....
      ...
      Unpacking mediatomb....

      Setting up mediatomb (0.11.0-etch1) ...
      * mediatomb: No starting UPnP media server
      * madiatomb: Disabled in /etc/default/mediatomb

      thats all..

      HOW I AM STARTNG MT?
      running command:  mediatomb

      WHY THE PROBLEM IS IN VLC????
      Bcaz I have tried to run vlc independently from the command line with command:

      vlc input_file --sout '#transcode {.....}:standard{access=file,mux=ps,dst=@my_fifo}
      and as a result on the command shell it shows the same errors.

      thanks

       
    • Jin
      Jin
      2008-10-13

      > yes i am running it as a super user (via sudo).

      You shouldn't. Either run it as a system wide service (daemon mode) or run it as user, but never do "sudo mediatomb".

      > HOW I AM STARTNG MT?
      > running command: mediatomb

      How does that go along with the first answer? Did you sudo or not? And who are you when you run the mediatomb command (i.e. - what user are you in the terminal where you run the command).

       
    • bluesmoke
      bluesmoke
      2008-10-14

      >>How does that go along with the first answer? Did you sudo or not?

      What I used to do??

      i) start command shell (alt+ctrl+t)

      ii) sudo su
            (It asks me the admin password)
      After becoming super user, I think , anything I run should be in sudo mode (may be I am wrong here)

      iii) mediatomb....

           After all thank you very much. I run it now as a simple user and its done know (transcoding done).

       
    • bluesmoke
      bluesmoke
      2008-10-15

      I have got webcam stream in A/V mediaclient through mediatomb.

      To have this:
      i)   I made my vlc capturing webcam and writting the transcoded output in my_fifo.
      ii)  Then I create an item in mediatomb database directing towards the location of my_fifo
      iii) my a/v media client is able to read it but with a delay of 25 seconds.(I think the delay is due to the fifo invovled in it. )

      CAN I DO IT WITHOUT INVOLVING FIFO??

      one way is that if my vlc stream data on http://ip:8080. In this case is it possible to access this live stream by using the external URL feature of mediatomb???.

      (I have tried to add  external url in mt database, but after creating it when I click the URL's title ....it mapped to http://mt_server_ip:49152/ip_address:8080. Do i need to do something scripting and config.xml )

       
    • Jin
      Jin
      2008-10-16

      Doh...

      > To have this: 
      > i) I made my vlc capturing webcam and writting the transcoded output in my_fifo.
      > ii) Then I create an item in mediatomb database directing towards the location of my_fifo
      > iii) my a/v media client is able to read it but with a delay of 25 seconds.(I think the delay is due to the fifo invovled in it. )

      Why would you mess with fifos yourself and not use the transcoding framework?? You are spending a lot of effort on reinventing the wheel, instead of using an already available feature.

      > (I have tried to add external url in mt database, but after creating it when I click the URL's title ....it
      > mapped to http://mt_server_ip:49152/ip_address:8080.

      ...and when doing so you selected internal URL instead of external URL?

      And don't tell me it doesn't work, people are playing mms:// streams in combination with VLC transcoding and everything is working out nicely.

      You can easily setup a live stream from your webcam to your player, just try to be more careful, having another look at the transcoding docs might help as well. If you do not understand something in the docs - ask - but please read them, I tried to explain how it works and a lot of people are using this feature successfully.

       
    • bluesmoke
      bluesmoke
      2008-10-24

      Thanx Jin for helping me throughout. I have make it working now  using transcoding profile ..........which use vlc to capture the webcam device and then transcode it into mpeg format. And I can watch the streaming at AV media renderer.

         Here I want to ask a question that if I have camera (camera has an embedded web server and is able to trancode and stream its data over some external http address). When a upnp media renderer make request for web cam stream I want to direct it to that external http address. The reason is that I do not want any transcoding on my mediatomb device due to some energy issues.

      Simply the question is that I want to redirect the media renderer to some external http address.

      have a nice weekend,

       
    • Jin
      Jin
      2008-10-25

      Well, what about an external url item?

       
    • bluesmoke
      bluesmoke
      2008-10-27

      Thnax alot.....its done

       
    • Jin
      Jin
      2008-10-27

      Finally, it's been quite a long way :) I am happy to hear that everything worked out in the end.

      Kind regards,
      Jin