Code Monkey home page Code Monkey logo

odr-padenc's Introduction

ODR-PadEnc

ODR-PadEnc is an encoder for Programme Associated Data (PAD) and includes support for:

  • MOT Slideshow (including catSLS), according to ETSI EN 301 234 and TS 101 499
  • DLS (including DL Plus), according to ETSI EN 300 401 and TS 102 980

To encode DLS and Slideshow data, the odr-padenc tool reads images from a folder and DLS text from a file, and generates the PAD data for the encoder.

For detailed usage, see the usage screen of the tool with the -h option.

More information is available on the Opendigitalradio wiki

How to build

Requirements:

  • a C++11 compiler
  • ImageMagick MagickWand (optional, for MOT Slideshow), version 6 (legacy) or 7

To install MagickWand on Debian or Ubuntu:

sudo apt-get install libmagickwand-dev

To compile and install ODR-PadEnc:

./bootstrap
./configure
make
sudo make install

ImageMagick and Debian Jessie/Ubuntu 16.04

Please note that Debian Jessie and Ubuntu 16.04 shipped a version of ImageMagick that was affected by two memory leaks (see #2, and also Ubuntu's #1671630 and #1680543). Hence ODR-PadEnc increasingly consumed memory until it crashed.

This has been fixed with the following package versions:

  • Debian Jessie: 8:6.8.9.9-5+deb8u9
  • Ubuntu 16.04: 8:6.8.9.9-7ubuntu5.7

Usage of MOT Slideshow and DLS

odr-padenc reads images from the specified folder, and generates the PAD data for the encoder. This is communicated through a socket to the encoder. It also reads DLS from a file, and includes this information in the PAD.

If ImageMagick is available

It can read all file formats supported by ImageMagick, and by default resizes them to 320x240 pixels, and compresses them as JPEG. If the input file is already a JPEG file of the correct size, and smaller than 50kB, it is sent without further compression. If the input file is a PNG that satisfies the same criteria, it is transmitted as PNG without any recompression.

RAW Format

If ImageMagick is not compiled in, or when enabled with the -R option, the images are not modified, and are transmitted as-is. Use this if you can guarantee that the generated files are smaller than 50kB and not larger than 320x240 pixels. Files whose name end in _PadEncRawMode.png or _PadEncRawMode.jpg will always be transmitted in RAW mode. It may be useful to apply optipng to any PNG file prior to transmission.

Supported Encoders

odr-audioenc and odr-sourcecompanion can insert the PAD data from odr-padenc into the bitstream.

This is an ongoing development. Only some PAD lengths are supported, please see odr-padenc's help.

ODR-PadEnc v2 is compatible with ODR-AudioEnc v2 and ODR-SourceCompanion v0.x, and uses a fifo to communicate between the tools.

ODR-PadEnc v3 replaced the fifo with a socket and is compatible with ODR-AudioEnc v3 and ODR-SourceCompanion v1.

Character Sets

When odr-padenc is launched with the default character set options, it assumes that the DLS text in the file is encoded in UTF-8, and will convert it according to the DAB standard to the Complete EBU Latin based repertoire character set encoding.

If you set the character set encoding to any other setting (except Complete EBU Latin based repertoire which needs no conversion), odr-padenc will abort, as it does not support any other conversion than from UTF-8 to Complete EBU Latin based repertoire.

You can however use the -C option to transmit the untouched DLS text. In this case, it is your responsibility to ensure the encoding is valid. For instance, if your data is already encoded in Complete EBU Latin based repertoire, you must specify both --charset=0 and --raw-dls.

Known Limitations

Some receivers are unable to decode slides larger than some size, even within the allowed size limit given in the specification.

Thanks

This encoder was initially called mot-encoder and has been contributed by CSP.

odr-padenc's People

Contributors

anatol avatar basicmaster avatar flameeyes avatar mpbraendli avatar mstorsjo avatar spoeschel avatar tkarls avatar vieenrose avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

odr-padenc's Issues

odr-padenc hangs

freshly compiled from master:

ODR-PadEnc (master) # echo test > dls.txt
ODR-PadEnc (master) # ./odr-padenc -v -r -t ./dls.txt -o ./init.pad -s 1 -l 5
ODR-PadEnc v3.0.0 - DAB PAD encoder for MOT Slideshow and DLS

By CSP Innovazione nelle ICT s.c.a r.l. (http://rd.csp.it/) and
Opendigitalradio.org

Reads image data from the specified directory, DLS text from a file,
and outputs PAD data to the given FIFO.
  https://opendigitalradio.org

ODR-PadEnc encoding DLS from './dls.txt' to './init.pad'. No Slideshow.
ODR-PadEnc using charset UTF-8 (15)
ODR-PadEnc converting DLS texts to Complete EBU Latin
ODR-PadEnc using ImageMagick version 'ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25 https://imagemagick.org'
[... and then hangs here forever]

what could cause this hang?
With a (much) older version of odr-padenc (on a different system) this worked fine.

(and another issue I found - if I specify -o /tmp/foo.pad a socket is tried to be created with the name /tmp/tmp/foo.pad which of course fails)

Not compatible with MagickWand 7.05?

I make it compile by doing:

In sls.h :

include <wand/magick_wand.h> => # include <MagickWand/MagickWand.h>

In sls.cpp:

MagickResizeImage(m_wand, width, height, LanczosFilter,1) => MagickResizeImage(m_wand, width, height, LanczosFilter)

Otherwise, it will throw a fatal error...

Hopefully that's the fix, not sure... Please look into it if you get a chance, thank you!

Memory leak

I have found out a memory leak in ODR-PadEnc 2.1.0.

screen shot 2017-03-07 at 19 00 45

I have a multiplexer where I run 3 instances of odr-padenc.

They are executed as the following

/usr/local/bin/odr-padenc -t /home/app/metadata/radio/dls.txt -o /home/app/metadata/radio/pad.fifo --pad=58 --charset=15 --dir=/home/app/metadata/radio/images --sleep=30

/home/app/metadata/radio/images contains only one PNG image and is not updated.

I have noticed that at some point I stopped having log messages from padenc but process keeps running.

When I did cat /home/app/metadata/radio/pad.fifo there were some data (+/- 2 screens on terminal).

Slideshow is not displayed on DAB+ radios

Hi,

I am using odr-padenc to create a stream for dls and slideshow like this:

odr-padenc -v -r -p 196 -t dls.txt -o /tmp/dls.fifo -s 2 -d /opt/resources/images

The images directory contains several pictures. odr-padenc is compiled with magickwand.
When running the command I see from the output messages that it creates a stream that writes the text and rotates through the images in the images directory.

In dabmux I combine that stream with a dabp from audioenc and then send it via dabmod.

The music can be heard, the DLS text is visible - but no images are displayed on either (2 different) dab+ radio. both are able to display slideshow images (as tested with other stations).

so - is this feature broken?

MagickWand not recognized in ARM64 version

The ARM64 version of ODR-PadEnc doesn't seem to recognize MagickWand. When I install libmagickwand-dev with apt and install ODR-PadEnc using the .deb packages after that, it works on a AMD 64bit cpu:

x86_64

ODR-PadEnc encoding Slideshow from '/var/dab/stations/zuidwest/slideshow' and DLS from '/var/dab/stations/zuidwest/metadata/dls.txt' to 'zuidwest_pad'
ODR-PadEnc using charset UTF-8 (15)
ODR-PadEnc converting DLS texts to Complete EBU Latin
ODR-PadEnc Reinitialise PAD length to 6

But the identical procedure on an Ampere Altra cpu leads to this error:

ARM64

ODR-PadEnc encoding Slideshow from '/var/dab/stations/zuidwest/slideshow' and DLS from '/var/dab/stations/zuidwest/metadata/dls.txt' to 'zuidwest_pad'
ODR-PadEnc using charset UTF-8 (15)
ODR-PadEnc converting DLS texts to Complete EBU Latin
ODR-PadEnc Reinitialise PAD length to 6
ODR-PadEnc has not been compiled with MagickWand, only RAW slides are supported!
ODR-PadEnc Error: cannot encode file '/var/dab/stations/zuidwest/slideshow/logo.png'; giving up for now
ODR-PadEnc has not been compiled with MagickWand, only RAW slides are supported!

This is on Debian 12. Used Hetzner Cloud as server platform.

Don't delay DLS transmission on overlap

I'm trying to optimize the transmission of PAD data: my goal is to stay in the 6 bytes, because sound quality is more important to me than logo visualization speed, but I'd still like to give users a nice experience.

So far I've reached a nice situation by using a small logo, that can be transmitted in about 90 seconds. I've seen that, with such a low bandwidth, even the frequency of the DLS transmission (label_insertion) has a great impact. I tried setting it to 5, or 10 seconds, and the slide transmission time decreases significantly.

I can accept the fact that the user will need to wait a few seconds before he sees the current title, but I'd prefer to update it in nearly real time when the song changes, so I'm writing a .REQUEST_DLS_REREAD file every time the song changes, and it works like a charm, except for a weird behavior.

Sometimes (more frequently than I would estimate, actually) my title update comes while a DLS is already transmitting, so I see the ODR-PadEnc Warning: skipping label insertion, as previous one still in transmission! warning message, which is totally fine. However, this delays the new title trasmission for the entire label_insertion time, and this is something that I wouldn't expect. Instead, I'd expect that, if this happens, the new label is transmitted just after the previous one ended transmission. I made a change for this and I'm testing it since a few weeks: it seems to run as I expect.

It should probably be the same logic for slides, but this is more borderline as an error in setting --sleep would result in an endless transmission loop, as if the parameter was set to 0. But for small payloads like the DLS, I think it makes sense.

Support insertion of MOT Datagroups to X-PAD

DAB Service and Programme Information (SPI - formerly EPG) can be used to transport station logos to the receiver. An open-source project exists now that outputs MOT Datagroups segmented to Packet Data for inclusion into a Packet Mode Data channel. (https://github.com/magicbadger/odr-radioepg-bridge).

Some radio stations would like to use DAB SPI, but have to do so within their own X-PAD capacities and cannot / are not allowed to participate in a shared packet data channel EPG service.

If the radioepg code is adapted to output MOT Datagroups to a file, could odr-padenc be adapted to import those Datagroups, segment them and include them in the X-PAD stream, similarly to MOT Slideshow?

DAB SPI has User Application Type 0x07, and consists of multiple MOT Datagroups representing multiple files (and an MOT Directory), but is otherwise identical to MOT Slideshow.

APNG

Does ODR-PadEnc support APNG files?

compilation error

I have compilation error without magickwand or I don't know how to do that.

Clarify the meaning of the value 0 for the sleep parameter

Setting the --sleep parameter to 0 transmits the next slide after the previous one ended transmission, as I discovered by trying it and, then, in the wiki I didn't read carefully. This behaviour actually really makes sense for all the radio stations that only transmit their logo, and I think it should be explained inside the help screen. PR is following.

PadEnc did not rotate through the images in the images directory.

System:

ARM 64
Linux-Kernel : 5.4.36-rockchip64
ODR-PadEnc: v2.3.0-17-g11767aa
ImageMagick: 6.9.10-23 Q16 aarch64 20190101

After starting the ODR-PadEnc in a shell the first image in the images directory , if it is one in it, will encoded.

odr-padenc -v -d ./Pic1 -t ./1_prog_dls_in.fifo -o ./1_prog_pad.fifo -e

But every new image in the folder not. Breaking ODR-PadEnc with [CTRL]-[C] is impossible too. Any idea, DLS seems to work. What's wrong ?

ODR-PadEnc v2.3.0-17-g11767aa - DAB PAD encoder for MOT Slideshow and DLS

By CSP Innovazione nelle ICT s.c.a r.l. (http://rd.csp.it/) and
Opendigitalradio.org

Reads image data from the specified directory, DLS text from a file,
and outputs PAD data to the given FIFO.
https://opendigitalradio.org

ODR-PadEnc encoding Slideshow from 'Pic1' and DLS from './1_prog_dls_in.fifo' to './1_prog_pad.fifo' (PAD length: 58)
ODR-PadEnc using charset UTF-8 (15)
ODR-PadEnc converting DLS texts to Complete EBU Latin
ODR-PadEnc using burst PAD encoder
ODR-PadEnc using ImageMagick version 'ImageMagick 6.9.10-23 Q16 aarch64 20190101 https://imagemagick.org'
^C...ODR-PadEnc exits...

Thanks.

Martin

Image smaller than recommended size while it's not

I have this weird issue where ODR-PadEnc always logs that the file is smaller than recommended size, but it's not.

ODR-PadEnc encoding Slideshow from '/var/dab/slides/zwfm' and DLS from '/var/dab/zwfm.txt' to 'zwmf_pad'
ODR-PadEnc using charset UTF-8 (15)
ODR-PadEnc converting DLS texts to Complete EBU Latin
ODR-PadEnc Reinitialise PAD length to 6
ODR-PadEnc Warning: Image '/var/dab/slides/zwfm/2.jpg' smaller than recommended size (240 x 240 < 320 x 240 px)

This is with Debian 12 on ARM64. Here are the properties of the file.

root@dab2:/var/dab/slides/zwfm# identify -verbose 2.jpg 
Image:
  Filename: 2.jpg
  Format: JPEG (Joint Photographic Experts Group JFIF format)
  Mime type: image/jpeg
  Class: DirectClass
  Geometry: 423x423+0+0
  Resolution: 72x72
  Print size: 5.875x5.875
  Units: PixelsPerInch
  Colorspace: sRGB
  Type: TrueColor
  Base type: Undefined
  Endianness: Undefined
  Depth: 8-bit
  Properties:
    date:create: 2024-03-17T17:46:45+00:00
    date:modify: 2024-03-17T17:46:45+00:00
    exif:ColorSpace: 1
    exif:ComponentsConfiguration: 1, 2, 3, 0
    exif:ExifOffset: 102
    exif:ExifVersion: 48, 50, 50, 49
    exif:FlashPixVersion: 48, 49, 48, 48
    exif:PixelXDimension: 423
    exif:PixelYDimension: 423
    exif:SceneCaptureType: 0
    exif:YCbCrPositioning: 1
    jpeg:colorspace: 2
    jpeg:sampling-factor: 1x1,1x1,1x1
    signature: cc8e228c4c4ec4533b8ad976936cb70a9cc18c51afbc223ac96b1756c5dcbe0e
  Artifacts:
    filename: 2.jpg
    verbose: true
  Tainted: False
  Filesize: 112650B
  Number pixels: 178929
  Pixels per second: 44.6554MB
  User time: 0.000u
  Elapsed time: 0:01.004
  Version: ImageMagick 6.9.11-60 Q16 aarch64 2021-01-25 https://imagemagick.org

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.