mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-24 10:16:09 +00:00
fix(remove ffv1): removing ffv1 as it does not support MP4
This commit is contained in:
@@ -181,8 +181,8 @@ lerobot-edit-dataset \
|
|||||||
lerobot-edit-dataset \
|
lerobot-edit-dataset \
|
||||||
--repo_id lerobot/pusht_depth \
|
--repo_id lerobot/pusht_depth \
|
||||||
--operation.type reencode_videos \
|
--operation.type reencode_videos \
|
||||||
--operation.rgb_encoder.vcodec libx264 \
|
--operation.rgb_encoder.vcodec h264 \
|
||||||
--operation.depth_encoder.vcodec ffv1
|
--operation.depth_encoder.crf 50
|
||||||
```
|
```
|
||||||
|
|
||||||
**Parameters:**
|
**Parameters:**
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ lerobot-record \
|
|||||||
|
|
||||||
| Parameter | Type | Default | Description |
|
| Parameter | Type | Default | Description |
|
||||||
| ----------- | ------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------- |
|
| ----------- | ------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `vcodec` | `str` | `"hevc"` | Defaults to HEVC Main 12 (a 12-bit-capable codec). `ffv1` is a lossless alternative. |
|
| `vcodec` | `str` | `"hevc"` | Defaults to HEVC Main 12 (a 12-bit-capable codec). For a lossless depth stream, keep HEVC and pass `extra_options={"x265-params": "lossless=1"}` (stays MP4-compatible). |
|
||||||
| `pix_fmt` | `str` | `"gray12le"` | Single-channel 12-bit pixel format used to carry the quantized codes. |
|
| `pix_fmt` | `str` | `"gray12le"` | Single-channel 12-bit pixel format used to carry the quantized codes. |
|
||||||
| `depth_min` | `float` | `0.01` | Depth in metres mapped to quantum `0`. Values below are clipped on decode. |
|
| `depth_min` | `float` | `0.01` | Depth in metres mapped to quantum `0`. Values below are clipped on decode. |
|
||||||
| `depth_max` | `float` | `10.0` | Depth in metres mapped to quantum `4095`. Values above are clipped on decode. |
|
| `depth_max` | `float` | `10.0` | Depth in metres mapped to quantum `4095`. Values above are clipped on decode. |
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ HW_VIDEO_CODECS = [
|
|||||||
"h264_qsv", # Intel Quick Sync
|
"h264_qsv", # Intel Quick Sync
|
||||||
]
|
]
|
||||||
VALID_VIDEO_CODECS: frozenset[str] = frozenset(
|
VALID_VIDEO_CODECS: frozenset[str] = frozenset(
|
||||||
{"h264", "hevc", "libsvtav1", "ffv1", "auto", *HW_VIDEO_CODECS}
|
{"h264", "hevc", "libsvtav1", "auto", *HW_VIDEO_CODECS}
|
||||||
)
|
)
|
||||||
# Aliases for legacy video codec names.
|
# Aliases for legacy video codec names.
|
||||||
VIDEO_CODECS_ALIASES: dict[str, str] = {"av1": "libsvtav1"}
|
VIDEO_CODECS_ALIASES: dict[str, str] = {"av1": "libsvtav1"}
|
||||||
@@ -234,10 +234,6 @@ class VideoEncoderConfig:
|
|||||||
elif self.vcodec == "h264_qsv":
|
elif self.vcodec == "h264_qsv":
|
||||||
set_if("global_quality", self.crf)
|
set_if("global_quality", self.crf)
|
||||||
set_if("preset", self.preset)
|
set_if("preset", self.preset)
|
||||||
elif self.vcodec == "ffv1":
|
|
||||||
# Lossless intra-frame codec. ``crf``/``preset``/``fast_decode``
|
|
||||||
# are not meaningful.
|
|
||||||
set_if("threads", encoder_threads)
|
|
||||||
else:
|
else:
|
||||||
set_if("crf", self.crf)
|
set_if("crf", self.crf)
|
||||||
set_if("preset", self.preset)
|
set_if("preset", self.preset)
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ def quantize_depth(
|
|||||||
|
|
||||||
Depth maps are packed into 12-bit integer frames so they fit in standard
|
Depth maps are packed into 12-bit integer frames so they fit in standard
|
||||||
high-bit-depth pixel formats (e.g. ``yuv420p12le`` / ``gray12le``)
|
high-bit-depth pixel formats (e.g. ``yuv420p12le`` / ``gray12le``)
|
||||||
and can be encoded by widely supported video codecs (HEVC Main 12, ffv1).
|
and can be encoded by widely supported video codecs (e.g. HEVC Main 12).
|
||||||
Logarithmic quantization is the default because it allocates more quanta
|
Logarithmic quantization is the default because it allocates more quanta
|
||||||
to near-range depth, which matches the (1/depth) error profile of typical
|
to near-range depth, which matches the (1/depth) error profile of typical
|
||||||
depth sensors. Math is ported from BEHAVIOR-1K's ``obs_utils.py``.
|
depth sensors. Math is ported from BEHAVIOR-1K's ``obs_utils.py``.
|
||||||
|
|||||||
@@ -224,8 +224,8 @@ Re-encode both RGB and depth videos in a dataset (depth quantization params are
|
|||||||
lerobot-edit-dataset \
|
lerobot-edit-dataset \
|
||||||
--repo_id lerobot/pusht_depth \
|
--repo_id lerobot/pusht_depth \
|
||||||
--operation.type reencode_videos \
|
--operation.type reencode_videos \
|
||||||
--operation.rgb_encoder.vcodec libx264 \
|
--operation.rgb_encoder.vcodec h264 \
|
||||||
--operation.depth_encoder.vcodec ffv1
|
--operation.depth_encoder.extra_options '{"x265-params": "lossless=1"}'
|
||||||
|
|
||||||
Using JSON config file:
|
Using JSON config file:
|
||||||
lerobot-edit-dataset \
|
lerobot-edit-dataset \
|
||||||
|
|||||||
@@ -1531,7 +1531,6 @@ def test_valid_video_codecs_constant():
|
|||||||
assert "h264" in VALID_VIDEO_CODECS
|
assert "h264" in VALID_VIDEO_CODECS
|
||||||
assert "hevc" in VALID_VIDEO_CODECS
|
assert "hevc" in VALID_VIDEO_CODECS
|
||||||
assert "libsvtav1" in VALID_VIDEO_CODECS
|
assert "libsvtav1" in VALID_VIDEO_CODECS
|
||||||
assert "ffv1" in VALID_VIDEO_CODECS
|
|
||||||
assert "auto" in VALID_VIDEO_CODECS
|
assert "auto" in VALID_VIDEO_CODECS
|
||||||
assert "h264_videotoolbox" in VALID_VIDEO_CODECS
|
assert "h264_videotoolbox" in VALID_VIDEO_CODECS
|
||||||
assert "h264_nvenc" in VALID_VIDEO_CODECS
|
assert "h264_nvenc" in VALID_VIDEO_CODECS
|
||||||
@@ -1539,7 +1538,7 @@ def test_valid_video_codecs_constant():
|
|||||||
assert "h264_qsv" in VALID_VIDEO_CODECS
|
assert "h264_qsv" in VALID_VIDEO_CODECS
|
||||||
assert "hevc_videotoolbox" in VALID_VIDEO_CODECS
|
assert "hevc_videotoolbox" in VALID_VIDEO_CODECS
|
||||||
assert "hevc_nvenc" in VALID_VIDEO_CODECS
|
assert "hevc_nvenc" in VALID_VIDEO_CODECS
|
||||||
assert len(VALID_VIDEO_CODECS) == 11
|
assert len(VALID_VIDEO_CODECS) == 10
|
||||||
|
|
||||||
|
|
||||||
def test_delta_timestamps_with_episodes_filter(tmp_path, empty_lerobot_dataset_factory):
|
def test_delta_timestamps_with_episodes_filter(tmp_path, empty_lerobot_dataset_factory):
|
||||||
|
|||||||
@@ -123,15 +123,15 @@ class TestDepthEncoderParsing:
|
|||||||
"test/repo",
|
"test/repo",
|
||||||
"--operation.type",
|
"--operation.type",
|
||||||
"reencode_videos",
|
"reencode_videos",
|
||||||
"--operation.depth_encoder.vcodec",
|
"--operation.depth_encoder.extra_options",
|
||||||
"ffv1",
|
'{"x265-params": "lossless=1"}',
|
||||||
"--operation.depth_encoder.depth_max",
|
"--operation.depth_encoder.depth_max",
|
||||||
"12.0",
|
"12.0",
|
||||||
"--operation.depth_encoder.use_log",
|
"--operation.depth_encoder.use_log",
|
||||||
"false",
|
"false",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
assert cfg.operation.depth_encoder.vcodec == "ffv1"
|
assert cfg.operation.depth_encoder.extra_options == {"x265-params": "lossless=1"}
|
||||||
assert cfg.operation.depth_encoder.depth_max == 12.0
|
assert cfg.operation.depth_encoder.depth_max == 12.0
|
||||||
assert cfg.operation.depth_encoder.use_log is False
|
assert cfg.operation.depth_encoder.use_log is False
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user