Giter Site home page Giter Site logo

InputOptions.size is missing about avane HOT 10 CLOSED

tuarua avatar tuarua commented on July 28, 2024
InputOptions.size is missing

from avane.

Comments (10)

tuarua avatar tuarua commented on July 28, 2024 1

This should now be fixed in 0.0.6 OSX / WIN version

That project sounds cool. Please feel free to raise any more issues you find, or anything that could be improved based on your extensive experience with ffmpeg, webcams etc.
One thing I would like to implement is the detection of capture devices.
I haven't yet uploaded the full source for Windows + OSX due to the large amount of dependancies/libs but c++ wrapper I wrote is there.
The swc source is there also. It gives an idea of how I am building the cli string from the as3 classes.

from avane.

tuarua avatar tuarua commented on July 28, 2024 1

Btw, I've also added the ability to add extra input and output params.
inputOptions.addExtraOptions()
OutputOptions.addExtraOptions()

The object passed should be written like AVFoundationOptions / HLSOptions. It needs a specific method ( getAsVector() )to return the params for when I construct the cli string.
You can write your own as long as it conforms. You can call the methods multiple times to add multiple different sets of extra params

var inputOptions = new InputOptions();
var object:AVFoundationOptions = new AVFoundationOptions();
inputOptions.addExtraOptions(object);

var object:HLSOptions = new HLSOptions();
OutputOptions.addExtraOptions(object);

from avane.

tuarua avatar tuarua commented on July 28, 2024

I'll add size as an input option shortly.
Regarding extra command line params, I will look into adding a method where you can add these (on both input and output)
I don't have a lot of experience with webcams dshow etc so there may be some gaps with these type of things.

Although not as elegant, AVANE does accept "classic" FFmpeg cli like strings.
avANE.encode("-i https://download.blender.org/durian/trailer/sintel_trailer-1080p.mp4 -c:v libx264" ... etc)

If I've missed something you can use this in the meantime

from avane.

Igazine avatar Igazine commented on July 28, 2024

thank you, that classicString seems to be what i just need

i'm currently working on a cross-platform live streaming app (win and mac), and i have a lot of experience with rtmp, ffmpeg, ipcams, webcams and such. just let me know if you need something to test, or anything really, i'd be happy to help

from avane.

Igazine avatar Igazine commented on July 28, 2024

Here's how it looks in the command line to detect devices (webcams)

Mac:
./ffmpeg -list_devices true -f avfoundation -i ""

Result is:

[AVFoundation input device @ 0x7f8edac00760] AVFoundation video devices:
[AVFoundation input device @ 0x7f8edac00760] [0] PocketCam 64-bit
[AVFoundation input device @ 0x7f8edac00760] [1] Microsoft® LifeCam VX-7000
[AVFoundation input device @ 0x7f8edac00760] [2] A4 TECH HD PC Camera
[AVFoundation input device @ 0x7f8edac00760] [3] ManyCam Virtual Webcam
[AVFoundation input device @ 0x7f8edac00760] [4] Capture screen 0
[AVFoundation input device @ 0x7f8edac00760] AVFoundation audio devices:
[AVFoundation input device @ 0x7f8edac00760] [0] Mobiola Microphone
[AVFoundation input device @ 0x7f8edac00760] [1] Mobiola Headphone
[AVFoundation input device @ 0x7f8edac00760] [2] A4 TECH PC Camera Audio
[AVFoundation input device @ 0x7f8edac00760] [3] PocketAudio Headphones
[AVFoundation input device @ 0x7f8edac00760] [4] PocketAudio Microphone
[AVFoundation input device @ 0x7f8edac00760] [5] Built-in Input
[AVFoundation input device @ 0x7f8edac00760] [6] Microsoft® LifeCam VX-7000
[AVFoundation input device @ 0x7f8edac00760] [7] ManyCam Virtual Microphone

Windows:
ffmpeg -list_devices true -f dshow -i dummy

Result:

[dshow @ 033679e0] DirectShow video devices (some may be both video and audio devices)
[dshow @ 033679e0]  "HD 720P Webcam"
[dshow @ 033679e0]     Alternative name "@device_pnp_\\?\usb#vid_0c45&pid_6341&mi_00#6&1bd9f31c&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global"
[dshow @ 033679e0] DirectShow audio devices
[dshow @ 033679e0]  "Microphone (USB Microphone)"
[dshow @ 033679e0]     Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\wave_{607A102B-FF36-486B-96B0-D2EC16D84AC7}"
[dshow @ 033679e0]  "Realtek Digital Input (Realtek High Definition Audio)"
[dshow @ 033679e0]     Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\wave_{D8F131DF-541E-4CF3-8767-D83B0DB655E4}"

I'm pretty sure it's easier to process the output from the source/sdk/dll/whatever instead of processing the text output.

When you're accessing the device with ffmpeg, you have to use the name like "HD 720P Webcam"

Unfortunately I don't have a linux installed at the moment, but the format is somewhat similar.

from avane.

Igazine avatar Igazine commented on July 28, 2024

To query a device's supported modes:

Mac:

./ffmpeg -f avfoundation -s 1x1 -i "A4 TECH HD PC Camera":none

Note that the audio device has to be explicitly defined even if it's none

It practically generates an error because of the unsupported 1x1 size defined, in which you can see the supported modes

Result:

[avfoundation @ 0x7faf9b80fa00] Selected video size (1x1) is not supported by the device
[avfoundation @ 0x7faf9b80fa00] Supported modes:
[avfoundation @ 0x7faf9b80fa00]   352x288@[30.000030 30.000030]fps
[avfoundation @ 0x7faf9b80fa00]   432x240@[30.000030 30.000030]fps
[avfoundation @ 0x7faf9b80fa00]   640x360@[30.000030 30.000030]fps
[avfoundation @ 0x7faf9b80fa00]   640x480@[30.000030 30.000030]fps
[avfoundation @ 0x7faf9b80fa00]   848x480@[30.000030 30.000030]fps
[avfoundation @ 0x7faf9b80fa00]   800x600@[30.000030 30.000030]fps
[avfoundation @ 0x7faf9b80fa00]   1280x720@[30.000030 30.000030]fps
[avfoundation @ 0x7faf9b80fa00]   1280x960@[14.999993 14.999993]fps
[avfoundation @ 0x7faf9b80fa00]   1600x896@[14.999993 14.999993]fps
[avfoundation @ 0x7faf9b80fa00]   1712x960@[14.999993 14.999993]fps
[avfoundation @ 0x7faf9b80fa00]   1920x1080@[30.000030 30.000030]fps
[avfoundation @ 0x7faf9b80fa00]   352x288@[30.000030 30.000030]fps
[avfoundation @ 0x7faf9b80fa00]   432x240@[30.000030 30.000030]fps
[avfoundation @ 0x7faf9b80fa00]   640x360@[30.000030 30.000030]fps
[avfoundation @ 0x7faf9b80fa00]   640x480@[30.000030 30.000030]fps
[avfoundation @ 0x7faf9b80fa00]   848x480@[14.999993 14.999993]fps
[avfoundation @ 0x7faf9b80fa00]   800x600@[14.999993 14.999993]fps

Windows:

ffmpeg -list_options true -f dshow -i video="HD 720P Webcam"

Result:

[dshow @ 030e7900] DirectShow video device options (from video devices)
[dshow @ 030e7900]  Pin "Capture" (alternative pin name "0")
[dshow @ 030e7900]   pixel_format=yuyv422  min s=640x480 fps=5 max s=640x480 fps=30
[dshow @ 030e7900]   pixel_format=yuyv422  min s=640x480 fps=5 max s=640x480 fps=30
[dshow @ 030e7900]   pixel_format=yuyv422  min s=640x360 fps=5 max s=640x360 fps=30
[dshow @ 030e7900]   pixel_format=yuyv422  min s=640x360 fps=5 max s=640x360 fps=30
[dshow @ 030e7900]   pixel_format=yuyv422  min s=544x288 fps=5 max s=544x288 fps=30
[dshow @ 030e7900]   pixel_format=yuyv422  min s=544x288 fps=5 max s=544x288 fps=30
[dshow @ 030e7900]   pixel_format=yuyv422  min s=432x240 fps=5 max s=432x240 fps=60.0002
[dshow @ 030e7900]   pixel_format=yuyv422  min s=432x240 fps=5 max s=432x240 fps=60.0002
[dshow @ 030e7900]   pixel_format=yuyv422  min s=352x288 fps=5 max s=352x288 fps=60.0002
[dshow @ 030e7900]   pixel_format=yuyv422  min s=352x288 fps=5 max s=352x288 fps=60.0002
[dshow @ 030e7900]   pixel_format=yuyv422  min s=320x240 fps=5 max s=320x240 fps=60.0002
[dshow @ 030e7900]   pixel_format=yuyv422  min s=320x240 fps=5 max s=320x240 fps=60.0002
[dshow @ 030e7900]   pixel_format=yuyv422  min s=320x176 fps=5 max s=320x176 fps=60.0002
[dshow @ 030e7900]   pixel_format=yuyv422  min s=320x176 fps=5 max s=320x176 fps=60.0002
[dshow @ 030e7900]   pixel_format=yuyv422  min s=176x144 fps=5 max s=176x144 fps=60.0002
[dshow @ 030e7900]   pixel_format=yuyv422  min s=176x144 fps=5 max s=176x144 fps=60.0002
[dshow @ 030e7900]   pixel_format=yuyv422  min s=160x120 fps=5 max s=160x120 fps=60.0002
[dshow @ 030e7900]   pixel_format=yuyv422  min s=160x120 fps=5 max s=160x120 fps=60.0002
[dshow @ 030e7900]   pixel_format=yuyv422  min s=752x416 fps=5 max s=752x416 fps=20
[dshow @ 030e7900]   pixel_format=yuyv422  min s=752x416 fps=5 max s=752x416 fps=20
[dshow @ 030e7900]   pixel_format=yuyv422  min s=800x448 fps=5 max s=800x448 fps=20
[dshow @ 030e7900]   pixel_format=yuyv422  min s=800x448 fps=5 max s=800x448 fps=20
[dshow @ 030e7900]   pixel_format=yuyv422  min s=864x480 fps=5 max s=864x480 fps=20
[dshow @ 030e7900]   pixel_format=yuyv422  min s=864x480 fps=5 max s=864x480 fps=20
[dshow @ 030e7900]   pixel_format=yuyv422  min s=800x600 fps=5 max s=800x600 fps=20
[dshow @ 030e7900]   pixel_format=yuyv422  min s=800x600 fps=5 max s=800x600 fps=20
[dshow @ 030e7900]   pixel_format=yuyv422  min s=960x544 fps=5 max s=960x544 fps=20
[dshow @ 030e7900]   pixel_format=yuyv422  min s=960x544 fps=5 max s=960x544 fps=20
[dshow @ 030e7900]   pixel_format=yuyv422  min s=1024x576 fps=5 max s=1024x576 fps=15
[dshow @ 030e7900]   pixel_format=yuyv422  min s=1024x576 fps=5 max s=1024x576 fps=15
[dshow @ 030e7900]   pixel_format=yuyv422  min s=960x720 fps=5 max s=960x720 fps=15
[dshow @ 030e7900]   pixel_format=yuyv422  min s=960x720 fps=5 max s=960x720 fps=15
[dshow @ 030e7900]   pixel_format=yuyv422  min s=1184x656 fps=5 max s=1184x656 fps=10
[dshow @ 030e7900]   pixel_format=yuyv422  min s=1184x656 fps=5 max s=1184x656 fps=10
[dshow @ 030e7900]   pixel_format=yuyv422  min s=1280x720 fps=5 max s=1280x720 fps=10
[dshow @ 030e7900]   pixel_format=yuyv422  min s=1280x720 fps=5 max s=1280x720 fps=10
[dshow @ 030e7900]   vcodec=mjpeg  min s=640x480 fps=5 max s=640x480 fps=30
[dshow @ 030e7900]   vcodec=mjpeg  min s=640x480 fps=5 max s=640x480 fps=30
[dshow @ 030e7900]   vcodec=mjpeg  min s=640x360 fps=5 max s=640x360 fps=30
[dshow @ 030e7900]   vcodec=mjpeg  min s=640x360 fps=5 max s=640x360 fps=30
[dshow @ 030e7900]   vcodec=mjpeg  min s=544x288 fps=5 max s=544x288 fps=30
[dshow @ 030e7900]   vcodec=mjpeg  min s=544x288 fps=5 max s=544x288 fps=30
[dshow @ 030e7900]   vcodec=mjpeg  min s=432x240 fps=5 max s=432x240 fps=60.0002
[dshow @ 030e7900]   vcodec=mjpeg  min s=432x240 fps=5 max s=432x240 fps=60.0002
[dshow @ 030e7900]   vcodec=mjpeg  min s=352x288 fps=5 max s=352x288 fps=60.0002
[dshow @ 030e7900]   vcodec=mjpeg  min s=352x288 fps=5 max s=352x288 fps=60.0002
[dshow @ 030e7900]   vcodec=mjpeg  min s=320x240 fps=5 max s=320x240 fps=60.0002
[dshow @ 030e7900]   vcodec=mjpeg  min s=320x240 fps=5 max s=320x240 fps=60.0002
[dshow @ 030e7900]   vcodec=mjpeg  min s=320x176 fps=5 max s=320x176 fps=60.0002
[dshow @ 030e7900]   vcodec=mjpeg  min s=320x176 fps=5 max s=320x176 fps=60.0002
[dshow @ 030e7900]   vcodec=mjpeg  min s=176x144 fps=5 max s=176x144 fps=60.0002
[dshow @ 030e7900]   vcodec=mjpeg  min s=176x144 fps=5 max s=176x144 fps=60.0002
[dshow @ 030e7900]   vcodec=mjpeg  min s=160x120 fps=5 max s=160x120 fps=60.0002
[dshow @ 030e7900]   vcodec=mjpeg  min s=160x120 fps=5 max s=160x120 fps=60.0002
[dshow @ 030e7900]   vcodec=mjpeg  min s=752x416 fps=5 max s=752x416 fps=30
[dshow @ 030e7900]   vcodec=mjpeg  min s=752x416 fps=5 max s=752x416 fps=30
[dshow @ 030e7900]   vcodec=mjpeg  min s=800x448 fps=5 max s=800x448 fps=30
[dshow @ 030e7900]   vcodec=mjpeg  min s=800x448 fps=5 max s=800x448 fps=30
[dshow @ 030e7900]   vcodec=mjpeg  min s=800x600 fps=5 max s=800x600 fps=30
[dshow @ 030e7900]   vcodec=mjpeg  min s=800x600 fps=5 max s=800x600 fps=30
[dshow @ 030e7900]   vcodec=mjpeg  min s=864x480 fps=5 max s=864x480 fps=30
[dshow @ 030e7900]   vcodec=mjpeg  min s=864x480 fps=5 max s=864x480 fps=30
[dshow @ 030e7900]   vcodec=mjpeg  min s=960x544 fps=5 max s=960x544 fps=30
[dshow @ 030e7900]   vcodec=mjpeg  min s=960x544 fps=5 max s=960x544 fps=30
[dshow @ 030e7900]   vcodec=mjpeg  min s=960x720 fps=5 max s=960x720 fps=30
[dshow @ 030e7900]   vcodec=mjpeg  min s=960x720 fps=5 max s=960x720 fps=30
[dshow @ 030e7900]   vcodec=mjpeg  min s=1024x576 fps=5 max s=1024x576 fps=30
[dshow @ 030e7900]   vcodec=mjpeg  min s=1024x576 fps=5 max s=1024x576 fps=30
[dshow @ 030e7900]   vcodec=mjpeg  min s=1184x656 fps=5 max s=1184x656 fps=30
[dshow @ 030e7900]   vcodec=mjpeg  min s=1184x656 fps=5 max s=1184x656 fps=30
[dshow @ 030e7900]   vcodec=mjpeg  min s=1280x720 fps=5 max s=1280x720 fps=30
[dshow @ 030e7900]   vcodec=mjpeg  min s=1280x720 fps=5 max s=1280x720 fps=30

from avane.

Igazine avatar Igazine commented on July 28, 2024

Note that there's 2 values for FPS, a min and a max. I've never used a minfps for a device, and I'm not sure what the device supports for example inbetween 5 and 30 fps, so I always pick the max

from avane.

Igazine avatar Igazine commented on July 28, 2024

Please note that someone can access a webcam without defining vcodec, size or pixel_format.
In this case ffmpeg accesses the webcam with its default settings ( 640x480, 30fps, mjpeg for the webcam mentioned in the comment above ), but it's usually not what you want when you want to stream to youtube for example, where the best possible quality is needed

from avane.

tuarua avatar tuarua commented on July 28, 2024

I've added getCaptureDevices() as a method.
Only implemented for Windows dshow as a start, with just the list of names and whether they are video or audio

from avane.

Igazine avatar Igazine commented on July 28, 2024

working nicely!
thank you

from avane.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.