GithubHelp home page GithubHelp logo

Comments (3)

elonen avatar elonen commented on June 11, 2024

Maybe like this:

ffmpeg -i "$INPUTFILE" -r 60 -filter_complex "\
    color=c=white:s=2x720 [cursor]; \
    [0:a] showwavespic=s=1920x720:split_channels=1:draw=full, fps=60 [stillwave];\
    [0:a] showfreqs=mode=line:ascale=log:s=1920x180 [freqwave]; \
    [0:a] showwaves=size=1920x180:mode=p2p [livewave]; \
    [stillwave][cursor] overlay=(W*t)/(${DURATION}):0:shortest=1 [progress]; \
    [livewave][progress] vstack[stacked]; \
    [stacked][freqwave] vstack [out]; \
    " -map [out] -map 0:a \
    -c:v libx264 -c:a flac \
    -y output_progr.mp4

Omitting the [freqwave] layer makes this 2-3x faster, but spectral analysis might be quite useful for reviews & annotation.

from clapshot.

elonen avatar elonen commented on June 11, 2024

More ideas. Detect media type by running a jq script on mediainfo JSON, and then convert into a video (like above) with an FFMPEG filter_complex chain. The current FFMPEG caller already injects nice progress tracking options, which should be useful for long audio files, too.

CREATE TABLE media_types (
    type_name VARCHAR(255) NOT NULL PRIMARY KEY,
    precedence INTEGER NOT NULL,  -- run jq scripts in order from highest to lowest, pick the first that matches
    jq_script TEXT,   -- Stores the jq script for media type detection
    ffmpeg_script TEXT  -- Stores the FFMPEG script for converting media to video
);

Video
jq '[.media.track[]["@type"]] | if (index("Video") != null) then "Video" else empty end'

Audio
jq '[.media.track[]["@type"]] | if (index("Audio") != null) and (index("Video") == null) then "Audio" else empty end'

Image
jq '[.media.track[]["@type"]] | if (index("Image") != null) and (index("Video") == null) and (index("Audio") == null) then "Image" else empty end'

Use https://github.com/onelson/jq-rs to avoid shell invokes.

from clapshot.

elonen avatar elonen commented on June 11, 2024

Implemented in v0.7.0

from clapshot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.