Repeat MPEG2 TS PAL stream with crtmpserver

I want to create some stream wrapper:

I have an old Dreambox PAL Sat Reciever with a network. I want to recode this stream to a lower result in order to reload it.

My goal is to have a simple site where this stream is embedded via rtmp.

I think crtmpserver should be the right software. At the moment I have a website that works and can play local files through jwplayer / crtmpserver.

I am looking for a solution for this:

httpUrl → ffmpeg → crtmpserver

Is it possible? Can I redirect ffmpeg output to a feed and crtmpserver could capture it? Or go with UDP?

Any tips appreciated !!! Thank you !!

+1
source share
1 answer

This is easy:

  • Start the server (in console mode for debugging) You should see something like this:

    | TCP | 0.0.0.0 | 9999 | inboundTcpTs | FLVPlayback |

Basically, this is a tcp receiver for mpegts streams

  • Use ffmpeg to create the stream:

    ffmpeg -i <source> <source_related_parameters> <audio_codec_parameters> <video_codec_parameters> -f mpegts "tcp: //127.0.0.1: 9999"

Example:

ffmpeg -i /tmp/aaa.flv -acodec copy -vcodec copy -vbsf h264_mp4toannexb -f mpegts "tcp://127.0.0.1:9999" 
  • Return to the server and see the console. You should see something like this:

    The INTS stream (6) with the name ts_13_257_256 registered in the flvplayback application from the ITS protocol (13)

ts_13_257_256 is the name of the stream. Now you can use jwplayer or a similar player and point it to this stream

If you want to use UDP, you need to stop the server and change the configuration file so that instead

 protocol="inboundTcpTs" 

you should have

 protocol="inboundUdpTs" 

Yo ucan even copy the entire section and change the port number to both. In addition, you need to change ffmpeg so that instead of tcp: //127.0.0.1: 9999 you can have udp: //127.0.0.1: 9999

Now, if you also need the name of the stream, not ts_13_257_256 (which, by the way, is ts_protocolId_AudioPID_VideoPID), you can use LiveFLV in the same way:

 ffmpeg -i /tmp/aaa.flv -acodec copy -vcodec copy -vbsf h264_mp4toannexb -f flv -metadata streamName=myStreamName "tcp://127.0.0.1:6666" 

And the server should show:

 Stream INLFLV(1) with name `myStreamName` registered to application `flvplayback` from protocol ILFL(3) 

There you go, now you have the "computed" stream name, which is myStreamName

Last observation. Please ask this question on the crtmpserver mailing list. You will be better heard. You can find resources here: http://www.rtmpd.com/resources/ Find the google group under

Cheers, Andrey

+3
source

All Articles