Livestream with crtmpserver - I can't find the live file - rtmp

I use crtmpserver to make my RTMP server. I use Adobe Flash Media Live Encoder 3.2 to publish the livestream to the server. It is OK. I use a webflash player to receive the live stream. It is OK.
Now, I want to find the live file in the server, but I can't find the file. Which folder is the livestream?

If you want to stream a .flv file:
In every crtmpserver application there is a property called mediaFolder that by default refers to folder media.
mediaFolder="./media",
Then the streaming URL of the file is as:
rtmp://<server IP address>/<application name>/<file name>
If you want to stream a live stream:
When you define an stream acceptor in the acceptors section, you can specify the name of the stream by localStreamName as:
{
ip="0.0.0.0",
port=9005,
protocol="inboundTcpTs",
localStreamName="tcpchan5"
},
Then the URL of this stream is as:
rtmp://<server IP address>/<application name>/tcpchan5
To receive the input stream and feed the RTMP server, you may use FFmpeg:
ffmpeg -i <input_stream> -vcodec libx264 -s 320x240 -vb 512k -async 1 -acodec libvo_aacenc -ab 32k -ac 1 -f mpegts tcp://<server IP address>:<server feed port>
For example:
ffmpeg -i udp://224.11.11.11:2000 -vcodec libx264 -s 320x240 -vb 512k -async 1 -acodec libvo_aacenc -ab 32k -ac 1 -f mpegts tcp://127.0.0.1:9000

Related

egrep file of txt varibles is removing varibles with spaces

i have a script I use that reads ipaddress or ranges lines in from a txt file and insert them into my iptables. allows me to maintain one list for many servers. Recently I have been playing with string searches and user-agents stopping bad actors that use scripts that identify themselves using weird names in the useragent that i discover using tcpdump
I am trying to read a file and read each line in and
I am reading a file full of variables using egrep for example
JuNXhgCR
sipcli/v1.8
sipcli
friendly-scanner
pplsip
Asterisk PBX
Asterisk PBX 1.6.5
erdfcvqwaszx121
sipvicious
eyeBeam
VaxIPUserAgent
VaxSIPUserAgent/3.1
siparmyknife
VoIP SIP v11.0.0
FreePBX 1.8
Test Agent
but when i
egrep -v "^#|^$" x | while IFS= read -r uas
do
iptables -A INPUT -p udp -m udp --dport 5060 -m string --string $uas --algo bm --to 65535 -j DROP
done <"${_input}"
I just get ... but anything with a space is not passed ?? where is... VoIP SIP v11.0.0 , FreePBX 1.8 , Test Agent ??
JuNXhgCR
sipcli/v1.8
sipcli
friendly-scanner
pplsip
erdfcvqwaszx121
sipvicious
eyeBeam
VaxIPUserAgent
VaxSIPUserAgent/3.1
siparmyknife
Is there a better way to read and do this?

IP camera with RTSP on the web, RED5 and ffmpeg

i have a ip camera with rtsp protocol and i want to stream on the web using flash video. I know i can use vlc but i do not want to use that.
I installed red5 and ffmpeg for convert RTSP to RTMP
ffmpeg -i "rtsp://46.13.85.43:8020/ch0.h264" -f flv -r 25 -s 640x480 -an "rtmp://localhost/live"
and result is: UDP timeout. retrying with TCP
Any idea where is the problem ?
You have to specify that tcp protocol is used, or at least that helped me. Please add this parameter -rtsp_transport tcp to your ffmpeg command.

rtmpt protocol dump handshake error

When I try to dump rtmpt protocol with rtmpdump in Ubuntu, I got this error:
ERROR: RTMP_Connect1, handshake failed.
I would like to dump:
rtmpdump -v -r "rtmpt://37.130.228.52:80/atv/atv3"
I solved the problem. First of all the ip addresses for rtmp url was changing between few ip addresses.When I try the other ip numbers it was connecting to the rtmp but it was being rejected instantly. This was due swf verification, that is some rtmp urls also needs swf verification. Hence, when I typed as follow it successfully play on vlc player.
rtmpdump -v -r "rtmpt://..../atv/atv3" -s http://....swf?i=1 | vlc -
Next problem is that I want to play this rtmp with avconv/avplay not with vlc player. I could not give swfurl parameter succesfully in avplay. Instead this we can also dump with rtmpdump first and pipe it with avplay or avconv but I could not achieve this as well.
Edit: Second problem is solved with
rtmpdump ...... | avplay -i pipe:0

How to transfer files from a remote server to my Amazon S3 instance?

I have about 15 gigs of data in 5 files that I need to transfer to an Amazon S3 bucket, they are currently hosted on a remote server that I have no scripting or shell access to - I can only download them VIA an httpd link.
How can I transfer these files to my Amazon S3 bucket without first having to download them to my local machine then re-upload them to S3?
If you want to automate the process, use AWS SDK.
Like in following case use AWS PHP SDK:
use Aws\Common\Aws;
$aws = Aws::factory('/path/to/your/config.php');
$s3 = $aws->get('S3');
$s3->putObject(array(
'Bucket' => 'your-bucket-name',
'Key' => 'your-object-key',
'SourceFile' => '/path/to/your/file.ext'
));
More details:
http://blogs.aws.amazon.com/php/post/Tx9BDFNDYYU4VF/Transferring-Files-To-and-From-Amazon-S3
http://docs.aws.amazon.com/aws-sdk-php/guide/latest/service-s3.html
Given that you only have 5 files, use the S3 file uploader http://console.aws.amazon.com/s3/home?region=us-east-1 (Actions, Upload) after you have downloaded the files to some intermediate machine. EC2 running Windows might be the best solution as the upload to S3 would be very fast. You can download Chrome onto your EC2 instance from chrome.google.com, or use the existing web browser (IE) to do the job.
[1] SSH with keys
sh-keygen -f ~/.ssh/id_rsa -q -P ""
cat ~/.ssh/id_rsa.pub
Place this SSH key into your ~/.ssh/authorized_keys file
mkdir ~/.ssh
chmod 0700 ~/.ssh
touch ~/.ssh/authorized_keys
chmod 0644 ~/.ssh/authorized_keys
[2] Snapshot ZFS, minimize transfer with LZMA, send with RSYNC
zfs snapshot zroot#150404-SNAPSHOT-ZROOT
zfs list -t snapshot
Compress to file with lzma (more effective than bzip2)
zfs send zroot#150404-SNAPSHOT-ZROOT | lzma -9 > /tmp/snapshots/zroot#150404-SNAPSHOT-ZROOT.lzma
rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress --partial /tmp/snapshots/zroot#150404-SNAPSHOT-ZROOT.lzma <username>#<ip-address>:/
[3] Speedup transfer with MBUFFER, send with ZFS Send/Recieve
Start the receiver first. This listens on port 9090, has a 1GB buffer, and uses 128kb chunks (same as zfs):
mbuffer -s 128k -m 1G -I 9090 | zfs receive zremote
Now we send the data, also sending it through mbuffer:
zfs send -i zroot#150404-SNAPSHOT-ZROOT zremote#150404-SNAPSHOT-ZROOT | mbuffer -s 128k -m 1G -O <ip-address>:9090
[4] Speedup transfer by only sending diff
zfs snapshot zroot#150404-SNAPSHOT-ZROOT
zfs snapshot zroot#150405-SNAPSHOT-ZROOT [e.g. one day later]
zfs send -i zroot#150404-SNAPSHOT-ZROOT zroot#150405-SNAPSHOT-ZROOT | zfs receive zremote/data
See also my notes

How to test Berkley socket (BSD) API?

I'd like to test the correctness and the completeness of an implementation of the BSP API.
The test set has to be cross-compiled for an ARM sam7x.
I don't know if this would be of any interest to you, but here are two links to presentations from NYC BSD Conference 2008: Detecting TCP regressions with tcpdiff (FreeBSD) and An introduction to the Automated Testing Framework (ATF) for NetBSD. Both were pretty good.
There is a public domain Benchmarking tool for TCP and UDP performance measurement.
It has a some amount of control available. You might be able to use it for testing.
Remember, this is not testing the API, but the implementation performance, you will need more than this.
The PCATTCP tool includes several options that are controlled by parameters passed on the command line when the program is started. To see the available options, run the PCATTCP application with the "-h" option. Here is what you would see:
pcattcp -h
PCAUSA Test TCP Utility V2.01.01.08
Usage: pcattcp -t [-options] host [ < in ]
pcattcp -r [-options > out]
Common options:
-l ## length of bufs read from or written to network (default 8192)
-u use UDP instead of TCP
-p ## port number to send to or listen at (default 5001)
-s toggle sinkmode (enabled by default)
sinkmode enabled:
-t: source (transmit) fabricated pattern
-r: sink (discard) all received data
sinkmode disabled:
-t: reads data to be transmitted from stdin
-r: writes received data to stdout
-A align the start of buffers to this modulus (default 16384)
-O start buffers at this offset from the modulus (default 0)
-v verbose: print more statistics
-d set SO_DEBUG socket option
-b ## set socket buffer size (if supported)
-f X format for rate: k,K = kilo{bit,byte}; m,M = mega; g,G = giga
-c -t: send continuously
-r: accept multiple connections sequentially
-R concurrent TCP/UDP multithreaded receiver
.
Options specific to -t:
-n ## number of source bufs written to network (default 2048)
-D don't buffer TCP writes (sets TCP_NODELAY socket option)
-w ## milliseconds of delay before each write (default 0)
-L ## desired transmit data rate in bytes/second
Options specific to -r:
-B for -s, only output full blocks as specified by -l (for TAR)
-T "touch": access each byte as it's read