최지우

merge branch

# Generated by Django 3.1.2 on 2020-11-20 01:49
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='AddDevice',
fields=[
('id', models.IntegerField(primary_key=True, serialize=False)),
('state', models.BooleanField(default=False)),
],
),
migrations.CreateModel(
name='Device',
fields=[
('device_id', models.AutoField(primary_key=True, serialize=False)),
('rfid_id', models.CharField(max_length=255)),
('created', models.DateTimeField(default=django.utils.timezone.now)),
],
),
migrations.CreateModel(
name='Door',
fields=[
('door_id', models.CharField(max_length=255, primary_key=True, serialize=False)),
],
),
migrations.CreateModel(
name='Lock',
fields=[
('id', models.IntegerField(primary_key=True, serialize=False)),
('state', models.BooleanField(default=True)),
],
),
migrations.CreateModel(
name='Record',
fields=[
('id', models.IntegerField(primary_key=True, serialize=False)),
('recording', models.BooleanField(default=True)),
],
),
migrations.CreateModel(
name='RemoteHistory',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('device_name', models.CharField(max_length=255)),
('created', models.DateTimeField(default=django.utils.timezone.now)),
],
),
migrations.CreateModel(
name='Video',
fields=[
('vid_name', models.CharField(max_length=255, primary_key=True, serialize=False)),
('created', models.DateTimeField(default=django.utils.timezone.now)),
('vid_time', models.CharField(max_length=255)),
('thumb', models.CharField(max_length=255)),
],
),
]
......@@ -11,7 +11,6 @@ from api.videorecord import record
from api.models import Video, Device, RemoteHistory, Lock, Record, Door, AddDevice
from api.serializers import VideoSerializer, DeviceSerializer, RemoteHistorySerializer, RecordSerializer, LockSerializer, AddDeviceSerializer
from rest_framework import status
from rest_framework.views import APIView
from rest_framework.request import Request
......
......@@ -60,7 +60,7 @@ def record() :
start_time = time.time()
vid_name = now.strftime('%Y%m%d-%H%M%S')
vid_path = path + '/' + vid_name + '.h264'
vid_path = path + '/' + vid_name + '.mp4'
thumbnail_path = path + '/' + vid_name + '.jpg'
camera.start_recording(output=vid_path)
......