Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not recording - error: Attempt to use invalid handle -1 #51

Open
blaudp79 opened this issue Jun 28, 2021 · 2 comments
Open

Not recording - error: Attempt to use invalid handle -1 #51

blaudp79 opened this issue Jun 28, 2021 · 2 comments

Comments

@blaudp79
Copy link

Hi,

LibreELEC version 9.2.7
Kodi version 18.9.0
IPTV Recorder version 0.0131
xbmcswift2 version 2.4.0
ffmpeg version 9.2.0.111
ffmpeg binary location: /storage/.kodi/addons/tools.ffmpeg-tools/bin/ffmpeg

I can play the stream without any issues:

2021-06-27 20:40:02.304 T:1229185792 WARNING: [xbmcswift2] No converter provided, unicode should be used, but returning str value
2021-06-27 20:40:17.728 T:1819116288 WARNING: Previous line repeats 120 times.
2021-06-27 20:40:17.728 T:1819116288  NOTICE: [xbmcswift2] Request for "/play_channel/Duna+World+%2F+M4+Sport%2B" matches rule for function "play_channel"
2021-06-27 20:40:17.732 T:1819116288 WARNING: [xbmcswift2] No converter provided, unicode should be used, but returning str value
2021-06-27 20:40:24.177 T:1936595456  NOTICE: VideoPlayer::OpenFile: https://c402-node61-cdn.connectmedia.hu/1103/dec354a754a87b99ca97aa65f40ade50/60d91a76/02.m3u8
2021-06-27 20:40:24.307 T:1819116288  NOTICE: Creating InputStream
2021-06-27 20:40:25.042 T:1819116288  NOTICE: Creating Demuxer
2021-06-27 20:40:28.686 T:1819116288  NOTICE: Opening stream: 0 source: 256
2021-06-27 20:40:28.686 T:1819116288  NOTICE: Creating video codec with codec id: 27
2021-06-27 20:40:28.700 T:1819116288  NOTICE: Creating video thread
2021-06-27 20:40:28.700 T:1200337664  NOTICE: running thread: video_thread
2021-06-27 20:40:28.794 T:1819116288  NOTICE: Opening stream: 1 source: 256
2021-06-27 20:40:28.794 T:1819116288  NOTICE: Finding audio codec for: 86018
2021-06-27 20:40:28.795 T:1819116288  NOTICE: CDVDAudioCodecFFmpeg::Open() Successful opened audio decoder aac
2021-06-27 20:40:28.796 T:1819116288  NOTICE: Creating audio thread
2021-06-27 20:40:28.796 T:1175159552  NOTICE: running thread: CVideoPlayerAudio::Process()
2021-06-27 20:40:28.797 T:1175159552  NOTICE: Creating audio stream (codec id: 86018, channels: 2, sample rate: 48000, no pass-through)

However, RECORD AND PLAY fails with this:

2021-06-27 20:41:31.820 T:1743475456 WARNING: [xbmcswift2] No converter provided, unicode should be used, but returning str value
2021-06-27 20:41:31.957 T:1743475456  NOTICE: [xbmcswift2] Request for "/record_and_play/Duna+World+%2F+M4+Sport%2B" matches rule for function "record_and_play"
2021-06-27 20:42:02.505 T:1804804864 WARNING: [xbmcswift2] No converter provided, unicode should be used, but returning str value
2021-06-27 20:42:07.584 T:1743475456 WARNING: Previous line repeats 122 times.
2021-06-27 20:42:07.584 T:1743475456 WARNING: Attempt to use invalid handle -1
2021-06-27 20:42:07.586 T:1743475456 WARNING: Previous line repeats 2 times.
2021-06-27 20:42:07.586 T:1743475456 WARNING: [xbmcswift2] No converter provided, unicode should be used, but returning str value

FFMPEG runs fine from command line:

 ffmpeg -i https://c201-node61-cdn.connectmedia.hu/1103/fd2ecf53a45508a6da29121f2676d9e9/60d90fde/02.m3u8 -y -t 10 -fflags +genpts -vcodec copy -acodec copy -reconnect_at_eof 1 -reconnect_streamed 1 -reconnect_delay_max 300
-f mpegts /tmp/test.ts
ffmpeg version 4.2.4 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 8.3.0 (GCC)
  configuration: --enable-ffmpeg --disable-ffplay --enable-ffprobe --enable-static --disable-shared --enable-gpl --disable-doc --enable-omx-rpi --enable-mmal --enable-encoder=h264_omx --enable-hwaccel=h264_mmal --enable-hwaccel=mpeg2_mmal --enable-hwaccel=mpeg4_mmal --enable-hwaccel=vc1_mmal --enable-avresample --disable-lzma --disable-alsa --arch=arm --cpu=cortex-a7 --cross-prefix=/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabi- --enable-cross-compile --sysroot=/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/armv7ve-libreelec-linux-gnueabi/sysroot --sysinclude=/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/armv7ve-libreelec-linux-gnueabi/sysroot/usr/include --target-os=linux --nm=/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabi-nm --ar=/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabi-ar --as=/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabi-gcc --cc=/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabi-gcc --ld=/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabi-gcc --pkg-config=/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/bin/pkg-config --host-cc=/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/bin/host-gcc --host-cflags='-march=native -O2 -Wall -pipe -I/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/include -Wno-format-security' --host-ldflags='-Wl,-rpath,/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/lib -L/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/lib' --host-extralibs=-lm --extra-cflags='-march=armv7ve -mtune=cortex-a7 -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4 -fomit-frame-pointer -Wall -pipe -Os -I/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/gnutls-3.6.14/.INSTALL_PKG/usr/include -DRPI=1 -I/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/toolchain/armv7ve-libreelec-linux-gnueabi/sysroot/usr/include/IL' --extra-ldflags='-march=armv7ve -mtune=cortex-a7 -Wl,--as-needed -L/home/jails/home/jenkins/LE/build2/workspace/Addons/All_Addons-RPi2/LibreELEC.tv/build.LibreELEC-RPi2.arm-9.2-devel/gnutls-3.6.14/.INSTALL_PKG/usr/lib' --extra-libs='-lbcm_host -ldl -lmmal -lmmal_core -lmmal_util -lvchiq_arm -lvcos -lvcsm' --enable-pic --enable-gnutls --disable-openssl --disable-hardcoded-tables
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[hls @ 0x2ab63f0] Skip ('#EXT-X-VERSION:3')
[hls @ 0x2ab63f0] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-06-28T00:08:41Z')
[hls @ 0x2ab63f0] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-06-28T00:08:49Z')
[hls @ 0x2ab63f0] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-06-28T00:08:57Z')
[hls @ 0x2ab63f0] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-06-28T00:09:05Z')
[hls @ 0x2ab63f0] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-06-28T00:09:13Z')
[hls @ 0x2ab63f0] Opening 'https://c201-node61-cdn.connectmedia.hu/1103/fd2ecf53a45508a6da29121f2676d9e9/60d90fde/20210624T105545-02-22726977.ts' for reading
[hls @ 0x2ab63f0] Opening 'https://c201-node61-cdn.connectmedia.hu/1103/fd2ecf53a45508a6da29121f2676d9e9/60d90fde/20210624T105545-02-22726978.ts' for reading
[h264 @ 0x2ac4f30] Increasing reorder buffer to 2
Input #0, hls, from 'https://c201-node61-cdn.connectmedia.hu/1103/fd2ecf53a45508a6da29121f2676d9e9/60d90fde/02.m3u8':
  Duration: N/A, start: 5073.377800, bitrate: N/A
  Program 0
    Metadata:
      variant_bitrate : 0
    Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Metadata:
      variant_bitrate : 0
    Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
    Metadata:
      variant_bitrate : 0
Output #0, mpegts, to '/tmp/test.ts':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 25 tbr, 90k tbn, 90k tbc
    Metadata:
      variant_bitrate : 0
    Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
    Metadata:
      variant_bitrate : 0
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[hls @ 0x2ab63f0] Skip ('#EXT-X-VERSION:3')time=00:00:06.16 bitrate=3061.4kbits/s speed=0.41x
[hls @ 0x2ab63f0] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-06-28T00:08:57Z')
[hls @ 0x2ab63f0] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-06-28T00:09:05Z')
[hls @ 0x2ab63f0] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-06-28T00:09:13Z')
[hls @ 0x2ab63f0] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-06-28T00:09:21Z')
[hls @ 0x2ab63f0] Skip ('#EXT-X-PROGRAM-DATE-TIME:2021-06-28T00:09:29Z')
[hls @ 0x2ab63f0] Opening 'https://c201-node61-cdn.connectmedia.hu/1103/fd2ecf53a45508a6da29121f2676d9e9/60d90fde/20210624T105545-02-22726979.ts' for reading
frame=  252 fps= 12 q=-1.0 Lsize=    3917kB time=00:00:09.98 bitrate=3213.8kbits/s speed=0.476x
video:3439kB audio:160kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.828273%

Any idea what could be wrong?

Thanks.

@Phigen
Copy link

Phigen commented Oct 4, 2021

Same problem for me.
I have some good results with this ffmpeg binary from here "https://johnvansickle.com/ffmpeg/"
"https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-armhf-static.tar.xz"
I decompress and put "ffmpeg" and "ffprobe" files in my "Download" folder and I point IPTV Recorder to this new "ffmpeg".
I have some crashes of Kodi when I choose to record, but Registering seems to work.
PS : Sorry for mistakes

@blaudp79
Copy link
Author

blaudp79 commented Oct 5, 2021

I've ended up scheduling recording with an ffmpeg command via a Cron job. It is simple and never crashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants