Skip to content
This repository has been archived by the owner on Oct 14, 2021. It is now read-only.

Stream metadata does not parse from iOS files #21

Closed
wreppun opened this issue Apr 18, 2019 · 3 comments
Closed

Stream metadata does not parse from iOS files #21

wreppun opened this issue Apr 18, 2019 · 3 comments
Assignees
Labels
bug Something isn't working fixed

Comments

@wreppun
Copy link
Contributor

wreppun commented Apr 18, 2019

Description
This may belong upstream in the mobile-ffmpeg repo.

iOS video files (on the device described in the logs below, either picked via image_picker or recorded via image_picker) do not have any stream metadata in the dictionary returned from getMediaInformation.

This happens despite the metadata appearing in the the rawInformation field. This is important because we use the rotate metadata to determine which dimension to limit when resizing.

Expected behavior
The info.stream[0].metadata is populated with the metadata of the stream

Current behavior
The info.stream[0].metadata was null

Logs
The info object:

{
  format : mov,mp4,m4a,3gp,3g2,mj2,
  streams: [
    {timeBase: 600, realFrameRate: 29.97, index: 0, codecTimeBase: 1200, fullCodec: h264 (avc1 / 0x31637661), fullFormat: yuv420p(tv, bt709), width: 1920, type: video, bitrate: 16083, averageFrameRate: 29.98, format: yuv420p, height: 1080, codec: h264},
    {fullCodec: aac (mp4a / 0x6134706d), sampleFormat: fltp, codec: aac, channelLayout: mono, type: audio, bitrate: 90, sampleRate: 44100, index: 1}, 
    {index: 2, codec: data: none, fullCodec: data: none (mebx / 0x7862656d)}, 
    {index: 3, codec: data: none, fullCodec: data: none (mebx / 0x7862656d)}
  ],
  duration: 3000,
  path: file:///private/var/mobile/Containers/Data/Application/815329F7-230E-4A39-8BF7-7C238D6C983C/tmp/57724050691__9EEED99F-4CD2-4631-8035-7F2D5C1CFC17.MOV,
  startTime: 0,
  metadata: {com.apple.quicktime.model: iPhone 6s, creation_time: 2019-04-18T00:35:07.000000Z, com.apple.quicktime.creationdate: 2019-04-17T14:35:06-1000, com.apple.quicktime.make: Apple, major_brand: qt, minor_version: 0, com.apple.quicktime.software: 12.2, compatible_brands: qt},
  bitrate: 16194
}

The rawInformation output:

rawInformation: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file:///private/var/mobile/Containers/Data/Application/815329F7-230E-4A39-8BF7-7C238D6C983C/tmp/57724050691__9EEED99F-4CD2-4631-8035-7F2D5C1CFC17.MOV':
flutter:   Metadata:
flutter:     major_brand     : qt
flutter:     minor_version   : 0
flutter:     compatible_brands: qt
flutter:     creation_time   : 2019-04-18T00:35:07.000000Z
flutter:     com.apple.quicktime.make: Apple
flutter:     com.apple.quicktime.model: iPhone 6s
flutter:     com.apple.quicktime.software: 12.2
flutter:     com.apple.quicktime.creationdate: 2019-04-17T14:35:06-1000
flutter:   Duration: 00:00:03.00, start: 0.000000, bitrate: 16194 kb/s
flutter:     Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 16083 kb/s, 29.98 fps, 29.97 tbr, 600 tbn, 1200 tbc (default)
flutter:     Metadata:
flutter:       rotate          : 90
flutter:       creation_time   : 2019-04-18T00:35:07.000000Z
flutter:       handler_name    : Core Media Video
flutter:       encoder         : H.264
flutter:     Side data:
flutter:       displaymatrix: rotation of -90.00 degrees
flutter:     Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 90 kb/s (default)
flutter:     Metadata:
flutter:       creation_time   : 2019-04-18T00:35:07.000000Z
flutter:       handler_name    : Core Media Audio
flutter:     Stream #0:2(und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
flutter:     Metadata:
flutter:       creation_time   : 2019-04-18T00:35:07.000000Z
flutter:       handler_name    : Core Media Metadata
flutter:     Stream #0:3(und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
flutter:     Metadata:
flutter:       creation_time   : 2019-04-18T00:35:07.000000Z
flutter:       handler_name    : Core Media Metadata

Environment

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel dev, v1.4.19, on Mac OS X 10.14.4 18E226, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
[✓] Android Studio (version 3.3)
[✓] VS Code (version 1.33.1)
[✓] Connected device (1 available)

• No issues found!
@tanersener tanersener self-assigned this Apr 18, 2019
@tanersener tanersener added needs-analysis bug Something isn't working and removed needs-analysis labels Apr 18, 2019
@tanersener
Copy link
Owner

Thanks for reporting this issue. I can confirm that stream metadata is not parsed correctly. Unfortunately, this bug needs to fixed in the parent project. I created a new issue tanersener/mobile-ffmpeg#122 about it. I recommend using rawInformation field until it is fixed and a new release is published.

@wreppun
Copy link
Contributor Author

wreppun commented Apr 18, 2019

Awesome thanks. Yep, we're just pulling the rotate info out of the rawInformation for now.

@tanersener
Copy link
Owner

Fixed in v0.2.4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

2 participants