Posts by carel

    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:

    Code
    trap 'kill -SIGKILL ${PID} 2>/dev/null; exit' INT TERM KILL HUP


    And please don't forget before you test:

    Code
    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

    Quote

    Hier ein Link zum Thema UDP und Puffer:

    Monitoring the UDP Socket Buffer

    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

    Code
    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

    I think this is (also) related to your problem:

    I'm not seeing that on my side

    Code
    [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

    Code
    trap 'kill -KILL  ${PID} 2> /dev/null' INT EXIT QUIT TERM KILL

    Maybe not very gentle but effective

    Runs like a charm


    This is my ffmpeg command running:

    Code
    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

    Code
     pkt_size=1316&buffer_size=65536&overrun_nonfatal=1

    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


    bt_full_softhddrm.txt


    ffmpeg version 6.1.1

    Shaders are not compiled in softhddrm


    Code
    -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



    mpv settings:


    Maybe you can find the problem!

    Code
    [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

    Code
    PROBESIZE="5000000" # bytes, 5MB default
    ANALYZEDURATION="5000000" # ms, 5 sec. default


    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

    Code
    [MPEGTS muxer @ 0x55a217eb5dc0] Error setting option mpegts_transport_stream_id to value 0.

    Please configure your channels.conf with TID, SID and NID:


    Code
    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:

    Code
    https://hse24.akamaized.net/hls/live/2006663/hse24/playlist.m3u8


    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

    Code
    ffmpeg -version
    sudo find /usr -name "libavcodec.so.*" 


    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:

    Code
    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