2

I want to capture the live incoming flash media stream generated via webcam from client machine using gstreamer rtmpsrc plugin and convert it to some processable format. The problem is when i try to view the incoming rtmp flash media stream using the following command i can see the output but when i try to save the stream to a file using filesink it doesn't work at all .

gst-launch-0.10 rtmpsrc location='rtmp://127.0.0.1/flvplayback/mynewstream live=1' ! flvdemux name=d d. ! queue ! decodebin ! xvimagesink

I also wont to construct this pipeline into C/ C ++ program so that i can process the incoming elements . I have written the code for " filesrc --> appsrc --> appsink --> filesink " and it works fine.

however when i write code for the "rtmpsrc -->appsrc --> appsink--> rtmpsink " it doesn't work. I am new to gstreamer programming so can you help me out or tell me good resource where i can get such programming tutorials or samples .

My system config :

Linux Ubuntu 12.04 64 bit

crtmpserver x86_64

gstreamer 0.10

Devendra
  • 89
  • 2
  • 11

2 Answers2

1

I think you can use flvdemux separate video(H.264) and audio(MPEG 4 AAC),then handle them.Such as delay 10 sec:queue max-size-buffers=0 max-size-time=0 max-size-bytes=0 min-threshold-time=10000000000.

example:

gst-launch-1.0 rtmpsrc location=rtmp://XXXX ! flvdemux name=mydemuxer flvmux name=mymuxer ! queue ! rtmpsink location=rtmp://XXXX mydemuxer.audio ! queue ! mymuxer.audio mydemuxer.video ! queue ! mymuxer.video

hailuodev
  • 764
  • 5
  • 9
0

Why do you need appsrc and appsink? Try rtmpsrc ! filesink to dump the file directly.

av501
  • 6,645
  • 2
  • 23
  • 34
  • As I have mentioned it already I want to process the incoming stream and stream out the processed data that's why I need appsrc and appsink . If you think I am wrong or you know any other method for same please do share. – Devendra Aug 28 '12 at 04:17
  • Well its difficult to tell what to do unless you describe what you mean by "it doesn't work". Does it not preroll, does it not go to playing state. Some output dump etc. Try adding a queue between your appsrc and appsink and check. Either you check that data is coming out of appsrc by doing a fwrite in your app or something. Then check that data is coming out of appsink by putting a filesink after appsink and so on. Check where the issue is. – av501 Aug 28 '12 at 04:35
  • can you tell me where i can get tutorials for writing gstreamer apps and tht too using appsrc and specially rtmpsrc and its apis . And by "it doesnt work" i mean it gives "rtmp server sent error " and exits. secondly another command like "gst-launch-0.10 rtmpsrc location='rtmp://127.0.0.1/flvplayback/mynewstream live=1' ! flvdemux name=video ! video/x-flash-video ! filesink location=/home/dev/ko.flv " saves the .flv file to disk but when i try to open it using mplayer it gives error and if i try to view is soimple filesrc ---> xvimagesink it shows snow . – Devendra Aug 28 '12 at 05:26
  • The gstreamer application writer manual is the best place to start. You have to go step by step here. gstreamer.net is the place to get all the documents. Btw, why demux before writing to the file. Can you not write directly wihthout demuxing what the rtmpsrc gives you? Just asking. – av501 Aug 28 '12 at 05:44
  • Well as i said i an new to gstreamer and i am trying things out by searching over the net. Whjat solution you suggest for my task. I mean what command or pipleline i should use if i want to cath a live incoming flash media stream over rtmp and access it in a program to process it and then further put another rtmp live stream onto crtmpd server . As i said when i open this o.flv file via mplayer it gives unsupported stream error , and when i watch it using xvimagesink it shows snow. doent it mean tht there is mistake or bug while sinking the file . right ? can u suggest anything regarding tht ? – Devendra Aug 28 '12 at 05:54
  • Well there are no shortcuts here. You have to grind it out to understand the components you are using and do it step by step. Ensure that every element is working right first and is giving the output you want. I haven't done any flash streaming myself using gstreamer so do not have anything directly to give you. But the plugins definitely work if used right. So best of luck on that. – av501 Aug 28 '12 at 06:01
  • Thanks . Ill dig in the development manual for the solution anyways if you know any good tutorials apart from gstreamer.net manuals please let me know – Devendra Aug 28 '12 at 06:03
  • hey , i am trying to use gstreamer-bad plugin in my prpogram ,but when i saw the list of all the packages installed on my machine using pkg-config --list-all command it doenst shows the package gstreamer-plugins-bad-0.10 , does it miean that i cant successfully compile the progarm in which i am using those bad plugins ? – Devendra Aug 28 '12 at 06:36