Skip to content

Commit

Permalink
blurry
Browse files Browse the repository at this point in the history
  • Loading branch information
XdoctorwhoZ committed Nov 26, 2023
1 parent 0a8e58e commit 24ae428
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
7 changes: 7 additions & 0 deletions platform/panduza_platform/core/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,22 @@ async def mount_device(self, client_name, group_name, device_cfg, keep_mounted =
# ---

async def unmount_device(self, device):
self.log.info(f"Unmount device {device}")
await device.unmount_interfaces()
self.devices.remove(device)

# ---

async def unmount_all_devices(self, force=False):
self.log.warning(self.devices)
for device in self.devices:
print("PAFF ")
if force or (not device.keep_mounted):
print("!!!!!!!!!!! ", device)
await self.unmount_device(device)
else:
print("??????????? NOOO ", device)
print("ENNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNND")

# ---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import signal
import asyncio
import subprocess

Expand Down Expand Up @@ -27,30 +28,23 @@ async def _PZA_DRV_loop_init(self):

# docker run -d -p 1935:1935 -p 8080:8080 alqutami/rtmp-hls:latest-alpine


# ffmpeg -re \
# \
# -i TearsOfSteel.mp4 \
# -c:v copy \
# -r 24 -g 24 \
# -preset superfast \
# -tune zerolatency \
# -f flv rtmp://127.0.0.1:1935/live/test



# test video
# ffmpeg -f lavfi -i testsrc=duration=120:size=1280x720:rate=30 testsrc.mp4
# ffmpeg -f lavfi -i testsrc=duration=120:size=1280x720:rate=30 /etc/panduza/data/video_test.mp4

ffmpeg_command = [
'ffmpeg', '-re', '-stream_loop', '-1',
'-i', '/etc/panduza/data/video_test.mpg',
'-c:v' , 'copy',
'-r', '24', '-g', '24',
'-i', '/etc/panduza/data/video_test.mp4',
'-preset', 'superfast',
'-tune', 'zerolatency',
'-vcodec', 'libx264',
'-f', 'flv', 'rtmp://127.0.0.1:1935/live/test'
]

# ffplay -fflags nobuffer -flags low_delay -probesize 20000 -analyzeduration 1 -strict experimental -framedrop -f flv rtmp://127.0.0.1:1935/live/test

ffmpeg_cmd_string = ''
for part in ffmpeg_command:
ffmpeg_cmd_string += f"{part} "
Expand Down Expand Up @@ -106,13 +100,17 @@ async def _PZA_DRV_loop_init(self):
# if att in cmds:
# await self.__cmd_handlers[att](cmds[att])

# # ---
# ---

# async def _PZA_DRV_dying_gasp(self):
# # [REQ_ITF_PLATFORM_0020_00] - Info 'dying_gasp' field
# await self._update_attribute("info", "dying_gasp", True)
async def _PZA_DRV_dying_gasp(self):
"""Kill running process when interface down
"""
self.log.info("Stop ffmpeg stream")
self.process.send_signal(signal.SIGTERM)

# ---


# # ---

# async def __refresh_platform_data_task(self):
# """Refresh important data count
Expand Down

0 comments on commit 24ae428

Please sign in to comment.