Comments (9)
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.
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.
@wseemann - Waiting for a reply on this, please let me know. Thanks.
from ffmpegmediametadataretriever.
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.
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.
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.
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.
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.
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)
- OpenSSL lower then 1.1.1i HOT 3
- Embedded coverart overwrites comment field
- it seems like the customer header not working by use method setDataSource ,please fix it ,thanks HOT 4
- getScaledFrameAtTime returns black bitmap on some videos HOT 7
- Get thumbnail from HLS VOD content HOT 2
- libavformat.so #00 pc 000b50d8
- Can not use FFmpegMediaMetadataRetriever HOT 2
- how to use it with recyclerview ? HOT 1
- What is the reason of memory increasing. HOT 1
- Can it retrieve frames of a video at 24fps rate? HOT 1
- Uncatchable crash setDataSource code -1 (SI_QUEUE) HOT 8
- FFmpegMediaMetadataRetriever does not respect video rotation in getFrameAtTime HOT 1
- Android FFmpegMediaMetadataRetriever get Frame from RTSP stream App Crash with A/libc: Fatal signal 6 (SIGABRT) HOT 10
- JNI_ERR returned from JNI_OnLoad HOT 1
- METADATA_KEY_DURATION returns 0 for mp3 on android 6.0.1 but works on other versions HOT 2
- 获取Flv视频格式的缩略图时闪退 HOT 2
- retry后socket没有释放
- App crash FFmpegMediaMetadataRetriever HOT 1
- When will the next version be released
- can the library ignore ssl check,because the certificate of some streams may be not safely
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ffmpegmediametadataretriever.