Code Monkey home page Code Monkey logo

audio's People

Contributors

soreil avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

audio's Issues

Per stream bitrate not set for some formats.

Where there is no bitrate set for a stream we use the avformatcontext bitrate or none at all, the formatcontext bitrate also includes side data like images. This is evident from an opus file with a JPG image and the exact same audio with a different PNG file having different (too high) bitrates.

--- PASS: TestConstruct (0.16s)
audio_test.go:41:
audio_test.go:42: Filename: exampleFalse.mp3
audio_test.go:49: Failed to create decoder No input data provided
audio_test.go:41:
audio_test.go:42: Filename: exampleImage.mp3
audio_test.go:53: Audio duration: 59.559184s
audio_test.go:54: Audio format: mp3
audio_test.go:55: Bitrate: 192 kbps
audio_test.go:58: Image format: jpeg
audio_test.go:60: Picture length: 103 k
audio_test.go:41:
audio_test.go:42: Filename: exampleTrue.mp3
audio_test.go:53: Audio duration: 59.559184s
audio_test.go:54: Audio format: mp3
audio_test.go:55: Bitrate: 192 kbps
audio_test.go:41:
audio_test.go:42: Filename: mpthreetest.mp3
audio_test.go:53: Audio duration: 12.416125s
audio_test.go:54: Audio format: mp3
audio_test.go:55: Bitrate: 128 kbps
audio_test.go:41:
audio_test.go:42: Filename: examplePNG.mp3
audio_test.go:53: Audio duration: 59.559184s
audio_test.go:54: Audio format: mp3
audio_test.go:55: Bitrate: 192 kbps
audio_test.go:58: Image format: png
audio_test.go:60: Picture length: 213 k
audio_test.go:41:
audio_test.go:42: Filename: exampleFalse.ogg
audio_test.go:49: Failed to create decoder No input data provided
audio_test.go:41:
audio_test.go:42: Filename: exampleJPG.ogg
audio_test.go:53: Audio duration: 6.104036s
audio_test.go:54: Audio format: vorbis
audio_test.go:55: Bitrate: 160 kbps
audio_test.go:58: Image format: jpeg
audio_test.go:60: Picture length: 103 k
audio_test.go:41:
audio_test.go:42: Filename: examplePNG.ogg
audio_test.go:53: Audio duration: 6.104036s
audio_test.go:54: Audio format: vorbis
audio_test.go:55: Bitrate: 160 kbps
audio_test.go:58: Image format: png
audio_test.go:60: Picture length: 213 k
audio_test.go:41:
audio_test.go:42: Filename: exampleTrue.ogg
audio_test.go:53: Audio duration: 6.104036s
audio_test.go:54: Audio format: vorbis
audio_test.go:55: Bitrate: 160 kbps
audio_test.go:41:
audio_test.go:42: Filename: exampleJPG.opus
audio_test.go:53: Audio duration: 2.92s
audio_test.go:54: Audio format: opus
audio_test.go:55: Bitrate: 0 kbps
audio_test.go:58: Image format: jpeg
audio_test.go:60: Picture length: 103 k
audio_test.go:41:
audio_test.go:42: Filename: examplePNG.opus
audio_test.go:53: Audio duration: 2.92s
audio_test.go:54: Audio format: opus
audio_test.go:55: Bitrate: 0 kbps
audio_test.go:58: Image format: png
audio_test.go:60: Picture length: 213 k
audio_test.go:41:
audio_test.go:42: Filename: exampleTrue2.opus
audio_test.go:53: Audio duration: 2.92s
audio_test.go:54: Audio format: opus
audio_test.go:55: Bitrate: 0 kbps
audio_test.go:41:
audio_test.go:42: Filename: exampleTrue.opus
audio_test.go:53: Audio duration: 3m48.114083s
audio_test.go:54: Audio format: opus
audio_test.go:55: Bitrate: 0 kbps
audio_test.go:41:
audio_test.go:42: Filename: traincrash.webm
audio_test.go:53: Audio duration: 1m0.913s
audio_test.go:54: Audio format: opus
audio_test.go:55: Bitrate: 0 kbps
audio_test.go:41:
audio_test.go:42: Filename: test.webm
audio_test.go:41:
audio_test.go:42: Filename: slam.webm
audio_test.go:53: Audio duration: 2m1.703s
audio_test.go:54: Audio format: vorbis
audio_test.go:55: Bitrate: 0 kbps
audio_test.go:41:
audio_test.go:42: Filename: aacTest.mp4
audio_test.go:53: Audio duration: 5m7.479s
audio_test.go:54: Audio format: aac
audio_test.go:55: Bitrate: 63 kbps
audio_test.go:41:
audio_test.go:42: Filename: aacTest.aac
audio_test.go:53: Audio duration: 7m31.334374s
audio_test.go:54: Audio format: aac
audio_test.go:55: Bitrate: 95 kbps
audio_test.go:41:
audio_test.go:42: Filename: itunes.m4a
audio_test.go:53: Audio duration: 5m7.525079s
audio_test.go:54: Audio format: aac
audio_test.go:55: Bitrate: 128 kbps

AVCodecContext *codec deprecated

Related to Soreil/video/issues/7

# github.com/Soreil/audio
In file included from ../../go/src/github.com/Soreil/audio/ffmpeg.go:8:0,
                 from $WORK/github.com/Soreil/audio/_obj/_cgo_export.c:3:
/usr/local/include/libavformat/avformat.h:880:21: note: declared here
     AVCodecContext *codec;
                     ^
# github.com/Soreil/audio
../../go/src/github.com/Soreil/audio/ffmpeg.go: In function ‘get_codecContext’:
../../go/src/github.com/Soreil/audio/ffmpeg.go:59:2: warning: ‘codec’ is deprecated [-Wdeprecated-declarations]
  AVCodecContext * codecCtx = ctx->streams[strm]->codec;
  ^
In file included from ../../go/src/github.com/Soreil/audio/ffmpeg.go:8:0:
/usr/local/include/libavformat/avformat.h:880:21: note: declared here
     AVCodecContext *codec;
                     ^

Duration not set for some Opus files with small buffer size

The 4096 buffer size is sufficient for all files except some odd Opus test files I had, not all opus files exhibit this behaviour and the same file without attached images does not exhibit it either.
I need to go from 4096 way up to 256k or even 512k. This smells like a bug somewhere.

Duration support broken

It is already not there in the AVFormatContext, might be incorrectly setting up the AVIOContext or probing the data.

Not compiling under Go 1.7

./ffmpeg.go:283: cannot use unsafe.Pointer(c) (type unsafe.Pointer) as type *C.struct_AVCodecContext in argument to func literal
./ffmpeg.go:293: cannot use unsafe.Pointer(c) (type unsafe.Pointer) as type *C.struct_AVCodecContext in argument to func literal
./ffmpeg.go:309: cannot use unsafe.Pointer(c) (type unsafe.Pointer) as type *C.struct_AVCodecContext in argument to func literal
FAIL    github.com/Soreil/audio [build failed]

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.