Opened 9 years ago

Closed 9 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 by Carl Eugen Hoyos, 9 years ago

Component: ffmpegavformat
Keywords: mpegts added
Priority: normalwish
Version: 2.4.3git-master

comment:2 by dhead666, 9 years ago

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 9 years ago by dhead666 (previous) (diff)

comment:3 by Carl Eugen Hoyos, 9 years ago

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

comment:4 by smallishzulu, 9 years ago

The patch works fine. It is a needed option.

comment:5 by Carl Eugen Hoyos, 9 years ago

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 by dhead666, 9 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.