Skip to content

Commit

Permalink
Merge pull request #30 from kaffetorsk/transcoding
Browse files Browse the repository at this point in the history
Remove audio transcoding from idle
  • Loading branch information
kaffetorsk authored Nov 2, 2024
2 parents f712176 + 939a53d commit 4b447c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ async def _start_idle_stream(self):
self.stream = await asyncio.create_subprocess_exec(
*['ffmpeg', '-re', '-stream_loop', '-1', '-i', self.idle_video,
'-c:v', 'copy',
'-c:a', 'libmp3lame', '-ar', '44100', '-b:a', '8k',
'-c:a', 'copy',
'-bsf', 'dump_extra', '-f', 'mpegts', 'pipe:'],
stdin=subprocess.DEVNULL,
stdout=self.proxy_writer,
Expand Down Expand Up @@ -356,9 +356,12 @@ async def _create_idle_video(self, image_path):
output_path = f"{self.name}-idle.mp4"

convert = await asyncio.create_subprocess_exec(
*['ffmpeg', '-loop', '1', '-i', image_path,
*['ffmpeg',
'-loop', '1', '-i', image_path,
'-f', 'lavfi', '-i', 'anullsrc=r=16000:cl=mono',
'-c:v', 'libx264', '-c:a', 'mp2', '-t', '5',
'-c:v', 'libx264',
'-c:a', 'libmp3lame', '-ar', '44100', '-b:a', '8k',
'-t', '5',
'-pix_fmt', 'yuv420p', '-r', '24', '-g', '24', '-vf',
f"scale={self.resolution[0]}:{self.resolution[1]}",
'-f', 'mpegts', '-y', output_path],
Expand Down
Binary file modified idle.mp4
Binary file not shown.

0 comments on commit 4b447c2

Please sign in to comment.