Giter Site home page Giter Site logo

Comments (9)

wseemann avatar wseemann commented on June 24, 2024

Why not write the inputstream data to a temp file (via FileOutputStream), obtain the file descriptor and pass it to the library? Adding InputStream support would be very difficult based on the way JNI works.

from ffmpegmediametadataretriever.

ckarthikv avatar ckarthikv commented on June 24, 2024

Is it possible to use this library to pass a live FileOutputStream datasource and retrieve the timestamps (pts/dts) from an mp4 file?

from ffmpegmediametadataretriever.

ckarthikv avatar ckarthikv commented on June 24, 2024

@wseemann - Waiting for a reply on this, please let me know. Thanks.

from ffmpegmediametadataretriever.

3c71 avatar 3c71 commented on June 24, 2024

Why not write the inputstream data to a temp file (via FileOutputStream), obtain the file descriptor and pass it to the library? Adding InputStream support would be very difficult based on the way JNI works.

I need the same too, or better a DataSource which allows implementing some random file access easily. And is fully backward-compatible with standard MediaMetadataRetriever .

I've tested Android MediaMetadataRetriever which takes a DataSource as input but it has limited formats support.

I'm now using FFMpeg with a ParcelFileDescriptor (created from ParcelFileDescriptorUtil.pipeFrom). Unfortunately it doesn't support some mp4 files because it can't seek. For those files the DataSource works great and thumbnails are created very quickly.

Using a temp file is out of the question as video files are usually large and a preview is meant to be retrieved quickly.

from ffmpegmediametadataretriever.

3c71 avatar 3c71 commented on June 24, 2024

Quick update, I can't use FFMpeg because it ends-up crashing the app when trying to get a thumbnail for any mp4 I have created with Vegas Pro ! Pretty sad as it looked promising!

Only option that I can use is a FileDescriptor and it's not efficient for those MP4 files as it keeps loading file content until the app crash. I have only .avi and .mkv test files and they are working pretty well for the most part.

2020-03-16 15:08:47.105 6675-6732/ccc71.explorer A/libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 6732 (ccc71_task #1), pid 6675 (ccc71.explorer)
2020-03-16 15:08:47.182 7067-7067/? I/crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
2020-03-16 15:08:47.183 1106-1106/? I//system/bin/tombstoned: received crash request for pid 6732
2020-03-16 15:08:47.183 7067-7067/? I/crash_dump64: performing dump of process 6675 (target tid = 6732)
2020-03-16 15:08:47.190 7067-7067/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2020-03-16 15:08:47.190 7067-7067/? A/DEBUG: Build fingerprint: 'google/crosshatch/crosshatch:10/QP1A.190711.020.C3/5869620:user/release-keys'
2020-03-16 15:08:47.190 7067-7067/? A/DEBUG: Revision: 'MP1.0'
2020-03-16 15:08:47.190 7067-7067/? A/DEBUG: ABI: 'arm64'
2020-03-16 15:08:47.191 7067-7067/? A/DEBUG: Timestamp: 2020-03-16 15:08:47+0100
2020-03-16 15:08:47.191 7067-7067/? A/DEBUG: pid: 6675, tid: 6732, name: ccc71_task #1 >>> ccc71.explorer <<<
2020-03-16 15:08:47.191 7067-7067/? A/DEBUG: uid: 10267
2020-03-16 15:08:47.191 7067-7067/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
2020-03-16 15:08:47.191 7067-7067/? A/DEBUG: x0 0000000000000000 x1 0000000000001a4c x2 0000000000000006 x3 0000006fd0983cd0
2020-03-16 15:08:47.191 7067-7067/? A/DEBUG: x4 ff0938363539672d x5 ff0938363539672d x6 ff0938363539672d x7 7f7f7f7f7f7f7f7f
2020-03-16 15:08:47.191 7067-7067/? A/DEBUG: x8 00000000000000f0 x9 4088d841402e9965 x10 0000000000000001 x11 0000000000000000
2020-03-16 15:08:47.191 7067-7067/? A/DEBUG: x12 fffffff0fffffbdf x13 0a3937363a682e6c x14 0000000000000010 x15 00000070c633a40a
2020-03-16 15:08:47.191 7067-7067/? A/DEBUG: x16 00000070c63408c0 x17 00000070c631e100 x18 0000006fd03fe000 x19 0000000000001a13
2020-03-16 15:08:47.191 7067-7067/? A/DEBUG: x20 0000000000001a4c x21 00000000ffffffff x22 0000000000000000 x23 0000006f71f22878
2020-03-16 15:08:47.191 7067-7067/? A/DEBUG: x24 0000000000000500 x25 0000000000010000 x26 0000000000010000 x27 0000006fc43f4000
2020-03-16 15:08:47.191 7067-7067/? A/DEBUG: x28 000000000000001c x29 0000006fd0983d70
2020-03-16 15:08:47.191 7067-7067/? A/DEBUG: sp 0000006fd0983cb0 lr 00000070c62d2f48 pc 00000070c62d2f74
2020-03-16 15:08:47.191 7067-7067/? A/DEBUG: backtrace:
2020-03-16 15:08:47.191 7067-7067/? A/DEBUG: #00 pc 0000000000081f74 /apex/com.android.runtime/lib64/bionic/libc.so (abort+160) (BuildId: 676a709a0ee633ec9cf6ab05ec6410ae)
2020-03-16 15:08:47.191 7067-7067/? A/DEBUG: #1 pc 000000000003f874 /data/app/ccc71.explorer-tVcJydVRZ5NRzkHXjVSYUA==/lib/arm64/libswscale.so (sws_setColorspaceDetails+712)

from ffmpegmediametadataretriever.

wseemann avatar wseemann commented on June 24, 2024

You can use setDataSource(java.lang.String path) if you need to retrieve metadata for a file or url, so InputStream shouldn't be necessary in any use case. Closing out this ticket.

from ffmpegmediametadataretriever.

jonecx avatar jonecx commented on June 24, 2024

If the file is on a samba server and you are browsing video files, being able to use inputStream to get frames for thumbnail seems easier.

from ffmpegmediametadataretriever.

wseemann avatar wseemann commented on June 24, 2024

If the file is on a samba server and you are browsing video files, being able to use inputStream to get frames for thumbnail seems easier.

Agreed, which is why you have the option to implement your own MediaDataSource and pass that to setDataSource.

from ffmpegmediametadataretriever.

jonecx avatar jonecx commented on June 24, 2024

Agreed, which is why you have the option to implement your own MediaDataSource and pass that to setDataSource.

Interesting is there an example you can think of, or seen around by any chance? Right now setDataSource takes only FileDescriptor, or path or Uri with context. I wonder how it could be done if the samba server requires authentication for the smb:// protocol too

from ffmpegmediametadataretriever.

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.