On Work Order Screen, In Items Child Table UOM is not showing.
Information about bug
On Work Order Screen, In Items Child Table UOM is not showing.
Module
manufacturing
Version
Installed Apps ERPNext: v15.30.0 (HEAD) Frappe Framework: v15.36.0 (HEAD) Frappe HR: v15.24.0 (HEAD) India Compliance: v15.11.0 (HEAD) Payments: v0.0.1 (HEAD)
Installation method
FrappeCloud
Relevant log output / Stack trace / Full Error Message.
No response
iOS compress the video by default and Android doesn't. That caused the difference. I do think it is variable to have an option to get a compressed video or original video. Any PR is welcomed!
I would really like to get the original file in iOS, not a compressed version.
Still a valid proposal since is was not implemented in image_picker: ^0.6.7+22.
It not only compresses the size but also change its codec (HVEC -> h264). Hope it can provide the original video file soon!
I find a very good package that can pick original video https://pub.dev/packages/images_picker
any update on this ?? @pedromassangocode
I'm using video_compress to do this. As far as I can see, iOS only compresses videos picked from the cameral roll, so I am compressing:
- iOS videos recorded in-app,
- Android videos recorded in-app,
- Android videos picked from the gallery.
EDIT: yeah my bad, iOS compresses both new recordings and selections from the camera roll. Downvote deserved. If anyone knows how to disable iOS automatic compression I'd love to know.
I opened a duplicate issue yesterday. I Added content from my duplicate issue below. It is so discouraging to open an issue only to find the same issue was already opened 4 years again and has been ignored ever since. Remind me again why we use Flutter?
The Image Picker's video compression should be optional or disabled completely. In my usecase, my app is opening a video to to perform some editing for the user, then saves the edited video back to the user's gallery. Below are the reasons compression causes a problem.
- It is not possible to retain the original/full quality of the original input video in the edited output video. This is because the plugin has already compressed the video before it is even edited. In most cases, the users would like to retain the original quality of the video.
- The compression process appears to be stripping & changing the meta data of the video. This is a problem because my app uses ffprobe to make use of the video's metadata as part of the editing process. The video returned to the app is basically a totally different video than what was selected (different resolution, metadata, etc.).
- The compression injects and additional and substantial delay in the file open process (especially for larger files) while the users waits for the video to compress. Meanwhile the users has not even asked for their video to be compressed.
- It is different from android. The same package on android does not compress videos. Platform differences like this greatly reduce the value of Flutter as developers must still handle different behavior for different platforms.
To add to the list of issues with compress above, I have an unedited MP4 file from a Gopro that gets returned as JPG after getting compressed. I have other similar videos from he same gopro on which this does not happen.
From what I can see, the video compression happening with ios can be disabled by adding the line
imagePickerController.videoExportPreset = AVAssetExportPresetPassthrough;
in the file FLTImagePickerPlugin.m at line 236 in the image_picker_ios package.
I tested with a .mov video, of original size 8.9Mb and dimension 2727x2304. With the standard image_picker package, after picking (and automatic compression), the file became 4Mb and dimension 1280x1080. With the added line I mentioned, the picked file became 8Mb (so a slight compression, for some reason) but kept the original dimensions: 2727x2304.
It would be good to update the image_picker plugin because this automatic video compression on picking is troublesome and unexpected. But I'm not sure whether it's better to not compress videos at all (in order to have the same behavior as with Android), or to add a generral compression option, in which case we would have to add that option in Android as well to be consistent.
It looks like there was a PR addressing this issue https://github.com/flutter/plugins/pull/3457
However, I still can't achieve the desired behavior of no compression on choosing a video from the gallery.
Just to echo what others have noticed: when I record a 4K/30fps video, I lose ~90% of the data through iOS compression, before uploading it to the final destination. The file size is changed, along with the dimensions.
Edit After reviewing the linked PR again, it seems that it was dropped in the end. So the topic is still open. I made the change locally to the package and the change works as expected. It was a single line as @louisdeveseleer suggested.
It is also very curious that this issue hasn't been brought up much more often since this package is used heavily and high quality videos are often worked with.
@stuartmorgan Could you please advise what would be the best way ahead? I would not mind creating a PR, but I'm not sure if it's better to remove the compression altogether, to provide an ios-specific parameter, or to add the capability on android and have a cross-platform parameter.
I'm not sure if it's better to remove the compression altogether
Unconditionally changing the system-default behavior, which the plugin has always had, would be a regression for many people.
to provide an ios-specific parameter
We would not want an "iOS-specific" parameter per se, but a parameter with a generic name like requestOriginalQuality that is documented to not apply to all platforms is something we do in many plugins (including this one already)
or to add the capability on android and have a cross-platform parameter.
Is there a way to request a pre-compressed/transcoded result in the relevant intent on Android? If so we should support it, if not it doesn't seem like there's any advantage in adding a lot of code to do one arbitrary implementation of that in the plugin itself when it could just add easily be done afterward with much more flexibility.
I was wondering if there is already consensus in how Flutter plans to address the compression settings on iOS and if that's something we can expect to be implemented in the near future?
It seem to me that the generic param: requestOriginalQuality that's implemented only on iOS (with a future possibility of different platforms support) is the way to go.
Odd that there is no option to select the original video.
There is usually no problem with regular videos, but sometimes iPhone users may provide HEVC (H.265) videos shot in HDR. If this HEVC (H.265) video is converted directly to h264 SDR mp4, the resulting video may become whitish as there is no tone mapping applied. To prevent this, the part of the code that converts to mp4 was improved by examining the ios code of image_picker.
By looking at line 232 of packages/image_picker/image_picker_ios/ios/Classes/FLTImagePickerPlugin.m, it can be seen that the coding is done to convert to MP4:
imagePickerController.mediaTypes = @[
(NSString *)kUTTypeMovie, (NSString *)kUTTypeAVIMovie, (NSString *)kUTTypeVideo,
(NSString *)kUTTypeMPEG4
];
Delete the code after (NSString *)kUTTypeMovie, as follows:
imagePickerController.mediaTypes = @[(NSString *)kUTTypeMovie];
I am using this workaround, but I think we need an option to disable IOS compression and conversion
I'm also waiting for this option to be able to disable compression since it causes the audio lost on the compressed video from HEVC format.
The sad thing is pickMedia doesn't compress but doesn't allow you to filter.
There is no audio in the result to (pickVideo(source: ImageSource.gallery) if I select a video that was edited before in the iOS media editor
I have the same problem here, I use it to have users upload their videos, and a small portion of them have no sound in it, we really need either a fix (preferably) or the possibility to disable compression... To me it should be a higher priority than P3, as it's not just about compression, it's about losing the sound of some videos.
If it helps, here's the way too complicated workaround I use: I let the user pick a video, not to have a poor experience for all users while it's only in rare cases. Then, I detect if the uploaded video has sound, using this code:
import 'package:ffmpeg_kit_flutter/ffprobe_kit.dart';
...
Future<bool> hasAudio({required String videoPath}) async {
final session = await FFprobeKit.getMediaInformation(videoPath);
final information = session.getMediaInformation();
if (information == null) {
logWarning("Impossible to get video information");
return true;
}
final hasAudio = information.getStreams().firstWhereOrNull((element) => element.getType() == "audio") != null;
logVerbose("Video has audio: $hasAudio");
return hasAudio;
}
If the uploaded video has no sound, I display a message telling them we had an error on our side to the user, and asking them to pick the video again, but with the pickMedia() method, which disables compression.
Then I double-check that the picked file is video, to display an error message if that's not the case, with that code:
import 'package:mime/mime.dart';
bool isVideo(String path) {
String? mimeTypeString = lookupMimeType(path);
final fileType = mimeTypeString?.split('/').firstOrNull;
return fileType == "video"
}
There is no audio in the result to (
pickVideo(source: ImageSource.gallery) if I select a video that was edited before in the iOS media editor
I've encountered the same issue, and after numerous verifications, I've pinpointed that the problem is caused by the image_picker. It's been five years, and this fundamental issue still hasn't been resolved, which is truly disappointing.
From what I can see, the video compression happening with ios can be disabled by adding the line
imagePickerController.videoExportPreset = AVAssetExportPresetPassthrough;in the fileFLTImagePickerPlugin.mat line 236 in the image_picker_ios package.I tested with a .mov video, of original size 8.9Mb and dimension 2727x2304. With the standard image_picker package, after picking (and automatic compression), the file became 4Mb and dimension 1280x1080. With the added line I mentioned, the picked file became 8Mb (so a slight compression, for some reason) but kept the original dimensions: 2727x2304.
It would be good to update the image_picker plugin because this automatic video compression on picking is troublesome and unexpected. But I'm not sure whether it's better to not compress videos at all (in order to have the same behavior as with Android), or to add a generral compression option, in which case we would have to add that option in Android as well to be consistent.
This method is helpful! For those who are not sure how to follow it, here's a guide.
The path of FLTImagePickerPlugin.m is ios/.symlinks/plugins/image_picker_ios/ios/Classes/FLTImagePickerPlugin.m
UIImagePickerController *imagePickerController = [self createImagePickerController];
imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext;
imagePickerController.delegate = self;
imagePickerController.mediaTypes = @[
(NSString *)kUTTypeMovie,(NSString *)kUTTypeAVIMovie, (NSString *)kUTTypeVideo,
(NSString *)kUTTypeMPEG4
];
imagePickerController.videoQuality = UIImagePickerControllerQualityTypeHigh;
//add this line to disable video compression
imagePickerController.videoExportPreset = AVAssetExportPresetPassthrough;
Any updates?
From what I can see, the video compression happening with ios can be disabled by adding the line
imagePickerController.videoExportPreset = AVAssetExportPresetPassthrough;in the fileFLTImagePickerPlugin.mat line 236 in the image_picker_ios package. I tested with a .mov video, of original size 8.9Mb and dimension 2727x2304. With the standard image_picker package, after picking (and automatic compression), the file became 4Mb and dimension 1280x1080. With the added line I mentioned, the picked file became 8Mb (so a slight compression, for some reason) but kept the original dimensions: 2727x2304. It would be good to update the image_picker plugin because this automatic video compression on picking is troublesome and unexpected. But I'm not sure whether it's better to not compress videos at all (in order to have the same behavior as with Android), or to add a generral compression option, in which case we would have to add that option in Android as well to be consistent.This method is helpful! For those who are not sure how to follow it, here's a guide.
The path of FLTImagePickerPlugin.m is
ios/.symlinks/plugins/image_picker_ios/ios/Classes/FLTImagePickerPlugin.mUIImagePickerController *imagePickerController = [self createImagePickerController]; imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext; imagePickerController.delegate = self; imagePickerController.mediaTypes = @[ (NSString *)kUTTypeMovie,(NSString *)kUTTypeAVIMovie, (NSString *)kUTTypeVideo, (NSString *)kUTTypeMPEG4 ]; imagePickerController.videoQuality = UIImagePickerControllerQualityTypeHigh; //add this line to disable video compression imagePickerController.videoExportPreset = AVAssetExportPresetPassthrough;
im commenting this, to reminds me eveytime i build...