ws-video: video/avi tests (OpenDML / idx1 / scan, PCM / ADPCM / MP2 audio, raw RGB / I420, mux round trip), video/y4m tests (every C tag, 10-bit, writer), empty audio chunks are padding
This commit is contained in:
1 parent
9411cd97c6
commit
d221bb5327
9 files changed
+402
-9
No files matched your search
@@ -58,9 +58,11 @@ def packets(path):
|
||||
return out
|
||||
|
||||
|
||||
def yuv_frames(path, w, h, extra=None):
|
||||
"""the first video stream decoded by ffmpeg to yuv420p: a list of frame bytes"""
|
||||
raw = ffmpeg(["-i", path] + (extra or []) + ["-map", "0:v:0", "-f", "rawvideo", "-pix_fmt", "yuv420p", "-"])
|
||||
def yuv_frames(path, w, h, extra=None, codec=None):
|
||||
"""the first video stream decoded by ffmpeg to yuv420p (yuvj420p for MJPEG: full range, no conversion): a list of
|
||||
frame bytes"""
|
||||
pix = "yuvj420p" if codec == "mjpeg" else "yuv420p"
|
||||
raw = ffmpeg(["-i", path] + (extra or []) + ["-map", "0:v:0", "-f", "rawvideo", "-pix_fmt", pix, "-"])
|
||||
n = w * h + 2 * ((w + 1) // 2) * ((h + 1) // 2)
|
||||
return [raw[i:i + n] for i in range(0, len(raw) - n + 1, n)]
|
||||
|
||||
|
||||
Reference in new issue
Block a user