R
R
Ruslan Samara2020-10-26 14:20:34
Node.js
Ruslan Samara, 2020-10-26 14:20:34

How to merge video from photo in nodejs?

Sketches of the front on vue.js and the back on node.js.
The camera writes to the server with approximately the following structure:

"id"    "id_host"    "file_name"    "file_size"    "file_date"    "state"    "queue_type"    "mode"    "folder_id"    "storage_path"    "tmp_file_path"    "date_insert"
"3690600"    "33"    "cam5_img_18-10-2020_12-49-40_320x240.jpg"    "286641"    "2020-10-18 12:49:40"    "3"    "0"    "0"    "4"    "000000033/Camera/2020-10-18/"    \N    "2020-10-18 12:49:40"
"3690601"    "33"    "cam5_vid_18-10-2020_12-49-03_320x240.mp4"    "286641"    "2020-10-18 12:49:03"    "3"    "3"    "3"    "8"    "000000033/Camera/2020-10-18/"    \N    "2020-10-18 12:49:40"
"3690596"    "33"    "cam5_vid_18-10-2020_12-48-39_320x240.mp4"    "286641"    "2020-10-18 12:48:39"    "3"    "3"    "3"    "8"    "000000033/Camera/2020-10-18/"    \N    "2020-10-18 12:48:47"
"3690593"    "33"    "cam5_img_18-10-2020_12-48-28_320x240.jpg"    "286641"    "2020-10-18 12:48:28"    "3"    "0"    "0"    "4"    "000000033/Camera/2020-10-18/"    \N    "2020-10-18 12:48:28"


There are both video files and pictures, as the cameras for the DVR record by movement. If there is no movement for a long time, then it saves the picture.
I want to merge the video into 1 file, for each day into a separate one. But is it possible to make a video with a certain duration from a photo?
It is also necessary to make a timeline for this video (with marks where the video is, and where the photo is.), so if there are better options than gluing the video, I will be grateful.

The tag has a poster parameter to display a picture if there is no video. Perhaps using this parameter can be done. But then the server should return not 1 video per day, but an array of pictures and videos, I think this is a bad idea?

Are there any convenient libraries for the timeline to specify the id tag for video and it will build the tape automatically?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Shumov, 2020-10-26
@inoise

ffmpeg to help you. Split video into frames, merge video frame types, cut by timing - everything is in your power. The node itself has nothing to do with me, as it were

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question