-1

im trying to view the video files of a security cameras SD card they will not play on windows media player i have downloaded FFMPEG and checked if it was installed using command prompt it is installed successfully the issue comes when i try to convert the file to an mp4 the SD card video files show up as a media file or .media on my file explorer for example i renamed one of the video files dog and put it into to command prompt as

ffmpeg -i dog.media dog.mp4 and it wont convert i need to convert these files i need help on this

i tried typing the conversion in command prompt as ffmpeg -i dog.media dog.mp4 and it wont convert i need to convert these files i need help on this

and it didnt work

also i tried to look at what type of file is a .media file and wasn't able to find anything

  • 1
    I’m voting to close this question because , as explained by the ffmpeg tag: Only questions about programmatic use of the FFmpeg libraries, API, or tools are on topic. Questions about interactive use of the command line tool should be asked on https://superuser.com/ or https://video.stackexchange.com/. – Rob Apr 21 '23 at 08:15
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Apr 21 '23 at 16:44

1 Answers1

0

I had a similar request recently, from a security camera that recorded inside many folders with .media files. Inside the SDcard, the structure looked like this:

DCIM
├── 2023
    ├── 03
        ├── 05
        |   ├── 1678051436_0120
        |           ├── 0000.media
        |           ├── 0011.media
        |           ├── 0021.media
        |   ├── 1678051556_0120
        |   ├── ...
        ├── 06
        ├── 07

Turns out these .media files can be sorted, concatenated and converted to .mp4 using ffmpeg and mkvmerge utils. ffmpeg creates a single .mp4 file per folder, and mkvmerge stiches all the .mp4s to a single large .mkv file. I wrote a bash script to automate these for me, maybe it can help you too.

To give you an idea:

        ffmpeg \
        -y \
        -safe 0 \
        -f concat \
        -i <(find "${trgtFolder}/$d/" -type f -name "*.${extension:=media}" -printf "file '%p'\n" | sort) \
        -c copy \
        -crf 18 \
        "${trgtFolder}/$d/$(dateOrSelf "$(sed -e 's/\(\/.*$\|_.*$\)//g' <(echo "$d"))").mp4" \
        $([[ -n "$quiet" ]] && echo "-nostats -loglevel 0" || echo "") \
        2>&1 
  • $d is the directory such as 1678051436_0120
  • $trgtFolder is 05 in the above example, so the parent of $d
  • $extension defaults to media as we are dealing with *.media files
  • dateOrSelf is a function that converts 1678051436_0120 to time YYYYMMDD-HHMMSS as 1678051436 in fact time since Unix Epoch.
  • $quiet is a parameter to silence ffmpeg warnings since it will complain a lot about start-end times of snippets.

The script link to Github does these automatically, so give it a try and let me know.

ibrahim tanyalcin
  • 5,643
  • 3
  • 16
  • 22