Git Product home page Git Product logo

medialib's People

Contributors

hdsdi3g avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

hrony

medialib's Issues

Manage ffmpeg progress file

netcat -l 4444
ffmpeg -nostats -hide_banner -stats_period 1 -progress tcp://localhost:4444 -i video.webm -an -vf siti,metadata=mode=print:file=- -f null -
frame=1
fps=0.00
stream_0_0_q=-0.0
bitrate=N/A
total_size=N/A
out_time_us=41667
out_time_ms=41667
out_time=00:00:00.041667
dup_frames=0
drop_frames=0
speed=2.69x
progress=continue
frame=11
fps=10.43
stream_0_0_q=-0.0
bitrate=N/A
total_size=N/A
out_time_us=458333
out_time_ms=458333
out_time=00:00:00.458333
dup_frames=0
drop_frames=0
speed=0.434x
progress=continue
frame=15
fps=9.04
stream_0_0_q=-0.0
bitrate=N/A
total_size=N/A
out_time_us=625000
out_time_ms=625000
out_time=00:00:00.625000
dup_frames=0
drop_frames=0
speed=0.377x
progress=end

progress is always at chunck's end (ffmpeg doc say that).

Or via https://qpid.apache.org/components/broker-j/index.html / mock with https://github.com/fridujo/rabbitmq-mock

Create new ffmpeg filters

Create ContainerAnalyser, a ffprobe utility to scan and get raw frames informations

  • [] Check with very long files (memory max?)
    • Maybe it's ok with loading on the fly, and with Java SAX as parser. Not keep all datas, like video res or audio channel count
  • File test? ok, see /fflauncher/src/test/resources/ffprobe-streams-packets.xml.gzip (load it with https://commons.apache.org/proper/commons-compress)
  • Parser + API
  • Implement with tools created in #14
  • Export to?

Load with:

ffprobe -show_frames -print_format xml -show_packets -i <>

XML file output is very big, more than 1MB/30 sec.

NumberFormatException with LavfiMetadataFilterParser

java.lang.NumberFormatException: For input string: "-nan"
        at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
        at java.base/jdk.internal.math.FloatingDecimal.parseFloat(FloatingDecimal.java:122)
        at java.base/java.lang.Float.parseFloat(Float.java:476)
        at java.base/java.lang.Float.valueOf(Float.java:440)
        at tv.hd3g.fflauncher.filtering.lavfimtd.LavfiMetadataFilterParser.parseFloat(LavfiMetadataFilterParser.java:271)
        at java.base/java.util.Optional.map(Optional.java:260)
        at tv.hd3g.fflauncher.filtering.lavfimtd.LavfiMetadataFilterParser.extractMetadataFloat(LavfiMetadataFilterParser.java:259)
        at tv.hd3g.fflauncher.filtering.lavfimtd.LavfiMetadataFilterParser.extractMetadatas(LavfiMetadataFilterParser.java:225)
        at tv.hd3g.fflauncher.filtering.lavfimtd.LavfiMetadataFilterParser.lambda$completeFrame$5(LavfiMetadataFilterParser.java:168)
        at java.base/java.util.HashMap$EntrySet.forEach(HashMap.java:1126)
        at tv.hd3g.fflauncher.filtering.lavfimtd.LavfiMetadataFilterParser.completeFrame(LavfiMetadataFilterParser.java:168)
        at tv.hd3g.fflauncher.filtering.lavfimtd.LavfiMetadataFilterParser.addLavfiRawLine(LavfiMetadataFilterParser.java:100)

Add scene cut detection

With

ffmpeg -i <> -vf select="gte(scene\,0)",metadata=print:file=- -an -f null -

Return lavfi.scene_score=0.002568

But select seems not working with anothers filters (return always scene_score=0)...

Create an ffmpeg utility, like AudioChannelManipulation, to do some media file analysing

AKA create a parser for #13 results.

Get in realtime, or in onEnd mode.

TODO:

  • Create an manual command-line ffmpeg exec, and generate some datas
  • See https://ffmpeg.org/ffmpeg-filters.html#metadata_002c-ametadata to better data crawl, or not.
  • Precheck filters availablity before run analysing
  • Create an event capture API to transform raw ffmpeg datas to real Java objects
  • Implements parsers for:
    • Audio
      • ebur128 (live mode) - must parse ffmpeg out
      • ebur128 (result mode) - must parse ffmpeg out
      • aphasemeter - just read lavfi metadata file
      • silencedetect - just read lavfi metadata file
      • astats - just read lavfi metadata file
      • volumedetect optional, must parse ffmpeg out
    • Video
      • siti - just read lavfi metadata file
      • idet - just read lavfi metadata file
      • freezedetect - just read lavfi metadata file
      • blackdetect - just read lavfi metadata file
      • cropdetect - just read lavfi metadata file
      • blockdetect - just read lavfi metadata file
      • blurdetect - just read lavfi metadata file
      • mestimate only with cropdetect
  • Create a test suite with automatic generated files to check it?
  • Check loudness with very long files (memory max?)
  • Create a filterchain utility, and setup default params
  • Add the help of AudioChannelManipulation with the audio, with separated tracks (MXF). Moved to #22
  • Manage splited silence check?
  • Manage limited time for idet scan? moved to #23
  • Create a real command line tool (new project): moved to #21
  • create "parser" to merge LavfiMetadataFilterFrame and FilterSupplier (? or create LavfiMetadataFilterSupplier ?)

NumberFormatException during parsing ffmpeg progress

DEBUG Start /usr/local/bin/ffmpeg -progress tcp://127.0.0.1:39907 -stats_period 1 -vn -i .demo-media-files/demo-render.wav -nostats -hide_banner -af aphasemeter=video=0,astats=metadata=1:measure_perchannel=DC_offset+Peak_level+Flat_factor+Peak_count+Noise_floor+Noise_floor_count+Entropy:measure_overall=none,silencedetect,ametadata=mode=print:file=-,ebur128=peak=sample+true -f null -
Exception in thread "Socket watcher for ffmpeg progress" java.lang.NumberFormatException: For input string: "N/A"
        at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
        at java.base/jdk.internal.math.FloatingDecimal.parseFloat(FloatingDecimal.java:122)
        at java.base/java.lang.Float.parseFloat(Float.java:476)
        at java.base/java.lang.Float.valueOf(Float.java:440)
        at tv.hd3g.fflauncher.progress.ProgressBlock.getSpeedX(ProgressBlock.java:122)
        at media.mexm.mediadeepa.service.FFmpegServiceImpl$1.onProgress(FFmpegServiceImpl.java:307)
        at tv.hd3g.fflauncher.progress.ProgressListenerSession.listen(ProgressListenerSession.java:97)
        at java.base/java.lang.Thread.run(Thread.java:833)
I```

Correct filter chain with MediaAnalyser

Switch from

-af filter,filter,ametadata

To

-filter_complex [0:1]filter,ametadata=mode=print:file=-;[0:1]filter,ametadata=mode=print:file=- -f null -

Same for video.

Refactor MediaAnalyser/ContainerAnalyser

RawStdErrFilterEvent should must be specialized:

  • LUFS
  • Or, just a Map<String filter name, String Line>

ImpEx text:

  • Can import RAW text result instead of run ffmpeg/ffprobe
    • Raw lavfi
    • Create a lavfi merge tool
    • Raw stderr/LUFS
    • MediaAnalyser
    • ContainerAnalyser (XML FFprobe)
  • Can export to RAW text result on run ffmpeg/ffprobe, instead of process datas
    • MediaAnalyser
      • Raw stderr/LUFS
      • Raw lavfi
    • ContainerAnalyser (XML FFprobe)

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.