NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Linux v
« Previous 1 … 21 22 23 24 25 … 34 Next »
Paging Martin --- IP camera as a extras channel

 
  • 0 Vote(s) - 0 Average
Paging Martin --- IP camera as a extras channel
snagglewest
Offline

Senior Member

VA USA
Posts: 361
Threads: 60
Joined: Jul 2011
#1
2020-04-02, 08:05 PM
So the other post about IP camera got me to playing around and I found the wiki on extras.  Between the two and your ffmpeg code, I muddled my way thru and got it sorta working in linux with my crappy little COOAU 720P camera.

The problem is it displays video for about 10-15 seconds, the screen flashes black and then the image goes static, no more live video.  If it matters, this is viewing it as a livetv channel in Kodi.  The url "rtsp://[username]:[password]@192.168.1.181:554/11" plays fine in VLC.  Watching the process in htop between the 2 doesn't seem to vary so I'm thinking it probably has something to do with the ffmpeg arguments.

Google has failed me so far so I'm hoping you can shed some light on where I might be going wrong or point me in the right direction?


Code:
<extras>
    <channel name="Front_Yard">
        <command>ffmpeg</command>
        <args>-re -v panic -f lavfi -i anullsrc=r=48000  -rtsp_transport tcp -i "rtsp://[username]:[password]@192.168.1.181:554/11" -vcodec copy -acodec aac -f mpegts -</a$
    </channel>
NextPVR V6.1.5.231022 - Ubuntu 22.04 VM / 4 core / 8Gb memory
HDHR Prime X2 / HDFX-2 /Schedule Direct / 2X Pi4 + & 3X Pi3 LibreELEC Kodi clients
Server - TrueNAS/ SuperMicro MBD-X10SL7-F MB / Xeon E3-1246 / 32Gb Unbuffered ECC / 8 X 4TB RAIDZ2
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,120
Threads: 957
Joined: May 2006
#2
2020-04-02, 08:47 PM
I always prefer testing with ffplay so you should try these two tests

confirm the url

ffplay "rtsp://[username]:[password]@192.168.1.181:554/11"

then confirm the script the extras calls.

/var/opt/nextpvr/scripts/yourscript.sh | ffplay -i pipe:

Martin
snagglewest
Offline

Senior Member

VA USA
Posts: 361
Threads: 60
Joined: Jul 2011
#3
2020-04-02, 10:08 PM
I ran ffplay "rtsp://[username]:[password]@192.168.1.181:554/11" and this is the output.  Does it mean anything to you?

Not sure what you mean by /var/opt/nextpvr/scripts/yourscript.sh | ffplay -i pipe:

Do I need to add the ffplay line to a yourscript.sh file and run it?

Code:
npvr@npvr:~$ ffplay "rtsp://xxxx:xxxx@192.168.1.181:554/11"
ffplay version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2003-2019 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
  configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Segmentation fault (core dumped)
NextPVR V6.1.5.231022 - Ubuntu 22.04 VM / 4 core / 8Gb memory
HDHR Prime X2 / HDFX-2 /Schedule Direct / 2X Pi4 + & 3X Pi3 LibreELEC Kodi clients
Server - TrueNAS/ SuperMicro MBD-X10SL7-F MB / Xeon E3-1246 / 32Gb Unbuffered ECC / 8 X 4TB RAIDZ2
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#4
2020-04-02, 10:13 PM
If you're you're on a linux machine without a desktop, or if you ssh'ing into the box, then this is probably why ffplay is crashing (ie, cant create windows etc for playback).

You could alternatively try running something like:

ffmpeg -i "rtsp://xxxx:xxxx@192.168.1.181:554/11" -f mpegts /tmp/test.ts

Then see if it'll run happily for a couple of minutes
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,120
Threads: 957
Joined: May 2006
#5
2020-04-02, 10:21 PM
Sorry I usually don't hardcode my extras I call a script so I can test them.

An ffmpeg and alternatively ffprobe test will tell you what kind of video and and audio you have have, you might need transcoding.

Martin
snagglewest
Offline

Senior Member

VA USA
Posts: 361
Threads: 60
Joined: Jul 2011
#6
2020-04-02, 10:39 PM (This post was last modified: 2020-04-02, 10:40 PM by snagglewest.)
ffmpeg -i "rtsp://xxxx:xxxx@192.168.1.181:554/11" -f mpegts /tmp/test.ts resulted in this after 15-20 seconds or so

Code:
ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
  configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, rtsp, from 'rtsp://xxx:xxx@192.168.1.181:554/11':
  Metadata:
    title           : 10
  Duration: N/A, start: 0.034000, bitrate: N/A
    Stream #0:0: Video: h264 (Baseline), yuvj420p(pc, bt709, progressive), 1280x720, 30 tbr, 90k tbn, 180k tbc
    Stream #0:1: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mpeg2video (native))
  Stream #0:1 -> #0:1 (pcm_alaw (native) -> mp2 (native))
Press [q] to stop, [?] for help
[swscaler @ 0x55fca08f2b60] deprecated pixel format used, make sure you did set range correctly
Too many packets buffered for output stream 0:0.577014:32:22.77 bitrate=  -0.0kbits/s speed=N/A   
Conversion failed!
npvr@npvr:~$
NextPVR V6.1.5.231022 - Ubuntu 22.04 VM / 4 core / 8Gb memory
HDHR Prime X2 / HDFX-2 /Schedule Direct / 2X Pi4 + & 3X Pi3 LibreELEC Kodi clients
Server - TrueNAS/ SuperMicro MBD-X10SL7-F MB / Xeon E3-1246 / 32Gb Unbuffered ECC / 8 X 4TB RAIDZ2
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,120
Threads: 957
Joined: May 2006
#7
2020-04-02, 10:44 PM
Does it work better if you try adding

-vcodec copy -acodec aac

Martin
snagglewest
Offline

Senior Member

VA USA
Posts: 361
Threads: 60
Joined: Jul 2011
#8
2020-04-02, 10:51 PM
I ran this and it bombed out almost immediately

Code:
npvr@npvr:~$ ffmpeg -i "rtsp://xxx:xxx@192.168.1.181:554/11" -vcodec copy -acodec aac -f mpegts /tmp/test.ts
ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
  configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, rtsp, from 'rtsp://xxx:xxx@192.168.1.181:554/11':
  Metadata:
    title           : 10
  Duration: N/A, start: 0.034000, bitrate: N/A
    Stream #0:0: Video: h264 (Baseline), yuvj420p(pc, bt709, progressive), 1280x720, 30 tbr, 90k tbn, 180k tbc
    Stream #0:1: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
File '/tmp/test.ts' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (pcm_alaw (native) -> aac (native))
Press [q] to stop, [?] for help
[rtsp @ 0x55883e5518e0] max delay reached. need to consume packet
[rtsp @ 0x55883e5518e0] RTP: missed 162 packets
Too many packets buffered for output stream 0:0.
Conversion failed!
NextPVR V6.1.5.231022 - Ubuntu 22.04 VM / 4 core / 8Gb memory
HDHR Prime X2 / HDFX-2 /Schedule Direct / 2X Pi4 + & 3X Pi3 LibreELEC Kodi clients
Server - TrueNAS/ SuperMicro MBD-X10SL7-F MB / Xeon E3-1246 / 32Gb Unbuffered ECC / 8 X 4TB RAIDZ2
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,120
Threads: 957
Joined: May 2006
#9
2020-04-02, 10:54 PM
What if you ignore audio with

-vcodec copy -an

It won't be playable in the browser but it might work with kodi

Martin
snagglewest
Offline

Senior Member

VA USA
Posts: 361
Threads: 60
Joined: Jul 2011
#10
2020-04-02, 11:35 PM
No joy.  Here's the output from the command line.  It did run. but as you can see there were quite a few errors.

I did try it in the extras file and it did run, but with the same problem as before.  It starts but after 10-15 seconds the screen blinks black and then the static image displays.

Code:
<args>-re -v panic -f lavfi -i anullsrc=r=48000  -rtsp_transport tcp -i "rtsp://xxx:xxx@192.168.1.182:554/11" -vcodec copy -an -f mpegts -</args>


Code:
npvr@npvr:~$ ffmpeg -i "rtsp://xxx:xxx@192.168.1.181:554/11" -vcodec copy -an -f mpegts /tmp/test.ts
ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
  configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, rtsp, from 'rtsp://xxx:xxx@192.168.1.181:554/11':
  Metadata:
    title           : 10
  Duration: N/A, start: 0.033000, bitrate: N/A
    Stream #0:0: Video: h264 (Baseline), yuvj420p(pc, bt709, progressive), 1280x720, 30 tbr, 90k tbn, 180k tbc
    Stream #0:1: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
File '/tmp/test.ts' already exists. Overwrite ? [y/N] y
Output #0, mpegts, to '/tmp/test.ts':
  Metadata:
    title           : 10
    encoder         : Lavf57.83.100
    Stream #0:0: Video: h264 (Baseline), yuvj420p(pc, bt709, progressive), 1280x720, q=2-31, 30 tbr, 90k tbn, 90k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[mpegts @ 0x555752e5c400] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[mpegts @ 0x555752e5c400] Non-monotonous DTS in output stream 0:0; previous: 0, current: 0; changing to 1. This may result in incorrect timestamps in the output file.
[rtsp @ 0x555752df88e0] max delay reached. need to consume packet
[rtsp @ 0x555752df88e0] RTP: missed 275 packets
[NULL @ 0x555752dfc060] illegal reordering_of_pic_nums_idc 30itrate= 781.9kbits/s speed=1.38x   
[mpegts @ 0x555752e5c400] Non-monotonous DTS in output stream 0:0; previous: 2679300, current: 2679300; changing to 2679301. This may result in incorrect timestamps in the output file.
[NULL @ 0x555752dfc060] reference overflow 61 > 15 or 0 > 15
[NULL @ 0x555752dfc060] illegal reordering_of_pic_nums_idc 30itrate= 844.4kbits/s speed=1.16x   
[mpegts @ 0x555752e5c400] Non-monotonous DTS in output stream 0:0; previous: 5379570, current: 5379570; changing to 5379571. This may result in incorrect timestamps in the output file.
[NULL @ 0x555752dfc060] reference overflow 61 > 15 or 0 > 15
[NULL @ 0x555752dfc060] reference overflow 61 > 15 or 0 > 15bitrate= 866.9kbits/s speed= 1.1x   
[mpegts @ 0x555752e5c400] Non-monotonous DTS in output stream 0:0; previous: 8082900, current: 8082900; changing to 8082901. This may result in incorrect timestamps in the output file.
[NULL @ 0x555752dfc060] reference overflow 61 > 15 or 0 > 15bitrate= 875.9kbits/s speed=1.07x   
[mpegts @ 0x555752e5c400] Non-monotonous DTS in output stream 0:0; previous: 10783260, current: 10783260; changing to 10783261. This may result in incorrect timestamps in the output file.
frame= 2530 fps= 21 q=-1.0 size=   13824kB time=00:02:08.68 bitrate= 880.1kbits/s speed=1.07x   
[3]+  Stopped                 ffmpeg -i "rtsp://xxx:xxx@192.168.1.181:554/11" -vcodec copy -an -f mpegts /tmp/test.ts
npvr@npvr:~$
NextPVR V6.1.5.231022 - Ubuntu 22.04 VM / 4 core / 8Gb memory
HDHR Prime X2 / HDFX-2 /Schedule Direct / 2X Pi4 + & 3X Pi3 LibreELEC Kodi clients
Server - TrueNAS/ SuperMicro MBD-X10SL7-F MB / Xeon E3-1246 / 32Gb Unbuffered ECC / 8 X 4TB RAIDZ2
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (3): 1 2 3 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Extras Tuners Not Loading on NextPVR 3.1 Linux Install Siftingice 1 61 2025-07-03, 12:12 AM
Last Post: mvallevand
  Extras Tuners Not Loading on NextPVR 3.1 Linux Install Siftingice 0 37 2025-07-03, 12:02 AM
Last Post: Siftingice
  Extra - {channel} argument not working? blitz2kx 2 658 2024-06-11, 03:54 PM
Last Post: blitz2kx
  BBC Four HD missing from Channel scan - Astra 28.2E Heifer 12 2,439 2024-03-03, 01:49 PM
Last Post: mvallevand
  HDHomerun channel scan not working WagMan 2 812 2023-12-06, 02:38 PM
Last Post: mvallevand
  Different Errors depending on channel (no tuner found/transcoding Error) idefixrc 3 890 2023-11-21, 12:45 PM
Last Post: mvallevand
  Australian IPTV Channel 10 refusing "VLC/2.2.6 LibVLC/2.2.6" header Leigh 1 836 2023-10-23, 11:46 AM
Last Post: mvallevand
  No regions or auto-detect in channel scan Paul_G 1 653 2023-08-04, 02:03 PM
Last Post: mvallevand
Photo Copy Channel Lineup in Linux boukmandutty 11 1,839 2023-06-15, 06:53 PM
Last Post: mvallevand
  New linux setup extras help greatwhitenorth 8 2,285 2023-01-26, 07:11 PM
Last Post: mvallevand

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode