VideoHelp Forum
+ Reply to Thread
Results 1 to 7 of 7
Thread
  1. First I need to know how to add the metadata for the Major Channel and Minor Channel to the transport stream. My current command line is:
    Code:
    ffmpeg -f lavfi -i testsrc2=rate=30:duration=10:size=640x480 -c:v mpeg2video -g 30 -b:v 3000k -muxrate 19390k test.ts
    This generates a 10 second long transport stream with a test video source, with a frame rate of 30fps, and an image size of 640x480 (aka 480p). The output is an MPEG TS file with an MPEG2 compressed video stream and a GOP size of 30 frames (one second of video per GOP). The video bit rate is 3000kbps and the overall bitrate is padded out to 19390kbps as required by the ATSC specification. But there's one problem still. Most TVs don't let you set the actual frequency to receive. Instead autodetect the frequencies of all available ATSC broadcasts, and decode the channel number meta data, and then associate that meta data with the frequency in a database in the TV's memory. So when you select a TV channel to watch you are using that channel's major and minor numbers (like 13.1) to cause the TV to look up the frequency for that channel in its stored database, which it then tunes to. So if I can't add a major and minor channel number to the MPEGTS stream, it won't be usable with most TVs as there would be no channel number for the TV to store in its database to associate with the frequency. I need to know the FFMPEG command line switches to store the channel number metadata in the MPEGTS stream.

    My plan is to then send the MPEGTS file with FFMPEG either using a UDP or TCP protocol over an Ethernet cable from my computer to an ATSC transmitter. But the problem is I don't know what ATSC transmitters accept an MPEGTS stream over an Ethernet cable. I know there are some relatively inexpensive (read as about $500) ATSC transmitters that accept an HDMI cable for direct input of digital video, but then those transmitters need to do the extra step of MPEG2 encodiing the video and then packing it in an MPEGTS stream before sending it onto the other data preparation and modulator circuits. With FFMPEG I can easily generate the MPEG2 compressed video in an MPEGTS stream, right in the computer itself. I just need to know if an ATSC transmitter out there exists that accepts such an MPEGTS stream delivered in TCP or UDP over an Ethernet cable.
    Quote Quote  
  2. bellow some hints - complete is slightly more complex - should work as it work in real broadcast environment before
    Code:
    @set muxrate=19390400.0
    @set mpegts=-start_at_zero -muxrate %muxrate% -mpegts_original_network_id 4 -mpegts_transport_stream_id 4 -mpegts_service_id 4 -mpegts_pmt_start_pid 32 -mpegts_start_pid 64 -streamid 0:512 -metadata service_provider="youasaprovider" -metadata service_name="H.264 MP@HL" -tables_version 0 -mpegts_service_type 0x11
    @ffmpeg -re -y -hide_banner -loglevel 8 -stats -f lavfi -i %video% -c:v mpeg2video -profile:v 4 -level:v 4 -mpv_flags +skip_rd+strict_gop -q:v %qpval% -maxrate:v 18500K -bufsize:v 1835k -flags:v +ilme+ildct+cgop+low_delay+qscale -slices %slice% -thread_type +slice+frame -dc 10 -intra -g %gop% -bf 0 -top 1 -non_linear_quant 0 -alternate_scan 1 -seq_disp_ext 1 -sc_threshold 2G -me_method 0 -motion_est 0 -subq 0 -mbd 0 -precmp zero -skipcmp zero -ps 1316 -color_primaries 1 -color_trc 1 -colorspace 1 -color_range 2 -an -dn -sn -f mpegts %mpegts% -y udp://232.0.35.3:5000?pkt_size=1316
    i see some similarities with https://eyevinntechnology.medium.com/generate-mpeg-ts-from-file-with-ffmpeg-7561181e6369 (albeit mine is from 2016 and it was tailored for DVB and Europe)
    Quote Quote  
  3. Originally Posted by pandy View Post
    bellow some hints - complete is slightly more complex - should work as it work in real broadcast environment before
    Code:
    @set muxrate=19390400.0
    @set mpegts=-start_at_zero -muxrate %muxrate% -mpegts_original_network_id 4 -mpegts_transport_stream_id 4 -mpegts_service_id 4 -mpegts_pmt_start_pid 32 -mpegts_start_pid 64 -streamid 0:512 -metadata service_provider="youasaprovider" -metadata service_name="H.264 MP@HL" -tables_version 0 -mpegts_service_type 0x11
    @ffmpeg -re -y -hide_banner -loglevel 8 -stats -f lavfi -i %video% -c:v mpeg2video -profile:v 4 -level:v 4 -mpv_flags +skip_rd+strict_gop -q:v %qpval% -maxrate:v 18500K -bufsize:v 1835k -flags:v +ilme+ildct+cgop+low_delay+qscale -slices %slice% -thread_type +slice+frame -dc 10 -intra -g %gop% -bf 0 -top 1 -non_linear_quant 0 -alternate_scan 1 -seq_disp_ext 1 -sc_threshold 2G -me_method 0 -motion_est 0 -subq 0 -mbd 0 -precmp zero -skipcmp zero -ps 1316 -color_primaries 1 -color_trc 1 -colorspace 1 -color_range 2 -an -dn -sn -f mpegts %mpegts% -y udp://232.0.35.3:5000?pkt_size=1316
    i see some similarities with https://eyevinntechnology.medium.com/generate-mpeg-ts-from-file-with-ffmpeg-7561181e6369 (albeit mine is from 2016 and it was tailored for DVB and Europe)

    Most of those commandline switches I think are undocumented. Can you explain if they are all do, and also if they are all actually needed to successfully generate an MPETGTS stream that fits the ATSC specification? And where did the muxrate of 19390400 come from? I thought that the official specification required a muxrate of 19390000.

    Also can you answer the second question from my original post? That is, where can I buy an ATSC transmitter that I can connect to my computer via an Ethernet cable?
    Quote Quote  
  4. Originally Posted by Videogamer555 View Post
    Most of those commandline switches I think are undocumented. Can you explain if they are all do, and also if they are all actually needed to successfully generate an MPETGTS stream that fits the ATSC specification?
    I think most of them if not all are somehow documented - whether they are documented completely or not it is open.

    Perhaps you should verify each of them with ffmpeg documentation (since 2016 till now ffmpeg could do some changes).

    ATSC specification should be your reference (particularly for PSI/SI structure for ATSC).

    Originally Posted by Videogamer555 View Post
    And where did the muxrate of 19390400 come from? I thought that the official specification required a muxrate of 19390000.
    Answer for your question is simple (from back of my head - this was bitrate i always used during my work with ATSC projects - probably based on some Sencore documentation as we used Sencore ATSC player and modulator) but your question forced me to verify at source Transport bitrate and equation for bitrate is: (188/208)*(312/313)*(684/286)*9=19392658.4597511bps so of course i apologize for providing inaccurate bitrate.

    So muxrate shall be:
    Code:
    @set muxrate=19392658
    Originally Posted by Videogamer555 View Post
    Also can you answer the second question from my original post? That is, where can I buy an ATSC transmitter that I can connect to my computer via an Ethernet cable?
    I can only say that being on your place i would go for ebay and try to buy or used professional ATSC modulator capable to do network to RF (this will be cost somewhere around 1..3kU$D) or something cheaper i.e. HDMI to ATSC converter then use some single board uC such as Raspberry PI as network front-end (or perhaps even as source) and use embedded decoder with HDMI output as HDMI source for HDMI to ATSC converter - you should fit bellow 300U$D. There are other possibilities but less consumer friendly.
    Quote Quote  
  5. Member
    Join Date
    Aug 2006
    Location
    United States
    Search Comp PM
    Here is an example of an inexpensive HDMI to ATSC converter https://www.amazon.com/Modulator-Route-1080P-Ethernet-Setting/dp/B08B1VWPLP/ It can only create one channel per RF frequency and includes a built-in signal combiner to add that channel to an existing RF distribution set-up.

    [Edit] This is another relatively inexpensive model: https://www.channelmaster.com/products/atsc-hd-modulator-hdmi-to-coax Unfortunately it's currently out of stock.

    I have a SiliconDust HDHomerun Prime QAM tuner that does the reverse of what you want to do, (QAM RF in via coax, transport stream for one channel out via ethernet.) I haven't seen anything for consumers that would accept a transport stream delivered via ethernet and turn it into an ATSC RF signal.
    Last edited by usually_quiet; 21st Dec 2021 at 23:54.
    Ignore list: hello_hello, tried, TechLord, Snoopy329
    Quote Quote  
  6. Originally Posted by pandy View Post
    bellow some hints - complete is slightly more complex - should work as it work in real broadcast environment before
    Code:
    @set muxrate=19390400.0
    @set mpegts=-start_at_zero -muxrate %muxrate% -mpegts_original_network_id 4 -mpegts_transport_stream_id 4 -mpegts_service_id 4 -mpegts_pmt_start_pid 32 -mpegts_start_pid 64 -streamid 0:512 -metadata service_provider="youasaprovider" -metadata service_name="H.264 MP@HL" -tables_version 0 -mpegts_service_type 0x11
    @ffmpeg -re -y -hide_banner -loglevel 8 -stats -f lavfi -i %video% -c:v mpeg2video -profile:v 4 -level:v 4 -mpv_flags +skip_rd+strict_gop -q:v %qpval% -maxrate:v 18500K -bufsize:v 1835k -flags:v +ilme+ildct+cgop+low_delay+qscale -slices %slice% -thread_type +slice+frame -dc 10 -intra -g %gop% -bf 0 -top 1 -non_linear_quant 0 -alternate_scan 1 -seq_disp_ext 1 -sc_threshold 2G -me_method 0 -motion_est 0 -subq 0 -mbd 0 -precmp zero -skipcmp zero -ps 1316 -color_primaries 1 -color_trc 1 -colorspace 1 -color_range 2 -an -dn -sn -f mpegts %mpegts% -y udp://232.0.35.3:5000?pkt_size=1316
    i see some similarities with https://eyevinntechnology.medium.com/generate-mpeg-ts-from-file-with-ffmpeg-7561181e6369 (albeit mine is from 2016 and it was tailored for DVB and Europe)

    I know this is a bit old of a thread, but I'm still curious about one thing, something that your post didn't answer, despite it being a question in my opening post. And that question is how do I set the major-channel and minor-channel numbers? ATSC can transmit on one frequency (that corresponds to RF channel 5, for example) while using a different channel number for ease of use on a consumer TV, a number which in ATSC is purely metadata (for example 14.2) and has nothing to do with the frequency it's transmitting on. It's a 2 part channel number. In the previous example, the first part (the number 14) is the major-channel number, and the second part (the number 2) is the minor channel number.

    How do you set the major and minor channel numbers in the MPEGTS stream in FFMPEG? If it's even possible, it would certainly be an undocumented feature, as I can't find anything on the internet saying how to do it.
    Quote Quote  
  7. Originally Posted by Videogamer555 View Post

    I know this is a bit old of a thread, but I'm still curious about one thing, something that your post didn't answer, despite it being a question in my opening post. And that question is how do I set the major-channel and minor-channel numbers? ATSC can transmit on one frequency (that corresponds to RF channel 5, for example) while using a different channel number for ease of use on a consumer TV, a number which in ATSC is purely metadata (for example 14.2) and has nothing to do with the frequency it's transmitting on. It's a 2 part channel number. In the previous example, the first part (the number 14) is the major-channel number, and the second part (the number 2) is the minor channel number.

    How do you set the major and minor channel numbers in the MPEGTS stream in FFMPEG? If it's even possible, it would certainly be an undocumented feature, as I can't find anything on the internet saying how to do it.
    This is something i believe outside normal ffmpeg TS muxing functionality - you need some ATSC PSIP editor i believe... and to be honest knowing how this industry works i doubt if you find something open sourced or free... Try at https://github.com/tvheadend and similar projects...

    https://www.atsc.org/atsc-documents/type/1-0-standards/
    https://www.atsc.org/atsc-documents/type/1-0-recommended-practices/

    A/65 and A/69 seem to be most accurate answer for your question in terms of the technology itself.

    In Europe PSI/SI structure is slightly different than in ATSC countries and feature you are searching for is called LCN (Logical Channel Numbering).
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!