mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 16:23:46 +08:00
minimal ffmpeg build (#36138)
* min ffmpeg * remove avfilter * x264 * merge x264 * simpler * pin x264 * mac * rm that * lil more * move includes to lfs * try this * cleanup * larch --------- Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
Import('env', 'arch', 'messaging', 'common', 'visionipc')
|
||||
|
||||
libs = [common, messaging, visionipc,
|
||||
'avformat', 'avcodec', 'avutil',
|
||||
'yuv', 'OpenCL', 'pthread', 'zstd']
|
||||
'yuv', 'OpenCL', 'pthread', 'zstd',
|
||||
'avformat', 'avcodec', 'avutil', 'x264']
|
||||
|
||||
src = ['logger.cc', 'zstd_writer.cc', 'video_writer.cc', 'encoder/encoder.cc', 'encoder/v4l_encoder.cc', 'encoder/jpeg_encoder.cc']
|
||||
if arch != "larch64":
|
||||
|
||||
@@ -316,8 +316,18 @@ class TestLoggerd:
|
||||
self._publish_camera_and_audio_messages()
|
||||
|
||||
qcamera_ts_path = os.path.join(self._get_latest_log_dir(), 'qcamera.ts')
|
||||
ffprobe_cmd = f"ffprobe -i {qcamera_ts_path} -show_streams -select_streams a -loglevel error"
|
||||
has_audio_stream = subprocess.run(ffprobe_cmd, shell=True, capture_output=True).stdout.strip() != b''
|
||||
|
||||
# simplest heuristic: look for AAC ADTS syncwords in the TS file
|
||||
def ts_has_audio_stream(ts_path: str) -> bool:
|
||||
try:
|
||||
with open(ts_path, 'rb') as f:
|
||||
data = f.read()
|
||||
# ADTS headers typically start with 0xFFF1 or 0xFFF9
|
||||
return (b"\xFF\xF1" in data) or (b"\xFF\xF9" in data)
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
has_audio_stream = ts_has_audio_stream(qcamera_ts_path)
|
||||
assert has_audio_stream == record_audio
|
||||
|
||||
raw_audio_in_rlog = any(m.which() == 'rawAudioData' for m in LogReader(os.path.join(self._get_latest_log_dir(), 'rlog.zst')))
|
||||
|
||||
Reference in New Issue
Block a user