webcamoid / akvirtualcamera

akvirtualcamera, virtual camera for Mac and Windows
GNU General Public License v3.0
376 stars 47 forks source link

Stream piped to Virtual Camera not working #12

Closed markednmbr1 closed 3 years ago

markednmbr1 commented 3 years ago

I am piping from an rtsp stream to AkVCamManager as follows:

.\ffmpeg.exe -rtsp_transport tcp -i rtsp://10.101.0.100:8554/live -f rawvideo - | .\AkVCamManager.exe stream AkVCamVideoDevice0 RGB24 640 480 30

Everything appears to be running when doing this (until the System.Outofmemory error I have reported on another issue) however it never actually appears on the virtual camera.

When I test it with ffplay: .\ffplay.exe -rtbufsize 1000M -f dshow -i video="Inevidesk Virtual Camera" I just get a scrambled image - see capture below:

Capture

markednmbr1 commented 3 years ago

Just to add, the rtsp stream works fine if I send it to a file, or open it in vlc.

hipersayanX commented 3 years ago

The command must be:

.\ffmpeg.exe -rtsp_transport tcp -i rtsp://10.101.0.100:8554/live -f rawvideo -pix_fmt rgb24 -s 640x480 - | .\AkVCamManager.exe stream AkVCamVideoDevice0 RGB24 640 480 30
shersoni610 commented 3 years ago

Hello,

I had created a device with the following two commands>

AkVCamManager add-format \"AkVCamVideoDevice\"0 RGB24 1920 1080 30 AkVCamManager update

I am wondering if I have supply the options as shown above AkVCamManager.exe stream AkVCamVideoDevice0 RGB24 640 480 30

or Just:

AkVCamManager.exe stream AkVCamVideoDevice0

Thanks.

hipersayanX commented 3 years ago

Already answered here.

markednmbr1 commented 3 years ago

The command must be:

.\ffmpeg.exe -rtsp_transport tcp -i rtsp://10.101.0.100:8554/live -f rawvideo -pix_fmt rgb24 -s 640x480 - | .\AkVCamManager.exe stream AkVCamVideoDevice0 RGB24 640 480 30

Thanks - I'm trying this but it is still not happy for some reason:

C:\Program Files\AkVirtualCamera.plugin\x64>.\ffmpeg.exe -rtsp_transport tcp -i rtsp://10.101.0.100:8554/live -f rawvideo -pix_fmt rgb24 -s 640x480 - | .\AkVCamManager.exe stream AkVCamVideoDevice0 RGB24 640 480 30
ffmpeg version N-101865-g3e16d1c8a6 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 9.3-win32 (GCC) 20200320
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --enable-libvmaf --enable-vulkan --enable-amf --enable-libaom --disable-avisynth --enable-libdav1d --disable-libdavs2 --enable-ffnvcodec --enable-cuda-llvm --enable-libglslang --enable-libgme --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librav1e --disable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libvidstab --disable-libx264 --disable-libx265 --disable-libxavs2 --disable-libxvid --enable-libzimg --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-libs=-lgomp
  libavutil      56. 72.100 / 56. 72.100
  libavcodec     58.135.100 / 58.135.100
  libavformat    58. 77.100 / 58. 77.100
  libavdevice    58. 14.100 / 58. 14.100
  libavfilter     7.111.100 /  7.111.100
  libswscale      5. 10.100 /  5. 10.100
  libswresample   3. 10.100 /  3. 10.100
[h264 @ 000001c5ae94b300] concealing 1040 DC, 1040 AC, 1040 MV errors in P frame
[rtsp @ 000001c5b0115700] decoding for stream 0 failed
Input #0, rtsp, from 'rtsp://10.101.0.100:8554/live':
  Metadata:
    title           : Stream
  Duration: N/A, bitrate: N/A
  Stream #0:0: Video: h264 (Constrained Baseline), yuv420p(tv, bt470bg/unknown/unknown, progressive), 640x480, 30 fps, 30 tbr, 90k tbn, 60 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))
Press [q] to stop, [?] for help
[h264 @ 000001c5b071f000] concealing 1040 DC, 1040 AC, 1040 MV errors in P frame
Output #0, rawvideo, to 'pipe:':
  Metadata:
    title           : Stream
    encoder         : Lavf58.77.100
  Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24(pc, bt470bg/unknown/unknown, progressive), 640x480, q=2-31, 221184 kb/s, 30 fps, 30 tbn
    Metadata:
      encoder         : Lavc58.135.100 rawvideo
Can't start stream.
av_interleaved_write_frame(): Broken pipe
Error writing trailer of pipe:: Broken pipetime=00:00:07.76 bitrate= 949.3kbits/s speed=2.82x
frame=    1 fps=0.1 q=-0.0 Lsize=     900kB time=00:00:07.76 bitrate= 949.3kbits/s speed=0.775x
video:900kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
Conversion failed!
hipersayanX commented 3 years ago

What is the output of this command? .\AkVCamManager.exe dump

markednmbr1 commented 3 years ago
PS C:\Program Files\AkVirtualCamera.plugin\x64> .\AkVCamManager.exe dump
<?xml version="1.0" encoding="UTF-8" ?>
<info>
    <devices>
        <device>
            <id>AkVCamVideoDevice0</id>
            <description>Test Webcam</description>
            <formats>
                <format>
                    <pixel-format>RGB24</pixel-format>
                    <width>640</width>
                    <height>480</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>RGB24</pixel-format>
                    <width>640</width>
                    <height>360</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>RGB24</pixel-format>
                    <width>640</width>
                    <height>360</height>
                    <fps>15/1</fps>
                </format>
            </formats>
            <controls>
                <control>
                    <id>hflip</id>
                    <description>Horizontal Mirror</description>
                    <type>Boolean</type>
                    <minimum>0</minimum>
                    <maximum>1</maximum>
                    <step>1</step>
                    <default-value>0</default-value>
                    <value>0</value>
                </control>
                <control>
                    <id>vflip</id>
                    <description>Vertical Mirror</description>
                    <type>Boolean</type>
                    <minimum>0</minimum>
                    <maximum>1</maximum>
                    <step>1</step>
                    <default-value>0</default-value>
                    <value>0</value>
                </control>
                <control>
                    <id>scaling</id>
                    <description>Scaling</description>
                    <type>Menu</type>
                    <minimum>0</minimum>
                    <maximum>1</maximum>
                    <step>1</step>
                    <default-value>0</default-value>
                    <value>0</value>
                    <menu>
                        <item>Fast</item>
                        <item>Linear</item>
                    </menu>
                </control>
                <control>
                    <id>aspect_ratio</id>
                    <description>Aspect Ratio</description>
                    <type>Menu</type>
                    <minimum>0</minimum>
                    <maximum>2</maximum>
                    <step>1</step>
                    <default-value>0</default-value>
                    <value>0</value>
                    <menu>
                        <item>Ignore</item>
                        <item>Keep</item>
                        <item>Expanding</item>
                    </menu>
                </control>
                <control>
                    <id>swap_rgb</id>
                    <description>Swap RGB</description>
                    <type>Boolean</type>
                    <minimum>0</minimum>
                    <maximum>1</maximum>
                    <step>1</step>
                    <default-value>0</default-value>
                    <value>0</value>
                </control>
            </controls>
        </device>
        <device>
            <id>C:/msys64/akvcam/video0</id>
            <description>Webcam Test</description>
            <formats>
                <format>
                    <pixel-format>YUY2</pixel-format>
                    <width>640</width>
                    <height>480</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>YUY2</pixel-format>
                    <width>160</width>
                    <height>120</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>YUY2</pixel-format>
                    <width>320</width>
                    <height>240</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>YUY2</pixel-format>
                    <width>800</width>
                    <height>600</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>YUY2</pixel-format>
                    <width>1280</width>
                    <height>720</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>YUY2</pixel-format>
                    <width>1920</width>
                    <height>1080</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>UYVY</pixel-format>
                    <width>640</width>
                    <height>480</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>UYVY</pixel-format>
                    <width>160</width>
                    <height>120</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>UYVY</pixel-format>
                    <width>320</width>
                    <height>240</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>UYVY</pixel-format>
                    <width>800</width>
                    <height>600</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>UYVY</pixel-format>
                    <width>1280</width>
                    <height>720</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>UYVY</pixel-format>
                    <width>1920</width>
                    <height>1080</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>RGB32</pixel-format>
                    <width>640</width>
                    <height>480</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>RGB32</pixel-format>
                    <width>160</width>
                    <height>120</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>RGB32</pixel-format>
                    <width>320</width>
                    <height>240</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>RGB32</pixel-format>
                    <width>800</width>
                    <height>600</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>RGB32</pixel-format>
                    <width>1280</width>
                    <height>720</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>RGB32</pixel-format>
                    <width>1920</width>
                    <height>1080</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>RGB24</pixel-format>
                    <width>640</width>
                    <height>480</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>RGB24</pixel-format>
                    <width>160</width>
                    <height>120</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>RGB24</pixel-format>
                    <width>320</width>
                    <height>240</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>RGB24</pixel-format>
                    <width>800</width>
                    <height>600</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>RGB24</pixel-format>
                    <width>1280</width>
                    <height>720</height>
                    <fps>30/1</fps>
                </format>
                <format>
                    <pixel-format>RGB24</pixel-format>
                    <width>1920</width>
                    <height>1080</height>
                    <fps>30/1</fps>
                </format>
            </formats>
            <controls>
                <control>
                    <id>hflip</id>
                    <description>Horizontal Mirror</description>
                    <type>Boolean</type>
                    <minimum>0</minimum>
                    <maximum>1</maximum>
                    <step>1</step>
                    <default-value>0</default-value>
                    <value>0</value>
                </control>
                <control>
                    <id>vflip</id>
                    <description>Vertical Mirror</description>
                    <type>Boolean</type>
                    <minimum>0</minimum>
                    <maximum>1</maximum>
                    <step>1</step>
                    <default-value>0</default-value>
                    <value>0</value>
                </control>
                <control>
                    <id>scaling</id>
                    <description>Scaling</description>
                    <type>Menu</type>
                    <minimum>0</minimum>
                    <maximum>1</maximum>
                    <step>1</step>
                    <default-value>0</default-value>
                    <value>0</value>
                    <menu>
                        <item>Fast</item>
                        <item>Linear</item>
                    </menu>
                </control>
                <control>
                    <id>aspect_ratio</id>
                    <description>Aspect Ratio</description>
                    <type>Menu</type>
                    <minimum>0</minimum>
                    <maximum>2</maximum>
                    <step>1</step>
                    <default-value>0</default-value>
                    <value>0</value>
                    <menu>
                        <item>Ignore</item>
                        <item>Keep</item>
                        <item>Expanding</item>
                    </menu>
                </control>
                <control>
                    <id>swap_rgb</id>
                    <description>Swap RGB</description>
                    <type>Boolean</type>
                    <minimum>0</minimum>
                    <maximum>1</maximum>
                    <step>1</step>
                    <default-value>0</default-value>
                    <value>0</value>
                </control>
            </controls>
        </device>
    </devices>
    <input-formats>
        <pixel-format>RGB24</pixel-format>
    </input-formats>
    <default-input-format>RGB24</default-input-format>
    <output-formats>
        <pixel-format>RGB32</pixel-format>
        <pixel-format>RGB24</pixel-format>
        <pixel-format>RGB16</pixel-format>
        <pixel-format>RGB15</pixel-format>
        <pixel-format>UYVY</pixel-format>
        <pixel-format>YUY2</pixel-format>
        <pixel-format>NV12</pixel-format>
    </output-formats>
    <default-output-format>YUY2</default-output-format>
    <clients>
    </clients>
    <picture></picture>
    <loglevel>-1</loglevel>
</info>
markednmbr1 commented 3 years ago

Quick question before we continue - does this akvirtualcamera provide both Video and Audio? or is it only Video?

hipersayanX commented 3 years ago

This one could be the conflicting device:

<id>C:/msys64/akvcam/video0</id>
<description>Webcam Test</description>

Everything else seems to be fine. Try removing all devices

.\AkVCamManager.exe remove-devices
.\AkVCamManager.exe update 

Check that the device does not appears anymore in the dump command, and try creating a new device again.

Quick question before we continue - does this akvirtualcamera provide both Video and Audio? or is it only Video?

Video only. Virtual mic will come much, much later when I implement audio effects.

hipersayanX commented 3 years ago

This issue should have been fixed by now. Closing.