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 … 16 17 18 19 20 … 34 Next »
Extras Device, FFMpeg hw acceleration

 
  • 0 Vote(s) - 0 Average
Extras Device, FFMpeg hw acceleration
dlfergrd
Offline

Junior Member

Canada
Posts: 23
Threads: 4
Joined: Dec 2020
#1
2021-09-04, 02:45 PM
I am using a usb hdmi capture device for my tuner via an extras file.
I can run this from the console and it works fine without any errors or warnings
Code:
ffmpeg -f alsa -thread_queue_size 2048 -thread_queue_size 2048 -i plughw:CARD=C920,DEV=0 -f v4l2 -thread_queue_size 2048 -input_format mjpeg -s 1280x720 -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i /dev/v4l/by-id/usb-046d_HD_Pro_Webcam_C920_788F946F-video-index0 -vf 'scale_vaapi=format=nv12,hwupload' -c:v h264_vaapi -r 30 -g 30 -acodec aac -b:a 192k -f mpegts -vsync 1 -async 1 pipe:1 | ffplay -i -
I use the webcam for testing as it simulates the capture device.

Extras file:
Code:
<extras>
  <channel name="Logitec WebCam">
    <command>ffmpeg</command>
    <args>-f alsa -thread_queue_size 2048 -thread_queue_size 2048 -i plughw:CARD=C920,DEV=0 -f v4l2 -thread_queue_size 2048 -input_format mjpeg -s 1280x720 -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i /dev/v4l/by-id/usb-046d_HD_Pro_Webcam_C920_788F946F-video-index0 -vf 'scale_vaapi=format=nv12,hwupload' -c:v h264_vaapi -r 30 -g 30 -acodec aac -b:a 192k -f mpegts -vsync 1 -async 1 - </args>
  </channel>
</extras>

When I try to watch the webcam channel, I get the messages Starting Device then after a few seconds, Transcoding failed.
I notice the light on the webcam turns on for about half a second.

Digging through the system log files I found this
Code:
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]    ffmpeg version 4.3.2-0+deb11u2 Copyright (c) 2000-2021 the FFmpeg developers
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]      built with gcc 10 (Debian 10.2.1-6)
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]      configuration: --prefix=/usr --extra-version=0+deb11u2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]      libavutil      56. 51.100 / 56. 51.100
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]      libavcodec     58. 91.100 / 58. 91.100
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]      libavformat    58. 45.100 / 58. 45.100
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]      libavdevice    58. 10.100 / 58. 10.100
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]      libavfilter     7. 85.100 /  7. 85.100
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]      libavresample   4.  0.  0 /  4.  0.  0
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]      libswscale      5.  7.100 /  5.  7.100
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]      libswresample   3.  7.100 /  3.  7.100
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]      libpostproc    55.  7.100 / 55.  7.100
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]    Home directory not accessible: Permission denied
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]    Guessed Channel Layout for Input Stream #0.0 : stereo
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]    Input #0, alsa, from 'plughw:CARD=C920,DEV=0':
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]      Duration: N/A, start: 1630764289.298113, bitrate: 1536 kb/s
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]        Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]    Input #1, video4linux2,v4l2, from '/dev/v4l/by-id/usb-046d_HD_Pro_Webcam_C920_788F946F-video-index0':
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]      Duration: N/A, start: 389.855607, bitrate: N/A
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]        Stream #1:0: Video: mjpeg (Baseline), yuvj422p(pc, bt470bg/unknown/unknown), 1280x720, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]    [AVHWDeviceContext @ 0x55d310edd480] libva: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]    Stream mapping:
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]      Stream #1:0 -> #0:0 (mjpeg (native) -> h264 (h264_vaapi))
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]      Stream #0:0 -> #0:1 (pcm_s16le (native) -> aac (native))
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]    Press [q] to stop, [?] for help
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]    [AVFilterGraph @ 0x55d310f90e00] No such filter: 'scale_vaapi=format=nv12,hwupload'
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]    Error reinitializing filters!
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]    Failed to inject frame into filter network: Invalid argument
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]    Error while processing the decoded data for stream #1:0
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]    [video4linux2,v4l2 @ 0x55d310ec8b80] Some buffers are still owned by the caller on close.
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]    Conversion failed!

I have an older pc with an intel hd video that requires the use of the i965 video drivers.
I do have an environmental variable set that persists over reboots
LIBVA_DRIVER_NAME=i965

The line from the system logs:
Code:
2021-09-04 8:04 A.M.    HP-Laptop    server.sh[3557]    [AVHWDeviceContext @ 0x55d310edd480] libva: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed

suggests to me that nextpvr is trying to use the iHD driver instead of the one I need to use.
So I am at a loss as what to try, or if there is a setting in nextpvr I can change to specify which driver to use.

NextPVR log files are attached as well.


Attached Files
.zip   logs-20210904-0813.zip (Size: 55.61 KB / Downloads: 0)
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,826
Threads: 954
Joined: May 2006
#2
2021-09-04, 02:58 PM (This post was last modified: 2021-09-04, 02:58 PM by mvallevand.)
Does that environment variable work globally to include the nextpvr account? I would suggest adding it to /etc/nextpvr-server.conf and restarting the service to see

Martin
dlfergrd
Offline

Junior Member

Canada
Posts: 23
Threads: 4
Joined: Dec 2020
#3
2021-09-04, 03:11 PM
Thanks I will try that
dlfergrd
Offline

Junior Member

Canada
Posts: 23
Threads: 4
Joined: Dec 2020
#4
2021-09-04, 03:15 PM
That seemed to work. The system log no longer shows that it is trying to load the iHD driver.
But still no joy.

Code:
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]    ffmpeg version 4.3.2-0+deb11u2 Copyright (c) 2000-2021 the FFmpeg developers
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]      built with gcc 10 (Debian 10.2.1-6)
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]      configuration: --prefix=/usr --extra-version=0+deb11u2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]      libavutil      56. 51.100 / 56. 51.100
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]      libavcodec     58. 91.100 / 58. 91.100
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]      libavformat    58. 45.100 / 58. 45.100
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]      libavdevice    58. 10.100 / 58. 10.100
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]      libavfilter     7. 85.100 /  7. 85.100
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]      libavresample   4.  0.  0 /  4.  0.  0
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]      libswscale      5.  7.100 /  5.  7.100
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]      libswresample   3.  7.100 /  3.  7.100
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]      libpostproc    55.  7.100 / 55.  7.100
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]    Home directory not accessible: Permission denied
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]    Guessed Channel Layout for Input Stream #0.0 : stereo
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]    Input #0, alsa, from 'plughw:CARD=C920,DEV=0':
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]      Duration: N/A, start: 1630767945.154992, bitrate: 1536 kb/s
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]        Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]    Input #1, video4linux2,v4l2, from '/dev/v4l/by-id/usb-046d_HD_Pro_Webcam_C920_788F946F-video-index0':
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]      Duration: N/A, start: 210.629180, bitrate: N/A
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]        Stream #1:0: Video: mjpeg (Baseline), yuvj422p(pc, bt470bg/unknown/unknown), 1280x720, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]    Stream mapping:
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]      Stream #1:0 -> #0:0 (mjpeg (native) -> h264 (h264_vaapi))
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]      Stream #0:0 -> #0:1 (pcm_s16le (native) -> aac (native))
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]    Press [q] to stop, [?] for help
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]    [AVFilterGraph @ 0x55ace99c8000] No such filter: 'scale_vaapi=format=nv12,hwupload'
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]    Error reinitializing filters!
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]    Failed to inject frame into filter network: Invalid argument
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]    Error while processing the decoded data for stream #1:0
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]    [video4linux2,v4l2 @ 0x55ace9991b80] Some buffers are still owned by the caller on close.
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]    Conversion failed!

Code:
2021-09-04 9:05 A.M.    HP-Laptop    server.sh[2776]    [AVFilterGraph @ 0x55ace99c8000] No such filter: 'scale_vaapi=format=nv12,hwupload'
 I don't know why this happens when it works from the console.

I have tried many other combinations of filters from the console and they all have errors or warnings.
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,826
Threads: 954
Joined: May 2006
#5
2021-09-04, 03:22 PM
Sorry, again I only help with the general nextpvr deb specifics not ffmpeg but the permission denied error looks troubling. Try sudo -u nextpvr for cli testing.

Martin
dlfergrd
Offline

Junior Member

Canada
Posts: 23
Threads: 4
Joined: Dec 2020
#6
2021-09-04, 03:27 PM
Ok thank you for your help.
dlfergrd
Offline

Junior Member

Canada
Posts: 23
Threads: 4
Joined: Dec 2020
#7
2021-09-04, 06:58 PM (This post was last modified: 2021-09-04, 07:00 PM by dlfergrd.)
Found it.

Removing the single quotes around
-vf 'scale_vaapi=format=nv12,hwupload'
did the trick.

Every example I could find showed the quotes until i found an old post dated 2016 that suggested the software was perhaps messing with it.
https://lists.ffmpeg.org/pipermail/ffmpe...03861.html

Maybe this helps someone else at some time in the future.
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,826
Threads: 954
Joined: May 2006
#8
2021-09-04, 11:17 PM
I would offer that how you specifiy and escape the quotes in the Extra is the problem, and NextPVR might not be opening the bash command properly. You might have been better off running a shell script in the extra and testing the script outside NextPVR.

Martin
dlfergrd
Offline

Junior Member

Canada
Posts: 23
Threads: 4
Joined: Dec 2020
#9
2021-09-05, 03:41 PM
I did try that during my testing. It made no difference.
Anyway its working now and that's all that matters Smile
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Failed: No errors, but no data delivered. This is usually because the device failed Bobthegoldfish 3 283 2024-11-29, 12:49 AM
Last Post: mvallevand
  Settings for ffmpeg retrofan 2 536 2024-08-17, 04:55 PM
Last Post: retrofan
  No device listed -- error saving capture source: SQLite Error 1: 'no such column: −1' skrottapple 46 3,944 2024-04-13, 10:27 PM
Last Post: skrottapple
  Adaptec avc-3610 device not listed, but detected by OS tryingtomakeitwork 1 462 2024-04-10, 12:29 PM
Last Post: mvallevand
  IPTV device - reloading M3U amirlsm 28 9,938 2023-08-15, 09:51 AM
Last Post: mrnobody
  FFMPEG CPU usage VCR58 8 1,338 2023-08-02, 12:51 AM
Last Post: VCR58
  FFMpeg and Vaapi acceleration dlfergrd 6 1,418 2023-07-05, 01:37 AM
Last Post: dlfergrd
  usb device doesn't appear in GUI j_yves 4 845 2023-05-29, 02:56 PM
Last Post: j_yves
  New linux setup extras help greatwhitenorth 8 2,141 2023-01-26, 07:11 PM
Last Post: mvallevand
  Current extras tuner process not stopped when recording on another channel is schedul greatwhitenorth 4 980 2022-12-04, 09:37 PM
Last Post: greatwhitenorth

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

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

Linear Mode
Threaded Mode