B4J Question FFMPEG - how to open .media/.info files from a security camera?

T201016

Active Member
Licensed User
Longtime User
Hi,
Recently, I started to deal with customer safety cameras
and I am struggling with the main problem of playing files enforcement .media

The easiest way to convert .media to MP4 is,

ffmpeg -i input.media -c:v libx264 -crf 23 -preset fast -c:a aac -b:a 192k output.mp4

Explanation of the flag

-c:v libx264: Uses the video codec H.264 (which is widely compatible).
-crf 23: Balances the quality and size of the file (lower = better quality, typical 18-28).
-preset fast: A compromise of speed/compression (ultra fast, fast, medium, slow).
-c:a aac: Converts the sound at AAC (by default for MP4).
-b:a 192k: Set the sound transmission speed to ensure decent quality.

Startless remixing (if the codecs are compatible)
If the file .media already contains H.264/AAC, you can remix (change the container without re-coding) for immediate conversion.

ffmpeg -i input.media -c:v copy -c:a copy output.mp4

You can find a ready project here HERE
 
Last edited:

T201016

Active Member
Licensed User
Longtime User
However, how to open .media/.info files from a security camera?

You need a soft dedicated to play from the recorder manufacturer or to install codecs.
So far, browsing the Internet has not brought anything reasonable, maybe someone has already encountered such a problem
and knows the right soft?
 
Upvote 0

Swissmade

Well-Known Member
Licensed User
Longtime User
Every brand has his own way to access the Camera.
What Brand is yours?
 
Upvote 0

Swissmade

Well-Known Member
Licensed User
Longtime User
Records in HEVC format (the recording time is 700 MB)
Hm I wondering if IT is possible at all.
To do that you need more tech info about.
Maybe there is a backdoor the Android app can share videos but that's not what you like to do i think.
 
Upvote 0

T201016

Active Member
Licensed User
Longtime User
Hm I wondering if IT is possible at all.
To do that you need more tech info about.
Maybe there is a backdoor the Android app can share videos but that's not what you like to do i think.
For now, I am at the stage of editing the resulting files .media may find something in them that will guide me. For now, I leave the thread open, maybe I will come back to it in a while.
 
Upvote 0

Swissmade

Well-Known Member
Licensed User
Longtime User
For now, I am at the stage of editing the resulting files .media may find something in them that will guide me. For now, I leave the thread open, maybe I will come back to it in a while.
That's the Spirit.:)
 
Upvote 0

emexes

Expert
Licensed User
Longtime User
Thanks for this thread - I bought a couple of cheap security cameras last week, and it looks like I might be needing that FFMPEG magic incantation too.

Longer term, I'm going to program up some old 3G-no-longer-available Android phones to act as security camera. Not looking for video, just for regular motion-triggered photos. Was thinking to upload them to an FTP server (which I've already got) but MQTT might be better because ((I think) it eliminates the need for polling the FTP server for new uploads. Or maybe a combination of the two: MQTT to "announce" new photos are available, but then the photos are downloaded from FTP server.

The phones can also monitor iTags, perhaps even use them as an emergency call button. The project is for at my parents' house, more for make-sure-they're-still-alive than for security purposes, although a klaxon that goes off when somebody wanders onto the property might be useful too.

Lol it's bin night tonight: could even put iTags on the garbage and recycling bins, to confirm that they are put out for collection, and on the correct weeks.
 
Upvote 0

T201016

Active Member
Licensed User
Longtime User
Thanks for this thread - I bought a couple of cheap security cameras last week, and it looks like I might be needing that FFMPEG magic incantation too.
...

For now, I am waiting for the TUYA application developer to comment. It turns out that in my case the Tuya application does not even allow me to update the current date and time in the device.

Regarding post #1:
From what I have already realized, the "Tuya Smart" application stores video and audio in a reserved format, with future MP4 support (which would be great).

This probably means that they entered audio data into the H.264 stream intra -lane headers. In order for something like FFMPEG to be reproduced, it may include the extract bits filter, which converts intra -lane data into non -lane data, which can be saved as extradens to a file.

Here is the side of the developer Tuya explaining the part of their reserved format:
 
Last edited:
Upvote 0
Top