Re: [FFmpeg-devel] TR-03 implementation
2016-11-11 0:24 GMT+03:00 Kieran Kunhya <kierank@obe.tv>:
sure, ffmpeg has support for many pixel formats and adding more pixfmts is not a problem.
my best answer would be to look at commits which add other pixel formats and just follow how they were added to libswscale. make some fate tests, and it should be done.
hopefully you have test samples made of these pixfmts you want to add. that makes testing for us easier, as we can test on multiple cpu arch's to make sure the code is safe and works.
Sorry Compn, nothing personal here, but you are responding exactly in the way I thought you would and why I even wrote that certain people would encourage in spite of the technical issues.
You don't understand the complexity of this problem either. The pixel formats are the least of his problems. Samples don't exist, it's not a file based format, it's a network stream etc. Please listen to what Ros and I said, we worked on this painfully for months.
Regards, Kieran _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Hi all, I very rarely send patches to FFmpeg. Maybe I am the last one in the row to say something about the topic, but I belive it is not good idea to break motivation of contributors even the idea is good or bad or wrong. If someone wants to try, he can give a try, release a patch, it can be discussed in a discussion level. I really find saying such comments like " We don't need more broadcasting shit in ffmpeg." and "....and it is why FFmpeg is full of broken things and has a bad name in the professional world." annoying. Frankly speaking, as my own, I start to think maybe some people try to give intentional directions to FFmpeg. Belive me; Cisco, Ateme, Siemens etc. use FFmpeg in their products and solutions. For me, FFmpeg is great as its contributors. ------------- A part from the topic; there are several useful patches released but not applied yet, such as: https://trac.ffmpeg.org/attachment/ticket/4155/underflow_overflow_fix.diff http://ffmpeg.org/pipermail/ffmpeg-devel/2016-June/194856.html http://ffmpeg.org/pipermail/ffmpeg-devel/2016-November/202587.html I wanted to mention this under contributor's motivation sunbjec, maybe https://patchwork.ffmpeg.org can be used to upload missed patches. Kind Regards, Ali KIZIL
On Sat, Nov 12, 2016 at 8:17 PM, Ali KIZIL <alikizil@gmail.com> wrote:
If someone wants to try, he can give a try, release a patch, it can be discussed in a discussion level. I really find saying such comments like " We don't need more broadcasting shit in ffmpeg." and "....and it is why FFmpeg is full of broken things and has a bad name in the professional world." annoying. Frankly speaking, as my own, I start to think maybe some people try to give intentional directions to FFmpeg.
And rumor has it, want to the broadcasting industry to other products. One of the reasons apparently for not merging the SCTE-35 patch; better never include that in ffmpeg and have the professional use and pay for other products even though an implementation that doesn't break anything at that has been revised 14 times has been posted here. Reason not to merge? None, that just it "doesn't belong to FFmpeg". And trying to merge it is not mature.
On Sun, Nov 13, 2016 at 9:48 AM, Carlos Fernandez Sanz <carlos@ccextractor.org> wrote:
One of the reasons apparently for not merging the SCTE-35 patch; better never include that in ffmpeg and have the professional use and pay for other products even though an implementation that doesn't break anything at that has been revised 14 times has been posted here.
Reason not to merge? None, that just it "doesn't belong to FFmpeg". And trying to merge it is not mature.
Hi, This is completely unrelated to this specific thread, so please take it up there in that thread (and reply to the following parts of this e-mail there, please). Although I remember that the issue with timestamps not being usable yet was one of the largest blockers? The whole thing of "should this be a 'codec' or should it be side data" is IMHO also not insignificant, but if I recall correctly the timestamp ordeal was one of the major reasons for this thing not yet being in. I can recall incorrectly, of course. So you can reply in that thread quoting me if you feel like something's incorrect that I've said. As for this thread, we have already pretty much agreed both on this ML and on IRC that Ros's reply was out of line. He has apologized. The point that people were trying to make is that for the person who is going to be implementing this, the actual pixel format part is the least of one's concerns (not insignificant, but definitely something that can be solved in "one place" with enough SIMD etc). The RTP input module being sub-optimal is the more major issues (among others) - together with the pure amount of data in general that would go through the network - which might require a rework on a much higher level of how the input framework works. And that generally tends to be a much higher hurdle to get over. If someone gets it done properly in the various areas, all the more power to them, but the scope of where the person will most probably have most of their issues should be noted if already known by someone who has done related work. Additionally, depending on the needs of a use case other alternatives (which tend to use parts of FFmpeg for specific things like decoding encoded video or encoding it) such as upipe can be a simpler place to start (due to base design assumptions being different than with libavformat f.ex.). What I most definitely am not seeing is people trying to push others to proprietary solutions. Best regards, Jan
Hi, In november, we wrote on the mailing list about implementing support for TR-03 in ffmpeg [1]. There were some doubts in the ffmpeg community about whether or not ffmpeg could handle demuxing 3gbps of RTP input without significantly modifying the RTP demuxer and/or doing kernel bypassing. CBC/Radio Canada contracted us to test what was possible and to try to implement TR-03 in ffmpeg. Using 2 servers connected by 10gbps fibre optic connection and a switch we performed several tests with various tools which showed that it should be possible to receive and demux 3gbps of RTP raw video with a large enough RX queue in the NIC and the socket. We then patched ffmpeg to support depayloading 8 and 10 bit raw video [2] and process the input stream on a seperate thread [3]. This allowed us to succesfully receive a 3gbps raw video stream in ffmpeg and write the raw video to the disk. We were also able to transcode it into h264. Thus it seems to us that ffmpeg should be able to support TR-03 without significant modifications nor kernel bypassing. Bellow is a more detailed description of our testing and development process: 1. In the Linux Kernel: Thanks to iperf tool, we tested that the Linux kernel is able to handle 3gbps of udp streams with a payload size of 800 to 1450 bytes. 2. Using a simple RTP demuxer, we ensured that a user space program is able to handle a 3gbps stream without dropping packets. When adding an increasing amount of processing per packet, we observed that eventually packets are dropped. We concluded that minimal processing per packet should be used to achieve the reception of 3 gbps video stream. 3. We played with Gstreamer which already implements an RTP raw video muxer / demuxer. We were able to send a 3gbps video stream without dropping any packets. In reception, we experienced around 20% packet drop with 3gbps video stream because the thread in charge of socket reading is taking 100% CPU. Gstreamer team is aware of that and have ideas to reduce significantly the CPU usage grouping the processing per packet with the recvmmsg syscall 4. We implement an RTP demuxer compatible with RFC 4175 and pixel format 422-8bits and 422-10bits [2] * Checking FFmpeg tool code, we saw that a separate input thread(s) is used only if there is more than one input. With a minimal pipeline which reads an RTP stream from a socket and writes the raw video into a file, we observed that packets were dropped because too much time was used for packet processing. We modified FFmpeg tool to force the use of a dedicated input thread. 5. Several queues are used from packet reception to packet processing. Tunning each queue allowed us to have zero packet dropped: * In the NIC queue: thanks to ethtool, we increased the queue size from 453 to its maximum (4078) to avoid packet dropped in the NIC queue * In the Kernel queue: we observed no packet dropped after increasing the queue size to 16 mo * In the jitter buffer queue (FFmpeg): By default the jitter buffer is sized for 500 packets. With 1080P raw videos (RFC4175), we calculated that a video frame would lead to around 3000 packets. To be more resilient to packets reordering, we could increase the size of the jitter buffer but we observed that using a big jitter buffer, a significant processing per packet is added and lead thus to packet dropped in the Kernel. In addition, RFC4175 adds a mechanism to be resiliant to packet reordering per video frame. Results: * With : - our test setup composed of 2 servers running Centos 7 linked by a 10gbps switch. - our modified FFmpeg to handle RFC4175 and to improve the reading performance, - NIC and Kernel queues tunned and FFmpeg jitter buffer disabled we were able to: - send a 3 gbps video stream with gstreamer - receive with FFmpeg a 3 gbps video stream 422-8 bits without dropping any packets nor having any video artifacts. * However, using pixel format 4.2.2 10bits (packed), we encountered a performance degradation. Indeed 4.2.2 10bits (packed) is not supported in FFmpeg. We decided to convert into a 4.2.2 10bits planar format. We believe that this conversion adds too much processing per packets and thus leads to packets dropped. We are able to stream (and live transcode) 1080p 60fps 42210-bits without dropping packets. In reception the bandwidth is around 2.2 gbps. [1]: http://ffmpeg.org/pipermail/ffmpeg-devel/2016-November/202554.html [2]: http://ffmpeg.org/pipermail/ffmpeg-devel/2017-February/207253.html
participants (4)
-
Ali KIZIL -
Carlos Fernandez Sanz -
Jan Ekstrom -
Éloi Bail