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

Added FreeBSD binaries #913

Merged
merged 4 commits into from
Apr 29, 2024
Merged

Added FreeBSD binaries #913

merged 4 commits into from
Apr 29, 2024

Conversation

robvanoostenrijk
Copy link
Contributor

Added go2rtc binaries for FreeBSD aarch64 and amd64 variants.

Binary tested on FreeBSD 13 (amd64)

robvanoostenrijk and others added 3 commits January 29, 2024 14:20
Co-authored-by: Rob van Oostenrijk <robvanoostenrijk@noreply.users.github.com>
@AlexxIT
Copy link
Owner

AlexxIT commented Jan 30, 2024

I think avfoundation and videotoolbox not related to FreeBSD...

@robvanoostenrijk
Copy link
Contributor Author

Correct. My bad, I had taken the darwin files as a base. I'll remove the MacOS specific elements.

@robvanoostenrijk
Copy link
Contributor Author

Ok, so I connected an USB Logitech C310 camera to FreeBSD to try and update the FFMpeg integrations as best as possible.

Connecting a camera and enabling it through webcamd, exposes it as /dev/video0. So the existing Linux lookup for /dev/video* will work as-is.

FreeBSD supports v4l2, and lists the following formats:

ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video0
[video4linux2,v4l2 @ 0x85d33f280] Raw       :     yuyv422 :           YUYV 4:2:2 : 640x480 160x120 176x144 320x176 320x240 352x288 432x240 544x288 640x360 752x416 800x448 800x600 864x480 960x544 960x720 1024x576 1184x656 1280x720 1280x960
[video4linux2,v4l2 @ 0x85d33f280] Compressed:       mjpeg :          Motion-JPEG : 640x480 160x120 176x144 320x176 320x240 352x288 432x240 544x288 640x360 752x416 800x448 800x600 864x480 960x544 960x720 1024x576 1184x656 1280x720 1280x960

For reference, I successfully recorded and validated video output with this test command:

ffmpeg -f v4l2 -standard PAL -i /dev/video0 -c:v libx264 -preset ultrafast -crf 0 output.mkv
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 1706627779.152476, bitrate: 147456 kb/s
  Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 147456 kb/s, 30 fps, 30 tbr, 1000k tbn

Audio (uaudio0) is exposed through /dev/pcmX, but ffmpeg can pull this directly from the /dev/dsp mixer device.

For reference, I successfully recorded and validated audio output with this test command:

ffmpeg -hide_banner -f oss -i /dev/dsp -t 10 output.wav
Input #0, oss, from '/dev/dsp':
  Duration: N/A, start: 1706627747.891905, bitrate: 1536 kb/s
  Stream #0:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s

I've updated (hopefully correctly) device_freebsd.go and hardware_freebsd.go to reflect the above findings.

@AlexxIT AlexxIT self-assigned this Apr 22, 2024
@AlexxIT AlexxIT merged commit 070ea38 into AlexxIT:master Apr 29, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented Apr 29, 2024

Thanks!

@AlexxIT AlexxIT added this to the v1.9.0 milestone Apr 29, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented Apr 30, 2024

@robvanoostenrijk
Copy link
Contributor Author

I saw the FreeBSD binaries weren't there.

Logs say it did compile though.

Working artifact upload:

Run actions/upload-artifact@v4
  with:
    name: go[2](https://github.com/AlexxIT/go2rtc/actions/runs/8894698328/job/24423495640#step:25:2)rtc_mac_arm64
    path: go2rtc
    if-no-files-found: warn
    compression-level: 6
    overwrite: false
  env:
    CGO_ENABLED: 0
With the provided path, there will be 1 file uploaded
Artifact name is valid!
Root directory input is valid!
Beginning upload of artifact content to blob storage
Uploaded bytes 580[3](https://github.com/AlexxIT/go2rtc/actions/runs/8894698328/job/24423495640#step:25:3)444
Finished uploading artifact content to blob storage!
SHA256 hash of uploaded artifact zip is b9c[4](https://github.com/AlexxIT/go2rtc/actions/runs/8894698328/job/24423495640#step:25:4)5d1e0ce448037f[5](https://github.com/AlexxIT/go2rtc/actions/runs/8894698328/job/24423495640#step:25:5)02fd9d2c6172f66cb17250ac8bb0de0723ee[6](https://github.com/AlexxIT/go2rtc/actions/runs/8894698328/job/24423495640#step:25:6)6c0965a8
Finalizing artifact upload
Artifact go2rtc_mac_arm64.zip successfully finalized. Artifact ID 146036[7](https://github.com/AlexxIT/go2rtc/actions/runs/8894698328/job/24423495640#step:25:7)517
Artifact go2rtc_mac_arm64 has been successfully uploaded! Final size is 5[8](https://github.com/AlexxIT/go2rtc/actions/runs/8894698328/job/24423495640#step:25:8)03444 bytes. Artifact ID is 1460367517
Artifact download URL: https://github.com/AlexxIT/go2rtc/actions/runs/88[9](https://github.com/AlexxIT/go2rtc/actions/runs/8894698328/job/24423495640#step:25:9)4698328/artifacts/1460367517

Not working:

Run actions/upload-artifact@v3
  with:
    name: go[2](https://github.com/AlexxIT/go2rtc/actions/runs/8894698328/job/24423495640#step:29:2)rtc_freebsd_arm64
    path: go2rtc
    if-no-files-found: warn
  env:
    CGO_ENABLED: 0
With the provided path, there will be 1 file uploaded
Starting artifact upload
For more detailed logs during the artifact upload process, enable step-debugging: https://docs.github.com/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging
Artifact name is valid!
Container for artifact "go2rtc_freebsd_arm64" successfully created. Starting upload of file(s)
Total size of all the files uploaded is 5[3](https://github.com/AlexxIT/go2rtc/actions/runs/8894698328/job/24423495640#step:29:3)17932 bytes
File upload process has finished. Finalizing the artifact upload
Artifact has been finalized. All files have been successfully uploaded!

The raw size of all the files that were specified for upload is 13893632 bytes
The size of all the files that were uploaded is 5317932 bytes. This takes into account any gzip compression used to reduce the upload size, time and storage

Note: The size of downloaded zips can differ significantly from the reported size. For more information see: https://github.com/actions/upload-artifact#zipped-artifact-downloads 

Artifact go2rtc_freebsd_arm6[4](https://github.com/AlexxIT/go2rtc/actions/runs/8894698328/job/24423495640#step:29:4) has been successfully uploaded!

Perhaps update actions/upload-artifact@v3 to actions/upload-artifact@v4?
That's the only glaring difference I can see.

@AlexxIT
Copy link
Owner

AlexxIT commented May 1, 2024

I can see freebsd nightly images
https://nightly.link/AlexxIT/go2rtc/workflows/build/master

@robvanoostenrijk
Copy link
Contributor Author

I can update my fork and see if changing the upload-artifact change triggers it.

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

Successfully merging this pull request may close these issues.

None yet

2 participants