Comments (7)
Unfortunately I haven’t an Apple machine for testing, and there are no automated tests. I’m even surprised it could compile without issue. I’ve got a nano ARM computer at home, I’ll see if I can install Vapoursynth and fmtconv on it, but I will be AFK within the next two weeks. In the meantime, it would be very helpful if you could nail down the culprit function and parameters.
from fmtconv.
Why is that surprising? There was issue (#30) fixed October last year to allow compilation on m1 macOS.
I will try to nail the problem down, in case that's relevant: For compilation clang 13.1.6 is used on the Mac I experienced this problem.
from fmtconv.
I traced it down: Only the resample
function seems to be affected, no matter if changing bitdepth or size for different input formats. For YUV the colors are completly wrong (it's all green), for RGB everything is way to dark.
from fmtconv.
This is a surprise because without regular testing, code can break at any time and I’m excellent at breaking working code!
Thanks for the tests. This is probably a scale issue, I’ll check ARM code when I return.
from fmtconv.
Tested on MacBook Pro 2021 M1 Max, macOS 12.6, both Apple's compiler and LLVM from homebrew:
Apple clang version 14.0.0 (clang-1400.0.29.102)
Homebrew clang version 15.0.3
Using the sample code:
from vapoursynth import core
import vapoursynth as vs
core.std.LoadPlugin(path="libfmtconv.dylib")
core.std.LoadPlugin(path="/opt/homebrew/Cellar/ffms2/2.40_3/lib/libffms2.4.dylib")
clip = core.ffms2.Source(source="sample.mp4")
clip = clip.fmtc.resample(css="444")
clip = clip.fmtc.matrix(mat="709", col_fam=vs.RGB)
clip = clip.fmtc.bitdepth(bits=BITS)
clip = clip.fmtc.matrix(mat="709", col_fam=vs.YUV)
clip = clip.fmtc.resample(css="420")
clip = clip.fmtc.bitdepth(bits=8)
clip.set_output()
Input video ffprobe:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sample.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf59.27.100
Duration: 00:01:12.22, start: 0.000000, bitrate: 1372 kb/s
Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 1241 kb/s, 12 fps, 12 tbr, 12288 tbn (default)
Metadata:
handler_name : ISO Media file produced by Google Inc. Created on: 05/16/2019.
vendor_id : [0][0][0][0]
Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
Metadata:
handler_name : ISO Media file produced by Google Inc. Created on: 05/16/2019.
vendor_id : [0][0][0][0]
Then executing:
vspipe -c y4m main.py - | mpv -
Results for BITS
:
And another scenario:
from vapoursynth import core
import vapoursynth as vs
core.std.LoadPlugin(path="libfmtconv.dylib")
core.std.LoadPlugin(path="/opt/homebrew/Cellar/ffms2/2.40_3/lib/libffms2.4.dylib")
clip = core.ffms2.Source(source="sample.mp4")
clip = clip.fmtc.bitdepth(bits=BITS)
clip.set_output()
16 and 32 bits seem to work great. But with 8 bits:
Happy to run any further tests.
from fmtconv.
I found a workaround for colorspace conversion that is built-in and works on arm64:
# to RGB
clip = core.resize.Bicubic(clip, format=vs.RGBS, matrix_in_s="709")
# to YUV
clip = vs.core.resize.Bicubic(clip, format=vs.YUV420P8, matrix_s="709")
from fmtconv.
Part of the problems above might be fixed by #40. Conversion from int to float on Apple M1 returns the wrong result.
@ViRb3 @Stefan-Olt would you please check this?
from fmtconv.
Related Issues (20)
- fmtc.bitdepth(bits=14) does not work HOT 2
- Segfault on FreeBSD - debug build has undefined symbol at runtime HOT 2
- Problem with spline16 HOT 9
- "cannot find avstp.dll.Usage restricted to single threading" debug message in vapoursynth HOT 3
- bitdepth() does not set _ColorRange property after conversion HOT 3
- Matrix col_fam and the cm* constants in future VS versions HOT 8
- r24 fails to build on IA32 (32-bit x86) HOT 2
- cplaced (avs+) HOT 2
- vapoursynth.Error: transfer: Function does not take argument(s) named logceis, logceid HOT 1
- Matrix will raise error when convert between RGB and OPP HOT 1
- matrix: unsupported color family for output. HOT 1
- transfer: Vapoursynth crash when use r26 HOT 1
- Feature request: convert YV12 interlaced <--> YV12 progressive HOT 3
- Fail to build on m1 macOS. HOT 3
- version 27 fail to build with static assertion failed: 128-bit atomic operations are not lock-fre HOT 9
- error: '_mm_storeu_si32' was not declared in this scope; did you mean '_mm_storeu_si64'? HOT 3
- recipe for target '../../src/fmtcl/libavx2_la-TransLut_avx2.lo' failed HOT 2
- Typo in src/fstb/Vu32.hpp HOT 1
- Catch i14 input in fmtc.resample HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fmtconv.