Skip to content

Commit

Permalink
Add remaining log and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
DerouineauNicolas committed May 7, 2024
1 parent f91b4a4 commit 9bf4b84
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 8 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: dev

on:
push:
branches-ignore:
- master

jobs:

build:

runs-on: ubuntu-latest

steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Build and export to Docker
uses: docker/build-push-action@v3
with:
context: .
file: ./backend/Dockerfile.prod
load: true
tags: webmultimedia/http-streaming-server:master
-
name: Test
run: |
cp -r tests/* Videos/
docker-compose -f docker-compose-prod.yml run --rm web ./wait-for-it.sh db:5432 -- python3 manage.py test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker Image CI
name: master

on:
push:
Expand Down
12 changes: 8 additions & 4 deletions backend/StreamServerApp/media_management/frame_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import json
from StreamServerApp.media_management.subprocess_wrapper import run_subprocess

import logging

logger = logging.getLogger("root")


class BFrame(object):
Expand Down Expand Up @@ -115,8 +118,9 @@ def keyframe_analysis(filename):

if gops_duration_in_frames.count(gops_duration_in_frames[0]) == len(gops_duration_in_frames) - 1:
regular_duration = True

if regular_duration:
for gop in gops:
logger.debug(gop)

#for gop in gops:
# print(gop)

return (regular_duration, gops_duration_in_frames[0])
return (regular_duration, gops_duration_in_frames[0])
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
from StreamingServer.settings import customstderr, customstdout
import subprocess
import logging
logger = logging.getLogger("root")


def run_subprocess(cmd):
completed_process_instance = subprocess.run(cmd, stdout=customstdout,
stderr=customstderr)
if completed_process_instance.returncode != 0:
print("An error occured while running ffmpeg subprocess")
logger.error("An error occured while running ffmpeg subprocess")
if (completed_process_instance.stderr):
print(completed_process_instance.stderr.decode())
logger.error(completed_process_instance.stderr.decode())
if (completed_process_instance.stdout):
print(completed_process_instance.stdout.decode())
logger.error(completed_process_instance.stdout.decode())

raise Exception('ffmpeg_error', 'error')

Expand Down

0 comments on commit 9bf4b84

Please sign in to comment.