Bài đăng

Hướng dẫn live Stream sử dụng Nginx-RTMP và KURENTO

1. Cài đặt Nginx và Nginx-RTMP – Cài đặt các gói thư viện cần thiết để biên dịch Nginx và Nginx-RTMP từ source yum -y install gcc gcc-c++ make zlib-devel pcre-devel openssl-devel – Thư mục chứa source code mặc định là /usr/local/src cd /usr/local/src – Tải về mã nguồn Nginx và Nginx-RTMP wget http://nginx.org/download/nginx-1.10.1.tar.gz wget https://github.com/arut/nginx-rtmp-module/archive/master.zip – Giải nén mã nguồn vừa tải về tar zxf nginx-1.10.1.tar.gz unzip master – Chuyển vào thư mục chứa mã nguồn Nginx và tiến hành biên dịch cd nginx-1.10.1 – Tạo Makefile để Nginx sẽ được biên dịch với module Nginx-RTMP ./configure --with-http_ssl_module --add-module=../nginx-rtmp-module-master – Tiến hành biên dịch và cài đặt make make install – Tạo Nginx init scripts wget https://www.nginx.com/resources/wiki/start/topics/examples/redhatnginxinit/# -O /etc/init.d/nginx chmod +x /etc/init.d/nginx – Khởi động Nginx service nginx start 2. Cài đặt FFmpeg – Tạo fi...

An introduction to encoding and pushing with ffmpeg

Ffmpeg, the swiss army knife of streaming Ffmpeg is an incredibly versatile piece of software when it comes to media encoding, pushing and even restreaming other streams. Ffmpeg is purely command line, which is both its downside and strength. It'll allow you to use it in automation on your server, which can be incredibly handy for any starting streaming platform. The downside is that as you'll have to do this without a graphical interface, the learning curve is quite high, and if you don't know what you're doing you can worsen the quality of your video or even make it unplayable. Luckily the basic settings are really forgiving for starting users, and as long as you keep the original source files you're quite safe from mistakes. So what can ffmpeg do? Anything related to media really: there's little that ffmpeg can't do. If you have a media file/stream you'll be able to adjust the codecs however you want, change the media format and record it to a ...

How to Live Stream Using FFmpeg

How to record your camera to a video file. $ ffmpeg -f avfoundation -i "1:0" -t 00:00: 15 -s 1280x720 -r 30 -b:v 3500k -b:a 128k out.mpg $ ffmpeg -f avfoundation -i "2:0" -t 00:00: 15 -s 1280x720 -r 30 -b:v 3500k -b:a 128k out.mpg -i = “video:audio” -t = duration -r = fps -b:v = video bitrate -b:a = audio bitrate How to stream a video file to a RTMP server $ ffmpeg -re -i input.mp4 -vcodec libx264 -preset veryfast -maxrate 1500k -c:a aac -b:a 128k -ac 2 -ar 44100 -f flv rtmp: // yourserver: 1935 / live / mystream How to live stream your screen monitor to a RTMP server $ ffmpeg -f avfoundation -i "2:0" -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -s 1280x720 -r 30 -b:v 1500k -bufsize 1500k -maxrate 7000k -c:a aac -b:a 128k -ac 2 -ar 44100 -f flv rtmp: // yourserver: 1935 / live / mystream How to stream your camera to a RTMP server $ ffmpeg -f avfoundation -i "1:0...

Làm thế nào để tối ưu hoá khi truy vấn Mongodb

Chúng tôi đã triển khai MongoDB về một số dự án trước đây và tiếp tục, như chúng tôi là đối tác của MongoDB. Chúng tôi muốn chia sẻ một số kiến ​​thức mà chúng tôi đã đạt được và vượt qua các hướng dẫn về cách bạn có thể khai thác tối đa lợi ích của MongoDB với các dự án hiện tại và tương lai của bạn. Hãy kiểm tra hướng dẫn này để dễ dàng thực hiện theo cách bạn có thể tạo dữ liệu thử nghiệm trong khi để tối ưu hoá truy vấn trong MongoDB. Luôn luôn tạo index trong mỗi Collection. Indexes  được tạo bằng createIndex . Lệnh cơ bản nhất để lập chỉ mục  country  trong collection User theo thứ tự tăng dần: db . user . createIndex ( { country : 1 } ) ; Hầu hết  Indexes  của bạn có thể là các trường đơn, nhưng bạn cũng có thể tạo  Indexes  hợp chất trên hai hoặc nhiều trường. Ví dụ: db . user . createIndex ( { country : 1 , city : 1 } ) ; Hãy thận trọng khi sử dụng Sort.