Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix&Feature: Add pixel format auto-detect for macOS and manual specifying in ffmpeg device input params #477

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

skrashevich
Copy link
Contributor

@skrashevich skrashevich commented Jun 19, 2023

This pull request introduces support for specifying the pixel format in the ffmpeg device input parameters. This change affects the internal/ffmpeg/device/devices.go file and the README.md file. The pixel format can now be defined using the pix_fmt parameter. This update is particularly useful for macOS devices, as demonstrated in the updated example for macos_facetime in the README.

Example working configuration on latest MacOS:

streams:
  camera: "ffmpeg:device?video=0&audio=1&video_size=1280x720&framerate=30&pix_fmt=uyvy422#video=h264#audio=aac#audio=pcma"

@skrashevich skrashevich changed the title Bugfix&Feature: Add support for pixel format specification in ffmpeg device input params Bugfix&Feature: Add pixel format auto-detect for macOS and manual specifying in ffmpeg device input params Jun 19, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented Jun 29, 2023

% ffprobe -hide_banner -v error -print_format json -f avfoundation -video_size 640x480 -framerate 24 -i "FaceTime HD Camera"
{
[avfoundation @ 0x7fbabf104080] Selected framerate (24.000000) is not supported by the device.
[avfoundation @ 0x7fbabf104080] Supported modes:
[avfoundation @ 0x7fbabf104080]   1920x1080@[1.000000 30.000000]fps
[avfoundation @ 0x7fbabf104080]   1280x720@[1.000000 30.000000]fps
[avfoundation @ 0x7fbabf104080]   1080x1920@[1.000000 30.000000]fps
[avfoundation @ 0x7fbabf104080]   1760x1328@[1.000000 30.000000]fps
[avfoundation @ 0x7fbabf104080]   640x480@[1.000000 30.000000]fps
[avfoundation @ 0x7fbabf104080]   1328x1760@[1.000000 30.000000]fps
[avfoundation @ 0x7fbabf104080]   1552x1552@[1.000000 30.000000]fps
FaceTime HD Camera: Input/output error

}
% ffprobe -hide_banner -v error -print_format json -f avfoundation -i "FaceTime HD Camera" 
{
[avfoundation @ 0x7fcda3904080] Selected framerate (29.970030) is not supported by the device.
[avfoundation @ 0x7fcda3904080] Supported modes:
[avfoundation @ 0x7fcda3904080]   1920x1080@[1.000000 30.000000]fps
[avfoundation @ 0x7fcda3904080]   1280x720@[1.000000 30.000000]fps
[avfoundation @ 0x7fcda3904080]   1080x1920@[1.000000 30.000000]fps
[avfoundation @ 0x7fcda3904080]   1760x1328@[1.000000 30.000000]fps
[avfoundation @ 0x7fcda3904080]   640x480@[1.000000 30.000000]fps
[avfoundation @ 0x7fcda3904080]   1328x1760@[1.000000 30.000000]fps
[avfoundation @ 0x7fcda3904080]   1552x1552@[1.000000 30.000000]fps
FaceTime HD Camera: Input/output error

}

@AlexxIT AlexxIT force-pushed the master branch 4 times, most recently from 50492e5 to 279d8bf Compare August 20, 2023 20:41
@AlexxIT AlexxIT self-assigned this Apr 22, 2024
@AlexxIT AlexxIT added the doubt label Apr 30, 2024
@AlexxIT AlexxIT removed their assignment Apr 30, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented Apr 30, 2024

This code doesn't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants