Skip to content

jpietek/video-probe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Synopsis

Simple REST service written in Spring Boot that extracts metadata from media files. Wrapper around ffprobe 3.3.1.

Example usage

curl -F 'video=@<path_to_file>' <user>:<password>@<host>:8080/video/probe

Output format

Each valid request should respond with json:

{
    message: <"ffprobe ok" or failure message>,
    result: <ffprobe json>,
    success: <boolean>
}

If the metadata api call fails, success flag is false and result is null.

ffprobe json : {
    streams : [ stream1, stream2 etc. ], (by convention 0th index is usually video, 1st - audio)
    format : { } (per container metadata, like number of streams, bitrate or size in bytes)
}

stream : {
    "index" : <long>,
    "codec" : <codec shortname>,
    "codec_type" : <audio/video>,
    "bit_rate" : <long>, (not always available per stream)
(...)
}

Stream metadata apart from additional technical info may contain disposition and tags. For details refer to ffprobe documentation https://ffmpeg.org/ffprobe.html

Build

mvn package -> jar
mvn package docker:build -> docker image

run with: java -jar probe-video.jar

Features

  • basic http auth
  • 25MB POST limit
  • simple rate limit of 10req/s not to overkill nano aws instance
  • mime type pre-check, to filter out obviously invalid files and save up some ffprobing power

Tests

  • ApiTest focused on proper http responses, input validation
  • ProbeTests, ffprobing tests using some popular container/codecs combinations (sample files included in the test/resources)

About

rest video probing service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages