Objective
When the video stream is pushed, the rtmp will have a delay of 3 seconds. At present, one solution is to resolve it in a Mpegts format. If you consider using FFmpeg to push the flow, you can use the HTTP format and UDP format to push the stream. The thing to do now is to forward the rtmp to the WebSocket interface with Netty, and then play with H5. The playback plugin is implemented using the JSMPEG project.
"FFmpeg push
Mpegts Basics Look at these blog posts:Mpegts FoundationAnalysis of ts,pes,es structure of MpegtsTS Stream multiplexing and multiplexing is a reverse process. TS multiplexing gets the PES bare stream of audio and video. In general, the length of each TS packet is 188 bytes, and there is also a 204-byte, which is to add 16 bytes of Rs redundancy check information after each packet. In this case, the 188 bytes are analyzed, and the rest are similar.To i
analyze the first frame of a TS file (SRS supports the TS file generated by HLS protocol)
1. PAT (Ignore)
2. PMT (Ignore)
3. First FRAME (PES Packet)
Usually a frame of data is a PES package. A PES package can typically be split into multiple TS
(often used to ffmpeg to do some video data processing conversion, etc., used to do testing, summed up today, reference to some of the experience of friends on the Internet, together in this summary, there is a need for friends to collect test, there are questions welcome in the following replies exchange, thank you; by Ternence.hsu)
1, FFmpeg use grammar
Command format:ffmpeg-i [input filename] [parameter options]-f [format] [output FILE]ffmpeg [[options]['-i ' input_file]] ...
company is not a live broadcast, then there is no background server, you want to learn about the relevant knowledge and how to do it. Can directly use the TV station RTMP live address: rtmp://live.hkstv.hk.lxdns.com/live/hks rtmp://www.planeta-online.tv:1936/live/channel_4 rtmp ://live.hkstv.hk.lxdns.com/live/hks Hong Kong satellite TV rtmp://221.120.177.59/livestream/ucagm8kk Hong Kong satellite TV boutique Taiwan http:// main.gslb.ku6.com/broadcast/sub?channel=910 Cool six v music RSTP live
stats.# Copy stat.xsl wherever you want# and put the full directory path hereroot/path/to/stat.xsl/;}Location/hls {# Serve HLS FragmentsAlias/var/app;}}}6, installation SegmenterSVN Co http://httpsegmenter.googlecode.com/svn/CD Svn/trunkGcc-wall-g Segmenter.c-o Segmenter-lavformat-lavcodec-lavutil-std=c99CP segmenter/usr/bin/favorably cool download a video file, assumed to be baluobu.flvFind a MP3 file, assumed to be 10year.mp3Mkdir/var/flvs/var/mp4s/var/vc/var/app/var/app/10year/var/app/baluob
MPEGTS format over UDP using 188 sized UDP packets, using a large input buffer:
-i input -f mpegts udp://hostname:port?pkt_size=188buffer_size=65535
Use FFmpeg to receive over UDP from a remote endpoint:
...
FFmpeg forwarding
-i "e:\tt.sdp" -vcodec flv -acodec aac -ab 8000 -f flv rtmp://192.168.0.201:1935/live/stream3
FFmpeg forwarding
-i "vlc.sdp" -vcodec fl
First, installationDownload FFmpeg, configure environment variables after decompression is installed Open the DOS interface and go to the destination folder for example: e:/CD E:\BaiduYunDownload\ffmpeg\ffmpeg_simple_player\ffmpeg_simple_player\ffmpeg_simple_ Player1\res Second, the command parameters Command format: ffmpeg-i [input file name] [parameter options]-f [format] [output FILE] 1. Parameter options: (1)-an: Remove audio (2)-acodec: Audio options, usually followed by copy to indicate co
FFmpeg Analysis of MPEG2 TS Stream decoding process [2]
5. Get betterWell, the previous foundation is nearly enough. It's a bit like a hand-peeled onion. Let's take a look at the aspect of MPEG ts.Resolution Process
The code behind us is mainly concentrated in [libavformat/mpegts. C]. Grandpa Mao said: concentrated strengthWei Jie, well, let's get started, ant's nest.
Static int mpegts_read_header (avformatcontext * s,Avformatparameters * AP){Mpegtsco
INPUT.AVI -vn -acodec pcm_s16le AUDIO.WAV
Produce an AAC file:neroAacEnc.exe -cbr 64000 -he -if AUDIO.WAV -of AUDIO.AAC
Produce the required audio-only MPEG2-Transport stream:ffmpeg.exe -i AUDIO.AAC -vn -f mpegts -acodec copy AUDIO.TS
Go ahead and segment the audio-only MPEG2-Transport stream (this can be done later ):segmenter.exe AUDIO.TS 10 STREAMNAME/AUDIO STREAMNAME/AUDIO.M3U8 http://mydomain.com/virtual/path/to/STREAMNAME/Note that this w
("Mpegts")For example, using FFmpeg to re-mash a h. MP4 file, change the flow to mpegts format, you can use:ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.tsImxdumpFixed to editable bit stream mov format for final Cut Pro decoding. This filter is for Mpeg2video encoding only, and for the following versions of final Cut Pro 7, use the -tag:v optionFor example, re-30mb/sec the NTSC IMX to MOV
FFmpeg using X11grab for screen recording under Linux, using DirectShow filters under WindowsFirst you need to install a software, screen capture recorderThe compilation is:http://sourceforge.net/projects/screencapturer/files/The source address is:Https://github.com/rdp/screen-capture-recorder-to-video-windows-freeAfter the installation is finished, execute at the command line:
Ffmpeg-list_devices true-f dshow-i dummy
The system output is roughly as follows:
[DShow @ 002d
FFmpeg/avconv MPEG2-related transcoding parameters for radio and television
Avconv-I source. ts-R 25-aspect-s 720*576-muxrate 3800 K-C: V mpeg2video-flags ildct + ilme-top 0-B: V 3500 K-minrate: V 3500 K-maxrate: V 3500 K-bufsize 1000 K-streamid 0: 512-C: A MP2-B: A 192 K-streamid-ar 44100-F mpegts-y output. TS
-Muxrate: Repeat the bit rate. The overall bit rate mode is CBR.
-C: V mpeg2video MPEG2 Video Encoding
-Flags ildct + ilme Line Scan
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.