Forums » Tutorial and setups »
How to transcode multiple channels from tvheadend with vlc or ffmpeg?
Added by Andre Books almost 11 years ago
For some reason VLM doesnt like playlists so I have to execute VLC transcode command in different putty window which is very annoying. How do you guys transcode multiple channels from tvheadend to have it in http out or rtp/rtsp? Is playlist the only option we have with tvheadend?
Replies (2)
RE: How to transcode multiple channels from tvheadend with vlc or ffmpeg? - Added by Andre Books almost 11 years ago
Anyone?
RE: How to transcode multiple channels from tvheadend with vlc or ffmpeg? - Added by Nicolai Mladenoff over 10 years ago
Your question is 6 month old and I am not sure what you are asking for ("transcode multiple channels" why?), but this is how I transcode and stream Live-TV to watch it over the Internet (and I use a playlist,why not?). The built in transcoding is not working for me with tvh 3.9.975.
Maybe this is helpful for somebody :-)
I use a script (on Linux) to start vlc and I have a playlist whith my tvheadend channels. I use a cronjob to start this at boot (@reboot /home/user/vlc/stream). My files are in /home/user/vlc, where user is my username:
Script called stream:
_____________________________________
#!/bin/sh
BINDIP="0.0.0.0"
STREAMPORT="8888"
IFACEPORT="7777"
DEBUGLVL=0
LN="$BINDIP:$STREAMPORT"
PASSWD="tvheadend"
OPTIONS="--verbose $DEBUGLVL -I dummy --extraintf=http --http-host $BINDIP --http-port $IFACEPORT --http-password $PASSWD"
SOUT="#transcode{venc=x264{subme=5,ref=3,bframes=16,b-adapt=1,bpyramid=none,weightp=0},vcodec=h264,scale=0.75,vb=850,acodec=mpga,ab=96,channels=2,threads=2}:std{access=http,mux=ts,dst=$LN}"
STREAMFILES="/home/user/vlc/tv.m3u"
cvlc $OPTIONS --sout $SOUT $STREAMFILES vlc://quit &
_____________________________________________
Playlist (example) called tv.m3u in /home/user/vlc:
_____________________________________________
#EXTM3U
#EXTVLCOPT--http-reconnect=true
#EXTINF:-1,0 Dummy
vlc://pause:999999
#EXTM3U
#EXTINF:-1,1 Das Erste
http://tvheadend:9981/play/stream/channel/9c4385e1e4e8aa4dde65af7095f4b309?title=41%20%3A%20Das%20Erste
#EXTINF:-1,2 ZDF
http://tvheadend:9981/play/stream/channel/489372f1fe14f27a2009d8e0d00e6dc0?title=42%20%3A%20ZDF
__________________________________________________________
You get the url if you do a right click in tvh webinterface on play and copy link address.
You need to make the script executeable (chmod u+x /home/user/vlc/stream) and start it in the backround: /home/user/vlc/stream & or whith cron as I mentioned.
Now you can go to your browser and choose a channel: http://IP:7777
Use the password tvheadend (or whatever you configured in the script) and let the username empty. (Note that in older versions of vlc, no password is needed, adjust the script)
(It will play dummy for 999999 seconds and then switch to the first channel, but you can simply click stop)
Click on a channel you want and the transcoding/streaming will start.
You can play the stream in vlc player: http://IP:8888 or a player of your choice.
On Android I use Remote for VLC to choose a channels and mx-player to play the stream.
If you want to use this over the Internet, you have to open ports 7777 and 8888 in your router and adjust the transcoding to fit your bandwith. I have 6 MBit/s upload and can stream HDTV with no issues but I use SDTV becasue it makes more sense.
I found this on the web some years ago and used it under windows with dvbviewer and then, when I switched to Linux with VDR and now with tvheadend. tvh has built in transcoding but it is not working for me, so this is still my approach. If somebody else has a better solution please let me know and excuse my english (I am German)
Regards Nick