Yes, a fifo would maybe alsa work. But I never tried it.
Eventually this whole exercise with ffmpeg and the unique SID, TID and other pids, was done to make vdr record the stream!
Yes, a fifo would maybe alsa work. But I never tried it.
Eventually this whole exercise with ffmpeg and the unique SID, TID and other pids, was done to make vdr record the stream!
ZitatDas Umschalten zwischen den Streams dauert ca. 4...8 Sekunden
Great!
you can decrease analyseduration and probesize values just until you lose picture and/or sound.
It may help a bit to increase zapping speed.
Hi Paulaner,
ffmpeg reads the stream just fine, the issue is with the UDP streaming.
When you tune to the test channel the first time, can you then please check if you see just one ffmpeg process? Or even vlc?
If there are, for some reason, that will lead to conflicts in the UDP stream.
Just to be sure we have all signals available to kill ffmpeg, add HUP to it:
And please don't forget before you test:
sudo sysctl -w net.core.rmem_max=2097152
sudo sysctl -w net.core.rmem_default=2097152
sudo sysctl -w net.core.wmem_max=2097152
sudo sysctl -w net.core.wmem_default=2097152
Maybe an idea to add to /etc/rc.local (if that's available)
If it fails, try this from SHF
ZitatHier ein Link zum Thema UDP und Puffer:
Hi Paulaner
I still don’t understand why your ffmpeg based script is not working well.
I compiled ffmpeg 4.4.2 on my test system and it’s working well. (Not with all your options, don’t need all those)
Important options during execution are:
-re
$HOST:$PORT?pkt_size=1316&buffer_size=65536
And sufficiently high
-probesize
-analyzeduration
Just to be sure, execute below
sudo sysctl -w net.core.rmem_max=2097152
sudo sysctl -w net.core.rmem_default=2097152
sudo sysctl -w net.core.wmem_max=2097152
sudo sysctl -w net.core.wmem_default=2097152
And if all ‘PIDs’ match it should work
Thanks! and no rush!
I think this is (also) related to your problem:
I'm not seeing that on my side
[hls @ 0x559eef0fda00] No longer receiving playlist 2 ('https://hse24.akamaized.net/hls/live/2006663/hse24/master_900p25.m3u8')
[hls @ 0x559eef0fda00] No longer receiving playlist 4 ('https://hse24.akamaized.net/hls/live/2006663/hse24/master_576p25.m3u8')
[hls @ 0x559eef0fda00] No longer receiving playlist 1 ('https://hse24.akamaized.net/hls/live/2006663-b/hse24/master_1080p25.m3u8')
[hls @ 0x559eef0fda00] No longer receiving playlist 3 ('https://hse24.akamaized.net/hls/live/2006663-b/hse24/master_900p25.m3u8')
[hls @ 0x559eef0fda00] No longer receiving playlist 5 ('https://hse24.akamaized.net/hls/live/2006663-b/hse24/master_576p25.m3u8')
With regards to the vlc2iptv script, just kill -9 vlc when switching channel:
Change trap line like below
Maybe not very gentle but effective
Hi,
Testet ihr denn mit vergleichbarer Hardware?
MfG Stefan
I have a small Gigabyte Brix Intel Celeron 2 core.
ffmpeg load is less than 5% VDR around 15%
It must work for Paulaner also somehow!
Runs like a charm
This is my ffmpeg command running:
ffmpeg -y -hide_banner -user_agent Mozilla/5.0 -reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 1 -probesize 8000000 -analyzeduration 8000000 -f hls -http_persistent 0 -re -i https://hse24.akamaized.net/hls/live/2006663/hse24/playlist.m3u8 -codec:v copy -codec:a copy -streamid 0:100 -streamid 1:200 -flush_packets -1 -f mpegts -mpegts_transport_stream_id 2836 -mpegts_pmt_start_pid 4096 -mpegts_service_id 6016 -mpegts_original_network_id 65281 udp://brix:4320?pkt_size=1316&buffer_size=65536&overrun_nonfatal=1
Try to find obvious difference with your ffmpeg while running ‘HSE’
Especially this part is important
Hello jojo61
I have a problem with mpv and softhddrm on x86_64
When I stop playing a video file mpv stops and softhddrm crashes reproducibly
ffmpeg version 6.1.1
Shaders are not compiled in softhddrm
-P"softhddrm -g 1920x1080+0+0 -r 50 -a plughw:CARD=PCH,DEV=3 -p plughw:CARD=PCH,DEV=3 -w alsa-no-test"
-P"mpv -v gpu -h auto -c drm -a alsa -b /files/Media/Video\'s -m Videos -s"
softhddrm settings
softhddrm.576i.CutLeftRight = 0
softhddrm.576i.CutTopBottom = 0
softhddrm.576i.Deinterlace = 0
softhddrm.576i.Denoise = 0
softhddrm.576i.InverseTelecine = 0
softhddrm.576i.Scaling = 0
softhddrm.576i.Sharpen = 0
softhddrm.576i.SkipChromaDeinterlace = 0
softhddrm.60HzMode = 0
softhddrm.720p.CutLeftRight = 0
softhddrm.720p.CutTopBottom = 0
softhddrm.720p.Deinterlace = 0
softhddrm.720p.Denoise = 0
softhddrm.720p.InverseTelecine = 0
softhddrm.720p.Scaling = 0
softhddrm.720p.Sharpen = 0
softhddrm.720p.SkipChromaDeinterlace = 0
softhddrm.AudioAutoAES = 0
softhddrm.AudioBufferTime = 100
softhddrm.AudioCompression = 0
softhddrm.AudioDelay = 0
softhddrm.AudioDownmix = 1
softhddrm.AudioDrift = 1
softhddrm.AudioMaxCompression = 0
softhddrm.AudioMaxNormalize = 0
softhddrm.AudioNormalize = 0
softhddrm.AudioPassthrough = 0
softhddrm.AudioSoftvol = 0
softhddrm.AudioStereoDescent = 0
softhddrm.Background = 0
softhddrm.BlackPicture = 0
softhddrm.Brightness = 0
softhddrm.CBlindness = 0
softhddrm.CBlindnessFaktor = 0
softhddrm.ClearOnSwitch = 0
softhddrm.Contrast = 100
softhddrm.DetachFromMainMenu = 0
softhddrm.EnableDPMSatBlackScreen = 0
softhddrm.Gamma = 100
softhddrm.HideMainMenuEntry = 0
softhddrm.Hue = 0
softhddrm.MakePrimary = 1
softhddrm.MaxSizeGPUImageCache = 128
softhddrm.Osd.Height = 1080
softhddrm.Osd.Width = 1920
softhddrm.Saturation = 100
softhddrm.SoftStartSync = 0
softhddrm.StudioLevels = 0
softhddrm.Suspend.Close = 0
softhddrm.Suspend.X11 = 0
softhddrm.TargetColorSpace = 2
softhddrm.Temperature = 0
softhddrm.UHD.CutLeftRight = 0
softhddrm.UHD.CutTopBottom = 0
softhddrm.UHD.Deinterlace = 0
softhddrm.UHD.Denoise = 0
softhddrm.UHD.InverseTelecine = 0
softhddrm.UHD.Scaling = 0
softhddrm.UHD.Sharpen = 0
softhddrm.UHD.SkipChromaDeinterlace = 0
softhddrm.Video4to3DisplayFormat = 1
softhddrm.VideoOtherDisplayFormat = 1
Alles anzeigen
mpv settings:
mpv.ExitAtEnd = 1
mpv.HideMainMenuEntry = 0
mpv.PlaylistIfNoChapters = 0
mpv.PlaylistOnNextKey = 1
mpv.SavePos = 1
mpv.ShowAfterStop = 0
mpv.ShowMediaTitle = 1
mpv.ShowSubtitles = 0
mpv.SoftVol = 0
mpv.StereoDownmix = 1
mpv.UseDeinterlace = 1
mpv.UseDtsHdPassthrough = 1
mpv.UsePassthrough = 0
Alles anzeigen
Maybe you can find the problem!
[hls @ 0x55a214a58a00] Could not find codec parameters for stream 4 (Audio: aac ([15][0][0][0] / 0x000F), 0 channels, fltp): unspecified sample rate
Consider increasing the value for the 'analyzeduration' (2000000) and 'probesize' (2000000) options
[hls @ 0x55a214a58a00] Could not find codec parameters for stream 6 (Video: h264 ([27][0][0][0] / 0x001B), none): unspecified size
Consider increasing the value for the 'analyzeduration' (2000000) and 'probesize' (2000000) options
[hls @ 0x55a214a58a00] Could not find codec parameters for stream 7 (Audio: aac ([15][0][0][0] / 0x000F), 0 channels, fltp): unspecified sample rate
Consider increasing the value for the 'analyzeduration' (2000000) and 'probesize' (2000000) options
Can you set
In the script?
If ffmpeg still complains then increase with 1000000 until it's happy
Lower values increase zapping speed, but here it's too low
Please configure your channels.conf with TID, SID and NID:
And you need (random but unique) values for SID, and TID in channels.conf. NID can be 65281 for all channels. Example:
Code
Das Erste HD;IPTV:1010:S=0|P=1|F=EXT|U=ffmpeg2iptv_raw|A=1:I:0:258=27:256=@15;257=@122:0:0:100:65281:200:0
Here I chose 100 and 200
Next line might have 300 and 400
And so on
Let's see if this is HLS related or something different.
Can you replace one url from urls,conf with this one and switch to it:
ffmpeg version and config, because I saw a version mismatch in the ffprobe dump:
WARNING: library configuration mismatch - avcodec
Maybe there's another version of the library floating around
And can you share the channels.conf channel line you tested with?
Das Bild ist allerdings zerhackt, ruckelt, bleibt stehen und es gibt viele Blockartefakte.
Der Ton ist manchmal da, aber meistens kein Ton.
Try following:
sudo sysctl -w net.core.rmem_max=2097152
sudo sysctl -w net.core.rmem_default=2097152
sudo sysctl -w net.core.wmem_max=2097152
sudo sysctl -w net.core.wmem_default=2097152
I’ve seen that VLC works, but ffmpeg needs above lines to get performant udp streaming
#!/bin/bash
#
# <Global Settings>
#
CHANNELS_CONF=/var/lib/vdr/channels.conf
URLS_CONF=/etc/vdr/plugins/iptv/urls.conf
NID="65281"
#
# </Global Settings>
#
exit_with_error()
{
logger "ffmpeg2iptv_raw: error: $*"
exit 1
}
read_arguments()
{
[ $# -ne 2 ] && exit_with_error "Invalid parameter count '$#' $*"
PARAMETER=$1
PORT=$2
}
lookup_channel_and_pids()
{
[ ! -e "$CHANNELS_CONF" ] && \
exit_with_error "channels.conf not found ($CHANNELS_CONF)"
local CHANNEL_RECORD=`grep "[:]S=[10][|]P=[10][|]F=EXT[|]U=ffmpeg2iptv_raw[|]A=$PARAMETER[:]I" $CHANNELS_CONF`
[ -z "$CHANNEL_RECORD" ] && \
exit_with_error "no iptv channel with parameter $PARAMETER found"
CHANNEL_NAME=`echo $CHANNEL_RECORD | awk "-F[;,:]" '{print $1}'`
VPID=`echo $CHANNEL_RECORD | awk -F: '{print $6}' | sed 's/=.*//g'`
APID=`echo $CHANNEL_RECORD | awk -F: '{print $7}' | sed 's/=.*//g'`
SID=`echo $CHANNEL_RECORD | awk -F: '{print $10}'`
TID=`echo $CHANNEL_RECORD | awk -F: '{print $12}'`
}
read_arguments $*
lookup_channel_and_pids
URL=$(sed -n /^${PARAMETER},/p $URLS_CONF | cut -f2 -d,)
#
# Start ffmpeg
#
HOST=127.0.0.1
# Set streaming network buffers
BUFFER="?buffer_size=16777216"
FLUSH_PACKETS="-flush_packets -1" # 1: flush immediately, reduce latency, 0: increases throughput, -1: automatic
# CORRECT_TS_OVERFLOW="-correct_ts_overflow 1" # Correct single timestamp overflows if set to 1. Default is 1
CORRECT_TS_OVERFLOW=""
# DISCARD_CORRUPT_PACKAGES="-fflags +discardcorrupt"
DISCARD_CORRUPT_PACKAGES=""
PROBESIZE="2000000" # bytes, 5MB default
ANALYZEDURATION="2000000" # ms, 5 sec. default
STREAM_FORMAT="-f hls -http_persistent 0 -re"
VCODEC="copy"
VCODEC_OPTIONS=""
ACODEC="copy"
ACODEC_OPTIONS=""
LC_NUMERIC=C ffmpeg \
-y -hide_banner -user_agent "Mozilla/5.0" -reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 1 $CORRECT_TS_OVERFLOW \
$DISCARD_CORRUPT_PACKAGES -probesize $PROBESIZE -analyzeduration $ANALYZEDURATION $STREAM_FORMAT -i "${URL}${BUFFER}" \
-codec:v $VCODEC $VCODEC_OPTIONS -codec:a $ACODEC $ACODEC_OPTIONS -streamid 0:$VPID -streamid 1:$APID $FLUSH_PACKETS \
-f mpegts -mpegts_transport_stream_id $TID -mpegts_pmt_start_pid 4096 -mpegts_service_id $SID \
-mpegts_original_network_id $NID udp://$HOST:$PORT?pkt_size=1316\&buffer_size=65536\&overrun_nonfatal=1 &>/tmp/ffmpeg.log &
PID=${!}
trap 'kill -SIGKILL ${PID} 2> /dev/null' INT EXIT QUIT TERM
# Waiting for the given PID to terminate
wait ${PID}
Alles anzeigen
…