Flutter Dart Notes

Programming

Reference / examples of code

Support Tools

Startup

Terminal

export PATH="$PATH:/Users/dlr/workspace/flutter/bin"

Create Project

  1. Invoke View > Command Palette.
  2. Type “flutter”, and select the Flutter: New Project.
  3. Select Application.
  4. Create or select the parent directory for the new project folder.
  5. Enter a project name, such as my_app, and press Enter.
  6. Wait for project creation to complete and the main.dart file to appear.

Setup

Video_player

How to find a video format that plays for all devices: https://stackoverflow.com/questions/55326957/problems-reproducing-video-on-both-system-android-ios

AVPlayer iOS is not support H265 video, you can try other videos (H264, H263) ? confirm? from https://github.com/flutter/flutter/issues/62785

https://stackoverflow.com/questions/14171826/converting-video-for-android-using-ffmpeg The MP4 created by ffmpeg has the moov header at the tail. That is why you are getting this error message. ffmpeg can put the moov header in front (suitable for streaming).

ffmpeg -i <input> -c:v libx264 -c:a aac -movflags faststart -vprofile baseline output.mp4

-movflags faststart [mp4 @ 0x137705380] Starting second pass: moving the moov atom to the beginning of the file1x

Trying this for HDR Video: from https://superuser.com/questions/1549201/ffmpeg-could-not-find-tag-for-codec-none ffmpeg -i IMG_0368.mov -tag:v hvc1 -codec:v libx265 -x265-params crf=“26” -codec:a aac -preset fast “compressedfile-ffmpeg-h265-crf26.mp4”

This works and doesn’t need the HVC1 tag as its a H.264 video. ffmpeg -i IMG_0368.mov -c:v libx264 -crf 26 -vf format=yuv420p -c:a aac -movflags faststart output.mp4

https://trac.ffmpeg.org/wiki/Encode/H.265 To make your H.265 file compatible with Apple “industry standard” H.265 you have to add the following argument -tag:v hvc1

https://superuser.com/questions/1380946/how-do-i-convert-10-bit-h-265-hevc-videos-to-h-264-without-quality-loss Converting 10bit or 12 bit HEVC to 8bit for simpler playing.

Android OS video formats supported: https://developer.android.com/guide/topics/media/exoplayer/supported-formats

Reference

https://stackoverflow.com/questions/59948686/how-to-download-video-from-online-and-store-it-local-device-then-play-video-on-f

THANK YOU Stuart Morgan!! MacOS X Video_Player support. https://github.com/flutter/packages/commit/d0e9a0e1b3ac1f8afeba2a30da6d30fa06d96a48

Last modified December 14, 2023: Moving to /notes (3bbb5be)