We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

James Churchill • 9 years ago

I've finally gotten around to playing with my UT100C and OpenCaster, and I think it might be possible to remove ffmpeg from the path entirely. If we can get the raspi h.264 video encapsulated in a PES stream, then the OpenCaster tools can take that and wrap it into mpegts pretty easily.

Analyzing the h264 video with the tool from http://sourceforge.net/proj... shows it to be fairly simple in structure - one SPS NAL unit, one PPS NALU, one I-frame NALU, then 30-ish P-frame NALU's. It's ill-defined how to wrap that into PES packets, but https://mailman.videolan.or... suggests packing one frame per PES packet (which - for the raspivid output - is always just one NAL unit plus the preceding SPS/PPS packets when present) and describes which PES header fields need to be updated.

So I'm about to give it a stab :)

- James VK4CPC

Alexandru Csete • 9 years ago

Hi James,

That sounds like a great idea and certainly worth trying. I hope you take a stab at it and share your results :-)
In any case, thanks for the info!

James Churchill • 9 years ago

https://github.com/pelrun/e...

I've got it to the point where it doesn't crash, yay :) The output seems to be a valid PES stream, but I haven't fully muxed it up to a TS yet.

Alexandru Csete • 9 years ago

That's great news James! Looking forward to trying it soon.

James Churchill • 9 years ago

There's a test script in the repo, it does successfully transmit the raspivid video over dvb-t (works even better once I stopped trying to put 6Mbit down a 5.8Mbit channel!) There's still significant latency somewhere in there, but that might be on my receiver side.

Alexandru Csete • 9 years ago

I'm quite sure there is latency in linux-dvb driver, though I'm not sure how much. I wil ltry to test it with a low latency DATV Express setup.

Vinson • 9 years ago

This guy is really a genius! I've been looking for Raspberry prototyping and I've seen used as a smartphone, robotics, car audio player and this time a live HDTV transmitter. Look how these machines contributes to our day to day lives. I only use my raspberry pi model b for media streaming and downloading.

ali • 7 years ago

hi
can i transmit video with this in high range??? i mean the distance like 9 or 10 km ???

Montilien • 7 years ago

Hi,
very good work....
but have you never think to "turn your Raspberry Pi into a DVB-T repeater" using the full duplex UT-100B Hides dongle?

purplesky • 9 years ago

I don't think ffmpeg is adding that much delay. I suspect most of the latency issues are due in part by the transmission parameters, bandwidth, bit rate, symbol rate etc. I also think the UT-100C will add further latency.

Dimitri • 9 years ago

Hello alex, try to use the VK4CPC esvideorpi2pes but some mistakes when I try to run the file broadcast.sh !
pi@raspberrypi ~/esvideorpi2pes/rpi-test $ ./broadcast.sh
Traceback (most recent call last):
File "./psi-config.py", line 22, in <module>
from dvbobjects.PSI.PAT import *
ImportError: No module named dvbobjects.PSI.PAT

Open /dev/usb-it950x0 ok
g_ITEAPI_TxDeviceInit ok
2 Devices
frame rate is 25
can't find file ts/pat.ts
g_ITEAPI_GetDrvInfo ok
DriverInfo.DriverVerion = v14.06.06.1
DriverInfo.APIVerion = 1.3.20131217.0
DriverInfo.FWVerionLink = 255.39.2.0
DriverInfo.FWVerionOFDM = 255.9.11.0
DriverInfo.Company = ITEtech
DriverInfo.SupportHWInfo = Eagle DVBT
DriverInfo.ProductID = 0x9507
vbv size in bit is 1835008
Frequency = 446500 KHz
Bandwidth = 7000 MHz
Constellation: QPSK
Code Rate: 2/3
Interval: 1/4
Transmission Mode: 8K
Channel Capacity is 5805675 bps
MinGain: -52, MaxGain: 6
ts sent done
pi@raspberrypi ~/esvideorpi2pes/rpi-test $

perphaps a difference between me and james in tree structure ?
did some tested it and succeeded to use it ?
I send him a email but no answer ...
regards.
Dimitri.

James Churchill • 9 years ago

Apologies for not getting back to you!

> ImportError: No module named dvbobjects.PSI.PAT

You haven't installed the python libs that come with OpenCaster; they're used to generate the program information tables that are muxed into the stream - those are the *.sec files you're getting 'No such file' errors for.

Dimitri • 9 years ago

Hello james, I finally managed to run the broadcast.sh with no error (thanks to Evariste) F5OEO) took control of my RPI and the errors have been corrected. However I didn't find any change : I've got exactly the same delay as ffmpeg +/- 10 secs. Perhaps the problem comes from another thing...

73's Dimitri - F5SWB

Dimitri • 9 years ago

hello, some errors corrected, but it's a long way to succeed,

the last errors :
pi@raspberrypi ~/esvideorpi2pes/rpi-test $ ./broadcast.sh
No more sections
sh: 1: cannot open sec/pat.sec: No such file
sh: 1: cannot open sec/sdt.sec: No such file
sh: 1: cannot open sec/pmt.sec: No such file

I will survive !
73's dimitri.

Dimitri • 9 years ago

Hello,
did someone succeed to lower the latency or is there another way to bypass FFMPEG or something else ?
In my case I have got about 10 secs of delay ....
Here's my start file :
raspivid -n -b 1650000 -t 0 -fps 25 -g 90 -pf high -ih -o
videoES & ffmpeg -loglevel debug -analyzeduration 0 - probesize 100000 -fpsprobesize 0 -i videoES -f h264 -r 25 -minrate 600K -maxrate 650K -vcodec copy -f
mpegts -mpegts_original_network_id 1 -mpegts_transport_stream_id 1
-mpegts_service_id 1 -mpegts_pmt_start_pid 0x1500 -mpegts_start_pid
0x110 -metadata service_provider="F5SWB" -metadata
service_name="F5SWB-DVBT" -muxrate 1843000 -y videoTS & tsrfsend
videoTS 0 437000 2000 4 2/3 1/8 2 0 0

Any help will be greatly appreciated ;)
Regards.
F5SWB/Dimitri.

Alexandru Csete • 9 years ago

Aside from mismatch in your bitrates (raspivid:1.6M ffmpeg:650k) you can try the option mentioned by James VK4CPC (featured comment in the top)

Dimitri • 9 years ago

ok alex for the bitrate but which option mentionned are you talking about ?
I think James gave some future area but I need a brief explanation and how to proceed...
73's Dimitri.

Alexandru Csete • 9 years ago

Ok, sorry, it is in one of the followup comments, see here:
https://github.com/pelrun/e...

I have not tried it myself yet so I can not help right now, but at some point I will resume this project.

Dimitri • 9 years ago

ok I will try this and I will tell you soon if I succeed in this area !
Many thanks for your help.

Pawel Tutka • 9 years ago

How to install OpenCaster on Raspbian?

Alexandru Csete • 9 years ago

There is a "Makefile" in each subdirectory so you just type make for a particular utility.

Justin Kelly • 9 years ago

the ability to encapsulate tcp/ip traffic in the video stream would be useful for sending telemetry, or internet traffic when used with bidirectional video links.

Alexandru Csete • 9 years ago

I don't see why you need TCP/IP for transmitting telemetry or any other data. TCP requires a connection and this is a one way transmission.

If you read the DVB and MPEG-TS standards you will see that there are plenty of ways for including arbitrary data and that can be used for telemetry.

cyberdog • 9 years ago

Sounds very interesting.... Did you measure latency by any chance to evaluate whether this could be used for FPV flying ?

Nils Högberg • 9 years ago

Very interesting stuff!
I've been thinking of buying the UT-100 for a project I'm working on.
What amp are you using for this setup?

Alexandru Csete • 9 years ago

I don't have much info about the amplifier. A simple MMIC-based amplifier with 20 dB gain made by a friend.

choc • 9 years ago

Can i use this to broadcast a python game that starts up on boot and have it automatically start sending the screen to the hdtvs in the house?

F5OEO • 9 years ago

Great update Alex..I looked at the delay adn it seems that it is the LibAvFormat which takes time to get the right format (H264), but since it analyze it, the stream is buffered : thus it includes a delay. Solutions could be : modifying libavformat to fix the H264 format OR when removing 5 seconds of Transport stream before sending to the modulator.
Could you publish the modified RTL2832 driver for 1,2 GHZ ? I wonder also if it could be possible to receive a 2MHZ bandwidth with a modified version ?

Evariste F5OEO

Alexandru Csete • 9 years ago

Hello Evariste,

I have been looking into the latency issue over the weekend and I found a few ffmpeg/avformat options in this context: analyzeduration and probesize, see http://ffmpeg.org/ffmpeg-al... . Reducing them to around 300000 and ffmpeg starts streaming much faster. Still, I have several seconds of latency in the complete pipeline. I am using dvblast and/or vlc on the receiver side and perhaps trying with a regular TV would be interesting. Perhaps latency would be further decreased when using higher symbol rates.

Concerning the driver, I'll post my notes soon. If the modified driver sources are sufficient for you then I can send them to you be email before that. Note that the drivers in Linux 3.15 should have this modification included for the R820T tuner.

F5OEO • 9 years ago

I also played with analyzeduration and probesize, it speed the start but in some cases it failed because libavformat doesn't succeed in finding the right format. Don't know if it is really a valuable way !
About R820T modified driver, if the drivers are already on 3.15 kernel it is fine : right now I don't have internet connectivity to upgrade my kernel. Any idea for special 2MHZ mode used by hides (and DATVExpress) ?

Alexandru Csete • 9 years ago

According to the datasheet the RTL2832U only supports 6, 7 and 8 MHz.

p0ns • 9 years ago

Man, this is totally awesome. I'd recommend you try python with gobject/gstreamer for the stream wrapping, also remember that the Raspi has an h.264 encoder/decoder in hardware. I've successfully used this to grab mjpeg usb webcameras and convert to h.264. There's plenty you can do.

Again, nice project!

Guest • 9 years ago
Alexandru Csete • 9 years ago

Currently, ffmpeg adds ~5 second latency and as I wrote in the post we are working on this. I don't think the rest of the system adds any significant latency, though I haven't measured.

Dennis C • 9 years ago

what is the range of the transmission ?

Alexandru Csete • 9 years ago

It's hard to tell because it depends on many factors (bitrate, power, antennas, signal "purity", receiver performance). For the setup I used with 20 dBm power into a WA5VJB PCB yagi (6 dBi) and a ~10 dBi log periodic antenna for the receiver I would expect a few kilometers.

Matej • 9 years ago

Great article!
Can UT-100C be used for DVB-C (cable) transmission too?
If not, do you know if there is a product for it?

Alexandru Csete • 9 years ago

No, the chip used in the UT-100C monly supports DVB-T. While there are many DVB-C modulators on ythe market I don't know of any at similar size and price (haven't really looked though).

Depending on your intended usage you could perhaps just send DVB-T over the cable? I would expect most consumer receivers that saupport DVB-C to also support DVB-T.

packetshepard • 9 years ago

Have you considered trying vlc for the remux? This might get your delay down to a reasonable number. Another idea: why not use an USB HD cam that outputs in a DVB-T compliant stream like MPEG-TS already?

Alexandru Csete • 9 years ago

I don't know if VLC can produce MPEG-TS suitable for broadcasting. You can try and let me know ;-)
I don't know of any USB webcam that can give MPEG-TS stream. Do you know any?

packetshepard • 9 years ago

I see. I thought it might be something you could test quickly. A binary is supposed to be available for vlc through apt-get. I don't have any of the equipment on hand, so that could be awhile. To be honest unless the latency can be minimized to around 200 ms, I probably won't bother.

I was thinking some MPEG2 encodes may do this, but that may bottleneck the bus at 720p. I know of a few network UDP streamer cams that push MPEG-TS over ethernet, but it's probably VBR and too bulky for UAV. I'll try to do some searches for USB MPEG-TS cams.

Nathan • 9 years ago

MPEG2TS payload is added to UVC 1.5 specs but I am not aware of any webcam implementing it. Logitech 930e seems to be UVC 1.5 webcam

fernando • 7 years ago

there is something for use with ISDB-T