Skip to content

Commit

Permalink
Don't use_wallclock_as_timestamps #1175 #1196 #1194 #1193 #1186
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlt8 committed May 15, 2024
1 parent ed82bda commit 6568c83
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 4 additions & 1 deletion app/wyzebridge/ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def get_ffmpeg_cmd(
- list of str: complete ffmpeg command that is ready to run as subprocess.
"""

flags = "-fflags +flush_packets+nobuffer -flags +low_delay -use_wallclock_as_timestamps 1"
flags = "-fflags +flush_packets+nobuffer -flags +low_delay"
livestream = get_livestream_cmd(uri)
audio_in = "-f lavfi -i anullsrc=cl=mono" if livestream else ""
audio_out = "aac"
Expand Down Expand Up @@ -62,6 +62,9 @@ def get_ffmpeg_cmd(
+ re_encode_video(uri, is_vertical)
+ (["-map", "1:a", "-c:a", audio_out] if audio_in else [])
+ (a_options if audio and audio_out != "copy" else [])
+ ["-fps_mode", "drop", "-async", "1", "-flush_packets", "1"]
+ ["-muxdelay", "0"]
+ ["-rtbufsize", "1", "-max_interleave_delta", "10"]
+ ["-f", "tee"]
+ [rtsp_ss + get_record_cmd(uri, audio_out, record) + livestream]
)
Expand Down
5 changes: 2 additions & 3 deletions app/wyzecam/iotc.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def sleep_interval(self) -> float:
return 0

if not self.frame_ts:
return 1 / 150
return 1 / 100

fps = 1 / self.preferred_frame_rate * 0.95
delta = max(time.time() - self.frame_ts, 0.0)
Expand Down Expand Up @@ -638,8 +638,7 @@ def _audio_frame_slow(self, frame_info) -> Optional[bool]:

if gap < -1:
logger.debug(f"[audio] behind video.. {gap=}")
self.tutk_platform_lib.avClientCleanAudioBuf(self.av_chan_id)
return True
self.flush_pipe("audio")

if gap > 1:
logger.debug(f"[audio] ahead of video.. {gap=}")
Expand Down

0 comments on commit 6568c83

Please sign in to comment.