NextPVR Forums
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR v5 Support Linux v
« Previous 1 2 3 4 5 6 … 15 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: 336
Threads: 53
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 V5.1.0.210329 - Ubuntu 20.04 VM / 4 cores / 8Gb memory
HDHR Prime X2 / Schedule Direct / 1X Pi4 + & 4X Pi3 LibreELEC Kodi clients
Server - FreeNAS-11.2 / SuperMicro MBD-X10SL7-F MB / Xeon E3-1246 Quad-Core 3.50GHz / 32Gb PC3-12800 Unbuffered ECC / 8 X 4TB RAIDZ2
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 37,393
Threads: 744
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: 336
Threads: 53
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 V5.1.0.210329 - Ubuntu 20.04 VM / 4 cores / 8Gb memory
HDHR Prime X2 / Schedule Direct / 1X Pi4 + & 4X Pi3 LibreELEC Kodi clients
Server - FreeNAS-11.2 / SuperMicro MBD-X10SL7-F MB / Xeon E3-1246 Quad-Core 3.50GHz / 32Gb PC3-12800 Unbuffered ECC / 8 X 4TB RAIDZ2
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 97,311
Threads: 681
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: 37,393
Threads: 744
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: 336
Threads: 53
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 V5.1.0.210329 - Ubuntu 20.04 VM / 4 cores / 8Gb memory
HDHR Prime X2 / Schedule Direct / 1X Pi4 + & 4X Pi3 LibreELEC Kodi clients
Server - FreeNAS-11.2 / SuperMicro MBD-X10SL7-F MB / Xeon E3-1246 Quad-Core 3.50GHz / 32Gb PC3-12800 Unbuffered ECC / 8 X 4TB RAIDZ2
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 37,393
Threads: 744
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: 336
Threads: 53
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 V5.1.0.210329 - Ubuntu 20.04 VM / 4 cores / 8Gb memory
HDHR Prime X2 / Schedule Direct / 1X Pi4 + & 4X Pi3 LibreELEC Kodi clients
Server - FreeNAS-11.2 / SuperMicro MBD-X10SL7-F MB / Xeon E3-1246 Quad-Core 3.50GHz / 32Gb PC3-12800 Unbuffered ECC / 8 X 4TB RAIDZ2
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 37,393
Threads: 744
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: 336
Threads: 53
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 V5.1.0.210329 - Ubuntu 20.04 VM / 4 cores / 8Gb memory
HDHR Prime X2 / Schedule Direct / 1X Pi4 + & 4X Pi3 LibreELEC Kodi clients
Server - FreeNAS-11.2 / SuperMicro MBD-X10SL7-F MB / Xeon E3-1246 Quad-Core 3.50GHz / 32Gb PC3-12800 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
  Cannot Save IPTV Channel List bc123 12 124 2021-04-13, 02:06 AM
Last Post: bc123
  HD channel missing mark31 8 287 2020-11-08, 03:29 PM
Last Post: mark31
  NextPVR + HDHomerun no channel Mux setting ozra 8 472 2020-11-03, 03:57 AM
Last Post: ozra
  Channel order incorrect Linux mcbloggs 42 3,473 2020-08-18, 10:06 PM
Last Post: sub
  Channel discovery skipping channels peterschen 4 488 2020-08-02, 07:39 PM
Last Post: sub
  Saving an updated "All Channels" channel list rosede 2 384 2020-06-16, 12:12 AM
Last Post: rosede
  Channel plays for a few seconds then buffering flyingsubs 17 1,352 2020-05-28, 09:49 PM
Last Post: flyingsubs
  Web channel guide: seeing listings for only one channel? rkulagow 1 319 2020-05-16, 01:49 AM
Last Post: mvallevand
  When to use "add sd channel lineup" button bluesight 23 1,720 2020-05-15, 10:37 PM
Last Post: BrettB
  Manual channel add in Linux bluesight 11 930 2020-05-13, 07:29 PM
Last Post: bluesight

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

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

Linear Mode
Threaded Mode