mirror of git://source.ffmpeg.org/ffmpeg.git
Clone or download
Pull request Compare This branch is 9 commits ahead, 1267 commits behind FFmpeg:master.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.cqfd ci, doc: add cqfd support Nov 23, 2018
compat compat: remove in-tree NVidia headers Feb 27, 2018
doc avcodec: add side data type for ancillary Jul 9, 2018
ffbuild Merge commit '17b6c7efb471e8ff1b8a7271f6531ba1d52bf69c' Nov 12, 2017
fftools ffmpeg: force input threading Nov 23, 2018
libavcodec avcodec/bitpacked: add interlace support Jul 9, 2018
libavdevice avdevice/v4l2enc: add video4linux2 name alias Jun 19, 2018
libavfilter lavfi/minterpolate: fix blending calc issue. Jul 8, 2018
libavformat avformat/rtp: compute smpte2110 timestamps Nov 23, 2018
libavresample avresample: remove deprecated attribute from the AVAudioResampleConte… Jan 9, 2018
libavutil avutil/smpte2110: add helpers to compute PTS Nov 23, 2018
libpostproc Bump minor versions after release/4.0 branching Apr 16, 2018
libswresample swresample/arm: rename labels to fix xcode build error Apr 28, 2018
libswscale lsws/rgb2rgb_template: Do not compile unneeded shuffle functions on b… Jun 10, 2018
presets presets: remove moldering iPod presets Jun 18, 2014
tests tests/fate/demux: Add test for d25c945 Jul 7, 2018
tools tools/target_dec_fuzzer: set parser codec id to avoid assertion failure Jul 7, 2018
.cqfdrc ci, doc: add cqfd support Nov 23, 2018
.gitattributes fate: add SCC test Jan 27, 2017
.gitignore Remove the ffserver program Jan 6, 2018
.travis.yml Merge commit '4809781586d1c956005f72946a2aab5915eab350' Oct 28, 2017
CONTRIBUTING.md Add CONTRIBUTING.md Sep 18, 2016
COPYING.GPLv2 Rename COPYING.GPL --> COPYING.GPLv2 and COPYING.LGPL --> COPYING.LGP… Jun 5, 2009
COPYING.GPLv3 Add configure option to upgrade (L)GPL to version 3. Jun 5, 2009
COPYING.LGPLv2.1 cosmetics: Delete empty lines at end of file. Feb 9, 2012
COPYING.LGPLv3 Add configure option to upgrade (L)GPL to version 3. Jun 5, 2009
CREDITS CREDITS: redirect to Git log, remove current outdated content Jan 31, 2013
Changelog lavc: implement an ATRAC9 decoder Jul 3, 2018
INSTALL.md INSTALL: add markdown syntax May 28, 2014
LICENSE.md Merge commit '4fef648d10bf3bcfd4b8fa5755c1128966a2427c' Mar 15, 2017
MAINTAINERS MAINTAINERS: add myself to qsv section Jun 7, 2018
Makefile Revert "lavd: add new API for iterating input and output devices" Mar 31, 2018
README.md doc: change README for SMPTE2110 transcoding Nov 23, 2018
RELEASE RELEASE: update for git after 3.4 branchpoint Oct 11, 2017
build-ffmpeg.sh ci, doc: add cqfd support Nov 23, 2018
configure configure: toolchain-tsan does not need -fPIE. Jul 5, 2018

README.md

FFmpeg for SMPTE ST 2110

FFmpeg is a collection of libraries and tools to process multimedia content such as audio, video, subtitles and related metadata. This fork intents to support SMPTE ST 2110 for the broadcast industry where the SDI-to-IP transition is in progress and where fully virtualized solutions are being evaluated.

The primary goal is to decode a large format uncompressed video signal (SMPTE ST 2110-20) along with raw audio (SMPTE ST 2110-30); the stream synchronization being based on PTP (SMPTE ST 2110-10). After the AV content is reconstructed, FFmpeg re-encodes the signal for storage or streaming. The project also aims at evaluating the limitation in terms of bandwidth, especially when additional streams are provided.

Supported standards

  • RFC 4175 for YCbCr-4:2:2, 8-bit and 10-bit
  • AES67

Install

Transcoding dependencies

  • x264
  • faac
  • yasm

Build

./configure \
	--extra-libs=-ldl \
	--enable-version3 --enable-gpl --enable-nonfree \
	--enable-small \
	--enable-postproc --enable-avresample \
	--enable-libfdk-aac --enable-libx264 \
	--disable-ffplay --disable-ffprobe --disable-ffserver \
	--disable-stripping --disable-debug
make
./ffmpeg -version

Simple A/V test

The following diagram shows a basic setup composed by 3 elements connected on a LAN:

+-----------------------+            +-------------------+              +-----------+
| Source:               |            | Transcoder:       |              | Monitor:  |
| generate rtp streams  |-- video -->| depacketize,      |   h264       |           |
| conformed to RFC 4175 |            | reconstruct,      |-- mpeg-ts -->| playback  |
| and AES67             |-- audio -->| encode and stream |              |           |
+-----------------------+            +-------------------+              +-----------+

Since the transcoder is likely to run on a dedicated headless host, there is no graphic to monitor the A/V content directly. So the transcoded video is streamed to an extenal host.

Source

If no source available, gstreamer can generate adequate streams. The following command:

  • generates a video raw signal, 4:2:2 8-bit
  • assembles a udp payload of type 102
  • streams to multicast @ 239.0.0.0:5005
  • generates an audio raw signal, 24-bit linear, 2 channels
  • assembles a udp payload of type 103
  • streams to multicast @ 239.0.0.0:5007
gst-launch-1.0 rtpbin name=rtpbin \
	videotestsrc horizontal-speed=2 !  \
	video/x-raw,width=1920,height=1080,framerate=30/1,format=UYVP ! rtpvrawpay pt=102 ! queue ! \
	rtpbin.send_rtp_sink_0 rtpbin.send_rtp_src_0 ! queue ! \
	udpsink host=239.0.0.0 port=5005 render-delay=0 rtpbin.send_rtcp_src_0 ! \
	udpsink host=239.0.0.0 port=5005 sync=false async=false \
	audiotestsrc ! audioresample ! audioconvert ! \
	rtpL24pay ! application/x-rtp, pt=103, payload=103, clock-rate=48000, channels=2 ! \
	rtpbin.send_rtp_sink_1 rtpbin.send_rtp_src_1 ! \
	udpsink host=239.0.0.0 port=5007 render-delay=0 rtpbin.send_rtcp_src_1 ! \
	udpsink host=239.0.0.0 port=5007 sync=false async=false

Transcoder

Copy RTP session description to new test.sdp file:

# session
v=0
o=- 123456 11 IN IP4 X.X.X.X
s=A simple SMPTE ST 2110 session
i=basic streams for audio video
a=recvonly

# timing: unbounded and permanent session
t=0 0

# audio description first for better results
m=audio 5007 RTP/AVP 103
c=IN IP4 239.0.0.0/4
a=rtpmap:103 L24/48000/2

# video description
m=video 5005 RTP/AVP 102
c=IN IP4 239.0.0.0/4
a=rtpmap:102 raw/90000
a=fmtp:102 sampling=YCbCr-4:2:2; width=1920; height=1080; depth=10; colorimetry=BT.709

Run ffmpeg transcoder:

./ffmpeg -strict experimental -buffer_size 671088640 \
	-protocol_whitelist 'file,udp,rtp' \
	-i test.sdp -fifo_size 1000000000 -smpte2110_timestamp 1 \
	-c:a libfdk_aac -c:v libx264 -pass 1 \
	-f mpegts udp://<monitor IP>:<monitor port>

Monitor

vlc udp://<monitor IP>:<monitor port>

or

ffplay udp://<monitor IP>:<monitor port>

For 8-bit pixel format

Replace format=UYVP with format=UYVV in the gstreamer command line and depth=10 with depth=8 in the SDP file.

Transcoding performance

If your host struggles while transcoding the stream, you can still:

  • enable multi-threading
  • downsize the image right after the decoding
  • decrease the quality of the h264 output
./ffmpeg -strict experimental \
	-buffer_size 671088640 \
	-threads 4 \
	-protocol_whitelist 'file,udp,rtp' \
	-i test.sdp -fifo_size 1000000000 \
	-vf scale=640:480 \
	-c:v libx264 -preset ultrafast -pass 1 \
	-c:a libfdk_aac -ac 2 \
	-f mpegts udp://<monitor IP>:<monitor port>

Network performance

On the NIC side, one can increase the number of entries in the rx ring buffer. Get the maximum supported value and set it using ethtool:

ethtool -g <iface name>
ethtool -G <iface name> rx <max rx ring entries>

In the kernel, the receive socket buffer size is dynamically adjusted and the maximum value (in bytes) can be adjusted depending on the available memory:

echo 33554432 > /proc/sys/net/core/rmem_max

Do the same for the max number of packets in the receive queue:

echo 10000 > /proc/sys/net/core/netdev_max_backlog

FFmpeg Documentation

Online documentation is available in the main website and in the wiki.

License

FFmpeg codebase and this derived work are mainly LGPL-licensed with optional components licensed under GPL. Please refer to the LICENSE file for detailed information.

Contributing

Patches should be submitted using Github pull requests.