Opened 4 years ago

Closed 3 years ago

#4118 closed enhancement (fixed)

mpegts: allow to set service_type in SDT

Reported by: dhead666 Owned by:
Priority: wish Component: avformat
Version: git-master Keywords: mpegts
Cc: smallishzulu Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

AFAIK When muxing any stream to mpegts the service_type field in the SDT always set as tv (not sure about the hex value, maybe 0x01).

It would be useful to be able to set the value to something else as radio.

I'm not sure if adding only one choise is a good idea (meaning being able to choose only tv or radio) as I see there are multiple related values for radio as 0x02, 0x07 and 0x0A (same goes for tv), so it might be best to just add all the values from the "Service type coding" table (table 87 in http://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.13.01_40/en_300468v011301o.pdf ).

Another approach would be to automatically set the service_type as radio if there's only an audio stream (again, the question is which value exactly).

My personal interest with this is to be able to add internet radio stations correctly to tvheadend.

I pipe mpegts of internet radio station (originally HLS stream) from ffmpeg to tvheadend as described at https://tvheadend.org/projects/tvheadend/wiki/Custom_MPEG-TS_Input and by entering the following to tvheadend:

pipe:///usr/bin/ffmpeg -loglevel fatal -i http://103fm-s.nsacdn.com/103fm_LiveRadioRepeat/_definst_/smil:LiveRadio.smil/manifest.m3u8 -acodec copy -metadata service_provider=STRING -metadata service_name=STRING -f mpegts -tune zerolatency pipe:1

The stream recognized in tvheadend as tv channel and not radio because ffmpeg set service_type as tv.

Thanks in advance

Change History (6)

comment:1 Changed 4 years ago by cehoyos

  • Component changed from ffmpeg to avformat
  • Keywords mpegts added
  • Priority changed from normal to wish
  • Version changed from 2.4.3 to git-master

comment:2 Changed 4 years ago by dhead666

p.s
This ( http://pastebin.com/SVVmVTQf ) is working for me perfectly, quickly and kindly coded by tvheadend's developer, linuxstb (hts channel on freenode).

Last edited 4 years ago by dhead666 (previous) (diff)

comment:3 Changed 4 years ago by cehoyos

Please add an appropriate commit message (including author information!) to the patch and send it to the ffmpeg-devel mailing list.

comment:4 Changed 4 years ago by smallishzulu

The patch works fine. It is a needed option.

comment:5 Changed 4 years ago by cehoyos

  • Cc smallishzulu added

Then commit the patch locally, produce a patch file with git format-patch HEAD^ and send it to the development mailing list.

comment:6 Changed 3 years ago by dhead666

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.