braice / MuMuDVB

A DVB IPTV streaming software
http://mumudvb.braice.net/
GNU General Public License v2.0
214 stars 133 forks source link

Question: Filtering PIDs during TS capture #314

Closed stulluk closed 9 months ago

stulluk commented 9 months ago

I am capturing TS streams from Satellite Transponders via:

stulluk ~ $  cat /usr/bin/satcapture.sh 
#!/usr/bin/env sh

ADAPTER_NUM=0
FRONTEND_NUM=1
DEMUX_NUM=0
DVR_NUM=0

FREQMIN=10700
FREQMAX=12750

SYMRATEMIN=1000
SYMRATEMAX=50000

read -p "Select Satellite: Turksat or Hotbird: t or h : " SAT

case ${SAT} in
    t|T) DISEQC="0"
        SAT="Turksat"
        break
        ;;
    h|H) DISEQC="1"
        SAT="Hotbird"
        break
        ;;
    *) printf "Enter t or h..\n"
        exit;;
esac

read -p "Enter DVB DELIVERY_SYSTEM TYPE: S or S2: " DVBTYPE

case ${DVBTYPE} in
    s|S) DVBTYPE="DVB-S"
        break
        ;;
    s2|S2) DVBTYPE="DVB-S2"
        break
        ;;
    *) printf "Enter s or s2..\n"
        exit;;
esac

printf "DVBTYPE is ${DVBTYPE}\n"

read -p "Enter Frequency: " FREQ

case ${FREQ} in
    ''|*[!0-9]*) printf "Please enter a number between ${FREQMIN} and ${FREQMAX} !!\n"
        exit
            ;;
    *) ;;
esac

if [ ${FREQ} -lt ${FREQMIN} ] || [ ${FREQ} -gt ${FREQMAX} ]
then
    printf "Wrong Frequency value!!\n"
    exit
fi

printf "FREQUENCY is ${FREQ}\n"

read -p "Enter Polarity: V or H: " POL

case ${POL} in
    v|V) POL="vertical"
        POL_MUMU="v"
        break
        ;;
    h|H) POL="horizontal"
        POL_MUMU="h"
        break
        ;;
    *) printf "Enter v or h..\n"
        exit;;
esac

printf "POLARITY is ${POL}\n"

read -p "Enter Symbol Rate: " SYMRATE

case ${SYMRATE} in
    ''|*[!0-9]*) printf "Please enter a number between ${SYMRATEMIN} and ${SYMRATEMAX} !!\n"
        exit
            ;;
    *) ;;
esac

if [ ${SYMRATE} -lt ${SYMRATEMIN} ] || [ ${SYMRATE} -gt ${SYMRATEMAX} ]
then
    printf "Wrong Symbol Rate value!!\n"
    exit
fi

printf "SYMRATE is ${SYMRATE}\n"
CURDATE="$(date +'%Y-%m-%d-%H-%M-%S')"
OUT_TS_FILE="${SAT}_${FREQ}_${POL_MUMU}_${SYMRATE}_${CURDATE}.ts"

printf "Output TS file is %s\n" ${OUT_TS_FILEFILE}

# Lets create conf file for mumudvb

OUT_CONF_FILE="${SAT}_${FREQ}_${POL_MUMU}_${SYMRATE}.conf"

printf "tuner=${FRONTEND_NUM}\n" | tee ${OUT_CONF_FILE}
printf "freq=${FREQ}\n" | tee -a ${OUT_CONF_FILE}
printf "pol=${POL_MUMU}\n" | tee -a ${OUT_CONF_FILE}
printf "srate=${SYMRATE}\n" | tee -a ${OUT_CONF_FILE}
printf "delivery_system=${DVBTYPE}\n" | tee -a ${OUT_CONF_FILE}
printf "sat_number=$((DISEQC+1))\n" | tee -a ${OUT_CONF_FILE}
printf "multicast_ipv4=0\n" | tee -a ${OUT_CONF_FILE}
printf "autoconfiguration=full\n" | tee -a ${OUT_CONF_FILE}

mumudvb -dt -c ${OUT_CONF_FILE} --dumpfile ${OUT_TS_FILE}

# tsp --debug  -I dvb \
#   -d /dev/dvb/adapter${ADAPTER_NUM}:${FRONTEND_NUM}:${DEMUX_NUM}:${DVR_NUM} \
#   --delivery-system ${DVBTYPE} \
#           --satellite-number ${DISEQC} \
#           --lnb Extended \
#   --frequency "${FREQ}000000" \
#   --polarity ${POL} \
#           --symbol-rate "${SYMRATE}000" > ${OUT_TS_FILE}

As an example, capturing transponder 12380 V 30000 from Hotbirds satellite is as follows:

stulluk ~ $  satcapture.sh 
Select Satellite: Turksat or Hotbird: t or h : h
Enter DVB DELIVERY_SYSTEM TYPE: S or S2: S2
DVBTYPE is DVB-S2
Enter Frequency: 12380
FREQUENCY is 12380
Enter Polarity: V or H: V
POLARITY is vertical
Enter Symbol Rate: 30000
SYMRATE is 30000
Output TS file is 
tuner=1
freq=12380
pol=v
srate=30000
delivery_system=DVB-S2
sat_number=2
multicast_ipv4=0
autoconfiguration=full
WARN:  Main:  You've decided to dump the received stream into Hotbird_12380_v_30000_2023-09-10-15-02-29.ts. Be warned, it can grow quite fast
MuMuDVB Version 2.1.0_5e9959e366b815ac498f2dc2823ac028d59a5d5f
 --- Build information ---
Built with CAM support.
Built without SCAM support.
Built with ATSC support.
Built with ATSC long channel names support.
Built with support for DVB API Version 5.11.
Built with support for DVB-T2.
---------
Originally based on dvbstream 0.6 by (C) Dave Chapman 2001-2004
Released under the GPL.
Latest version available from http://mumudvb.net/
Project from the cr@ns (http://www.crans.org)
by Brice DUBOST (mumudvb@braice.net)

Info:  Tune:  You will use DVB API version 5 for tuning your card.
Info:  Main:  Autoconfiguration, we activate SAP announces. if you want to disable them see the README.
Info:  Main:  Autoconfiguration, we activate PAT rewriting. if you want to disable it see the README.
Info:  Main:  Autoconfiguration, we activate SDT rewriting. if you want to disable it see the README.
Info:  Main:  ========== End of configuration, MuMuDVB version 2.1.0_5e9959e366b815ac498f2dc2823ac028d59a5d5f is starting ==========
WARN:  Main:  Can't create /var/run/mumudvb/channels_streamed_adapter0_tuner1: No such file or directory
WARN:  Main:  Can't create /var/run/mumudvb/channels_unstreamed_adapter0_tuner1: No such file or directory
Info:  Main:  Streaming. Freq 12380000.000000
Info:  Tune:  Using DVB card "TurboSight TBS 5530 DVB-T2/T/C/S/S2/S2x,ISDB-T,ATSC DVB-S/S2/S2X" tuner 1
Info:  Tune:  Tuning DVB-S to Freq: 1780000 kHz, Transp frequency: 12380000.000000 , LO frequency 10600000 kHz  Pol:V Srate=30000000, LNB number: 2
Info:  Tune:  LNB voltage 13V
Info:  Tune:  Sending DISEQC
Info:  Tune:  DISEQC: Setting Tone OFF
Info:  Tune:  DISEQC: Setting Voltage and wait 15 ms
Info:  Tune:  DISEQC: Send CMD and wait 15 ms
Info:  Tune:  DISEQC: Send BURST and wait 15 ms
Info:  Tune:  DISEQC: Set TONE back and wait 15 ms
Info:  Tune:  DISEQC SETTING SUCCEEDED - Frequency: 1780000
Info:  Tune:  Tuning With DVB-API version 5. delivery system : 6
Info:  Tune:  FE_STATUS:
Info:  Tune:  FE_STATUS:
Info:  Tune:       FE_HAS_SIGNAL : found something above the noise level
Info:  Tune:       FE_HAS_CARRIER : found a DVB signal
Info:  Tune:       FE_HAS_VITERBI : FEC is stable
Info:  Tune:       FE_HAS_SYNC : found sync bytes
Info:  Tune:       FE_HAS_LOCK : everything's working... 
Info:  Tune:  Event:  Frequency: 12380000 (or 8820000)
Info:  Tune:          SymbolRate: 30000000
Info:  Tune:          FEC_inner:  5
Info:  Tune:  Bit error rate: 0
Info:  Tune:  Signal strength: 34768
Info:  Tune:  SNR: 41656
Info:  Main:  Card 0, tuner 1 tuned
Info:  Main:  The traffic will be shown every 10 seconds
main 0x564682ec4a60
WARN:  DVB:  An issue happened during the IOCTLS to take uncorrected blocks measurements error: Unknown error 524
Info:  Common chan:  Looking through all services to update their filters
Info:  Autoconf:  Autoconfiguration is now ready to work for you !
Info:  Autoconf:  The PAT version changed, channels have changed
Info:  Autoconf:  New PAT we force SDT update after all sections seen
WARN:  Autoconf:  Channel 0 SID 3010 Force PMT update
WARN:  Autoconf:  Channel 1 SID 3011 Force PMT update
WARN:  Autoconf:  Channel 2 SID 3012 Force PMT update
WARN:  Autoconf:  Channel 3 SID 3013 Force PMT update
WARN:  Autoconf:  Channel 4 SID 3050 Force PMT update
Info:  Autoconf:  The CAT version changed
Info:  Autoconf:  New CAT we force SDT update after all sections seen
Info:  Autoconf:  The SDT version changed, channels description have changed
Info:  Autoconf:  We update the channel names
Info:  Autoconf:  We update the channel status
Info:  Autoconf:  Looking through all channels to see if they are ready for streaming
Info:  Autoconf:  We update the channel filters
Info:  Common chan:  Looking through all services to update their filters
Info:  Autoconf:  We update the channel networking
Info:  Main:  Channel "FashionTV L'Original" down.Card 0
Info:  Main:  Channel "Fashion TV HD" down.Card 0
Info:  Main:  Channel "FTV UHD" down.Card 0
Info:  Main:  Channel "Love Nature 4K" down.Card 0
Info:  Main:  Channel "Insight TV UHD" down.Card 0
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x1803
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x1861
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x186c
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x1870
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x06ed
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x0b00
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x1803
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x1861
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x186c
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x1870
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x06ed
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x0b00
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x1803
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x1861
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x186c
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x1870
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x06ed
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x0b00
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x1803
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x1861
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x186c
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x1870
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x06ed
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x0b00
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x1803
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x1861
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x186c
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x1870
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x06ed
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x0b00
Info:  Common chan:  Looking through all services to update their filters
Info:  Autoconf:  We update the channel CAM support
Info:  Autoconf:  Diffusion 5 channels
Info:  Autoconf:  Channel number :   0,   service id 3010  name : "FashionTV L'Original"
Info:  Autoconf:  Channel number :   1,   service id 3011  name : "Fashion TV HD"
Info:  Autoconf:  Channel number :   2,   service id 3012  name : "FTV UHD"
Info:  Autoconf:  Channel number :   3,   service id 3013  name : "Love Nature 4K"
Info:  Autoconf:  Channel number :   4,   service id 3050  name : "Insight TV UHD"
Info:  Common chan:  Looking through all services to update their filters
Info:  Autoconf:  We update the channel CAM support
Info:  Autoconf:  Diffusion 5 channels
Info:  Autoconf:  Channel number :   0,   service id 3010  name : "FashionTV L'Original"
Info:  Autoconf:  Channel number :   1,   service id 3011  name : "Fashion TV HD"
Info:  Autoconf:  Channel number :   2,   service id 3012  name : "FTV UHD"
Info:  Autoconf:  Channel number :   3,   service id 3013  name : "Love Nature 4K"
Info:  Autoconf:  Channel number :   4,   service id 3050  name : "Insight TV UHD"
Info:  Common chan:  Looking through all services to update their filters
Info:  Autoconf:  We update the channel CAM support
Info:  Autoconf:  Diffusion 5 channels
Info:  Autoconf:  Channel number :   0,   service id 3010  name : "FashionTV L'Original"
Info:  Autoconf:  Channel number :   1,   service id 3011  name : "Fashion TV HD"
Info:  Autoconf:  Channel number :   2,   service id 3012  name : "FTV UHD"
Info:  Autoconf:  Channel number :   3,   service id 3013  name : "Love Nature 4K"
Info:  Autoconf:  Channel number :   4,   service id 3050  name : "Insight TV UHD"
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x1884
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x181d
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x06ed
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x1803
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x1861
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x1870
ERRO:  Autoconf:  Couldn't find CAT CA system for id 0x186c
Info:  Common chan:  Looking through all services to update their filters
Info:  Autoconf:  We update the channel CAM support
Info:  Autoconf:  Diffusion 5 channels
Info:  Autoconf:  Channel number :   0,   service id 3010  name : "FashionTV L'Original"
Info:  Autoconf:  Channel number :   1,   service id 3011  name : "Fashion TV HD"
Info:  Autoconf:  Channel number :   2,   service id 3012  name : "FTV UHD"
Info:  Autoconf:  Channel number :   3,   service id 3013  name : "Love Nature 4K"
Info:  Autoconf:  Channel number :   4,   service id 3050  name : "Insight TV UHD"
Info:  Common chan:  Looking through all services to update their filters
Info:  Autoconf:  We update the channel CAM support
Info:  Autoconf:  Diffusion 5 channels
Info:  Autoconf:  Channel number :   0,   service id 3010  name : "FashionTV L'Original"
Info:  Autoconf:  Channel number :   1,   service id 3011  name : "Fashion TV HD"
Info:  Autoconf:  Channel number :   2,   service id 3012  name : "FTV UHD"
Info:  Autoconf:  Channel number :   3,   service id 3013  name : "Love Nature 4K"
Info:  Autoconf:  Channel number :   4,   service id 3050  name : "Insight TV UHD"
Info:  Main:  Channel "Love Nature 4K" is now highly scrambled (98% of scrambled packets). Card 0
Info:  Main:  Channel "Insight TV UHD" is now highly scrambled (81% of scrambled packets). Card 0
Info:  Main:  Channel "FashionTV L'Original" back.Card 0
Info:  Main:  Channel "Fashion TV HD" back.Card 0
Info:  Main:  Channel "FTV UHD" back.Card 0
Info:  Main:  Channel "Love Nature 4K" back.Card 0
Info:  Main:  Channel "Insight TV UHD" back.Card 0
Info:  Main:  Traffic :  1312.82 kb/s     for channel "FashionTV L'Original"
Info:  Main:  Traffic :  3235.28 kb/s     for channel "Fashion TV HD"
Info:  Main:  Traffic :  7260.83 kb/s     for channel "FTV UHD"
Info:  Main:  Traffic :  12583.07 kb/s    for channel "Love Nature 4K"
Info:  Main:  Traffic :  16963.43 kb/s    for channel "Insight TV UHD"
Info:  Autoconf:  The NIT version changed, channels number could have changed !
Info:  Autoconf:  We got the NIT, we update the channel names
Info:  Main:  Traffic :  1762.25 kb/s     for channel "FashionTV L'Original"
Info:  Main:  Traffic :  4426.60 kb/s     for channel "Fashion TV HD"
Info:  Main:  Traffic :  10033.77 kb/s    for channel "FTV UHD"
Info:  Main:  Traffic :  17152.67 kb/s    for channel "Love Nature 4K"
Info:  Main:  Traffic :  22577.05 kb/s    for channel "Insight TV UHD"
Info:  Main:  Traffic :  1765.48 kb/s     for channel "FashionTV L'Original"
Info:  Main:  Traffic :  4429.82 kb/s     for channel "Fashion TV HD"
Info:  Main:  Traffic :  9916.57 kb/s     for channel "FTV UHD"
Info:  Main:  Traffic :  17227.93 kb/s    for channel "Love Nature 4K"
Info:  Main:  Traffic :  22272.77 kb/s    for channel "Insight TV UHD"
Info:  Main:  Traffic :  1753.65 kb/s     for channel "FashionTV L'Original"
Info:  Main:  Traffic :  4427.67 kb/s     for channel "Fashion TV HD"
Info:  Main:  Traffic :  10100.43 kb/s    for channel "FTV UHD"
Info:  Main:  Traffic :  17224.70 kb/s    for channel "Love Nature 4K"
Info:  Main:  Traffic :  21909.35 kb/s    for channel "Insight TV UHD"
Info:  Main:  Traffic :  1756.88 kb/s     for channel "FashionTV L'Original"
Info:  Main:  Traffic :  4428.75 kb/s     for channel "Fashion TV HD"
Info:  Main:  Traffic :  10198.27 kb/s    for channel "FTV UHD"
Info:  Main:  Traffic :  17256.96 kb/s    for channel "Love Nature 4K"
Info:  Main:  Traffic :  22369.54 kb/s    for channel "Insight TV UHD"
Info:  Main:  Traffic :  1767.63 kb/s     for channel "FashionTV L'Original"
Info:  Main:  Traffic :  4426.60 kb/s     for channel "Fashion TV HD"
Info:  Main:  Traffic :  9953.13 kb/s     for channel "FTV UHD"
Info:  Main:  Traffic :  17216.10 kb/s    for channel "Love Nature 4K"
Info:  Main:  Traffic :  22189.98 kb/s    for channel "Insight TV UHD"
Info:  Main:  Traffic :  1741.82 kb/s     for channel "FashionTV L'Original"
Info:  Main:  Traffic :  4429.82 kb/s     for channel "Fashion TV HD"
Info:  Main:  Traffic :  9993.98 kb/s     for channel "FTV UHD"
Info:  Main:  Traffic :  17241.91 kb/s    for channel "Love Nature 4K"
Info:  Main:  Traffic :  21869.57 kb/s    for channel "Insight TV UHD"
Info:  Main:  Traffic :  1766.55 kb/s     for channel "FashionTV L'Original"
Info:  Main:  Traffic :  4428.75 kb/s     for channel "Fashion TV HD"
Info:  Main:  Traffic :  9873.56 kb/s     for channel "FTV UHD"
Info:  Main:  Traffic :  17184.92 kb/s    for channel "Love Nature 4K"
...
...
Info:  Main:  Traffic :  1747.20 kb/s     for channel "FashionTV L'Original"
Info:  Main:  Traffic :  4427.67 kb/s     for channel "Fashion TV HD"
Info:  Main:  Traffic :  10036.99 kb/s    for channel "FTV UHD"
Info:  Main:  Traffic :  17160.19 kb/s    for channel "Love Nature 4K"
Info:  Main:  Traffic :  22501.79 kb/s    for channel "Insight TV UHD"
^CERRO:  Main:  Caught signal 2
ERRO:  Main:  Autoconf error 2
ERRO:  Main:  Autoconf error 2
Info:  Main:  End of streaming. We streamed during 0d 0:04:04
Info:  Main:  Caught signal 2 - closing cleanly.
Info:  Main:  ========== MuMuDVB version 2.1.0_5e9959e366b815ac498f2dc2823ac028d59a5d5f is stopping with ExitCode 0 ==========

stulluk ~ $ 

As you see, there are 5 TV channels in this transponder, and I would like to capture only "FTV UHD" and generate a TS.

How to achieve this via MumuDVB ?

zavazingo commented 9 months ago

Check autoconf_sid_list at manual. autoconf_sid_list pickup specific service id and ignore rest.

autoconf_sid_list=3012

should be fine.

stulluk commented 9 months ago

@zavazingo thank you very much. it works and filters the stream.