Flutter camera plugin, get path before recoding stopped - flutter

I'm using camera plugin to record video. However, I need this video to be transferred to API. I want to do that in chunks, lets say 4MB. I would usually do this with a loop reading file size to check when we have new chunk. The problem is that from version 0.6.0 and above startVideoRecording() no longer accepts path where to store it and I don't know where the file is to keep reading its size. It only gives the path after the recording is stopped. That means I have to start transferring after that and this would be annoying for the user.
I know I can downgrade my version below 0.6.0 but I really don't want to do that if there is another way.
So, is there a way to get current file being recorded after startVideoRecording() is called?

I posted this on the github refactor open issue, just FYI. Looks like they will look at adding it as an optional parameter.

i think you use this lib for help to pickup and capture video or image and get full path and file Object
https://pub.dev/packages/image_picker

Related

Metadata Info on video file.. Pls Advise

I have a question on metadata on video files.. Can metadata tracks the last user who download a video file from sources with the relevant date and time information?
Say if a video was downloaded to my local computer... Subsequently it was copied to another hdd and computer.. Can metadata tells or track the last user of this video files?
If yes how was it done and how to find the info? I know words or excel does track the original author and subsequent user who saved and modified the doc.
Many thanks.
The basic answer is no, you cannot track the last user of a video file by the metadata. There's no OS mechanism to insert this data as it gets copied or moved from computer to computer.
Oh ok. So within the video file itself we cannot tell the last source used and also the origin? I was trying to find out some clue that may presence , ie who last use it and downloaded it

File Uploading in Sakai

I want to know if there is a 'right' way to make file uploads through custom tools.
I've seen the https://confluence.sakaiproject.org/display/BOOT/File+Uploads+with+RSF guide and it seens ok, but It stops with the file in memory with no further info. I can built a random file upload code but I want to make it Sakai-friendly (Using ContentHosting and Resources service?)
Any hints?
Thanks
The link you provided for the first part is a good example of how to get the upload initially processed. Going through RequestFilter will get your files validated, but you can use whatever method you want to upload it.
For the second part, I'd look at the ContentHosting webservice (createContentItem) for an example of how to add a file from a byte[] in memory after you've uploaded it.
These methods in ContentHostingService also accept InputStream as a parameter as of 2.7 (KNL-325), so you don't have to store the entire file in memory and can stream it as you're uploading, which you should do if the files are of any reasonable size.

FMS VOD streaming: How can I access content that was uploaded to the webroot/vod directory?

I have recently started working with a fresh install of FMS 4.5.0 and am having some issues getting my media to load with the VOD application.
After uploading some of my own FLV/F4V content to "/webroot/vod/", I am currently only able to load the samples from the installation.
Is there some sort of configuration that needs to be made to access my media?
Do I need to create a manifest for each video?
I have been running tests through:
http://www.osmf.org/configurator/fmp/
And have had luck accessing the videos that came with the install by using the following:
Video Source (URL): http://[my host]/vod/sample1_1000kbps.f4v
But when I change this to point to one of my recently uploaded videos it fails everytime.
Another strange note, I was able to play one of the samples but then I changed its name and it was still able to load that one specific video using the same filename when the file's name had changed. This leads me to believe that it isn't really loading the right files or perhaps I am uploading to the wrong directory. But I can't find any other directories that have video in them.
Please let me know if there is any more info you need to help me. I'm fairly new to this and am not sure what to include.
Thanks in advance for any help!
EDIT: This was a pathing issue.
This has been resolved.
Apparently my webroot directory for the server was not set up correctly and after it was pointing to the right directory it was fixed.

Record audio, add effects, then save result to a audio file

I am having trouble doing what the title said. My goal is to be able to add any desired effects to your recording, save the modified audio, then send that to a server.
I have searched the fourms and came across these threads:
viewtopic.php?f=7&t=13029&p=45362&hilit=saving#p45362
viewtopic.php?f=7&t=12660&p=44586&hilit=saving#p44586
viewtopic.php?f=7&t=13178&p=45746&hilit=saving#p45746
After reading those, I see it is possible to save the modified audio, but can it only be saved as a wav? Like I said after it is saved it will be sent to a server, so size is a big deal and wavs are relatively big compared to other formats. Ignoring that fact, I tried to implement FMOD_OUTPUTTYPE_WAVWRITER and I cannot get that to work; are there any good examples of using it? I looked though the examples in the library but I didn't see any..
But the basic structure of the app is to record, turn some switches off and on to see what filters you want, preview it, then press a button "Save" that will save it. What would this save function consist of?
Any help appreciated, thanks.
Using FMOD_OUTPUTTYPE_WAVWRITER is fairly straight forward, you set the type via System::setOutput, specify the output file via System::init extradriverdata. The extradriverdata should be an absolute path to a writable area of the device such as the documents directory. After you have finished playing, call System::release and the file will be complete.
The other option for recording wave data with effects is by creating a custom DSP and connecting it to the channel playing the recorded data. You will then get regular callbacks giving you float data that you must write out to disk yourself. You can find examples of DSPs and writing wav files in the dsp_custom and recordtodisk examples respectively.
Finally note that FMOD doesn't come with the facility to write compressed audio to disk, you will need another API to achieve this goal.
You can save as an AAC file via the ExtAudioFile API.

Streaming and playing an MP3 stream. .mp3 URL format

I used the sample code from http://cocoawithlove.com/2008/09/streaming-and-playing-live-mp3-stream.html. it runs OK with default URL. But when I replace with my URL "http://dl.mp3.kapsule.info/fsfsdfdsfdserwrwq3/fc90613208cc3f16ae6d6ba05d21880c/4b5244f0/b/7e/b7e80afa18d06fdd3dd9f9fa44b51fc0.mp3?filename=Every-Day-I-Love-You.mp3", this app shows an message as "Audio not Found". But when I put my URL on Address Bar of Web Browser, I can download this .mp3 file.
really, I can't understand why it is?
pleased tell me!
Thank you very much
My guess would be that the app is designed to play a MP3 encoded audio stream with no limit in length (which is different from your ordinary music file). To set this up, you need a streaming server on the client side.
I think you can find out for sure by trying with a different radio station that transmits in MP3. If that works, it's most likely that your app doesn't like your file.
You should, as Vivek recommends, also try using a simpler download URL for your file, in case the App gets confused by the URL's length and/or structure.
As mentioned, this is due to the URL of the file. The AudioStreamer code specifically checks for the extension of the file and tries to figure out the audio type based on that. If you change that logic to handle your custom URLs, it will start working
So to point you in the right direction: open AudioStreamer.m and look for the references of
hintForFileExtension:
This function returns the type of file based on the extension. If you know the file type won't change (always mp3), the quick and dirty solution is to always assign mp3 type without any logic... like this:
err = AudioFileStreamOpen(self, MyPropertyListenerProc, MyPacketsProc, kAudioFileMP3Type, &audioFileStream);
Note: I've put kAudioFileMP3Type constant instead of calculated value
PS yes, it does work with static mp3 files, even though it's designed for streams and hence misses some of the functionality one would expect from a player that plays a static file on the server (caching, prefetching, proper seeking)
Thats because the default url directly points to a file in the webserver, whereas the the url you've mentioned is a HTTP (POST/GET) operation, which the application may not be designed to handle.
I suspect that your URL is one-time-use. When I try to visit it, I see 408 - Request Timeout.
Many links on mass file sharing websites are like this. If you could download the file directly, you wouldn't sit through a page of ads and premium account offers.
Try again with a file on a normal website, like this one.