Video compression for backup purposes - mp4

I'd like to know if there is a method/application to further compress MP4 files without loss as compressed files (zip-like) for archival purposes, even if I had to make a bigger file before recompressing.
I don't need to play the videos immediately, it's to have a medium to long term backup, so the zipping/unzipping process wouldn't be an issue for me.
Thanks.

No. The last step in video compression is a lossless entropy encoder similar to zip. What you are asking to do has already been done to the file.

Related

How to download the worst audio quality with youtube-dl?

I can't find a way to download the worst audio file quality of a video using youtube-dl, people ask how to download the best quality (and short answer is it automatically downloads the best) but what if I want the worst?
using the -F option I get this output :
Of course I could just type -f 249 to manually choose the tiniest audio only file to download. But I am trying to make an automated system, to download the worst quality of any video, therefore I can't use this format (it may change).
I could use --audio-format webm but as you can see in the screenshot there are 3 candidates and again youtube-dl downloads the best of the three (the worst quality being the lowest in this webm format).
I could use --audio-quality 9 but this is a post-processing option which means it will first download the best quality and then converts it afterwards (not bandwidth-friendly, my last option....).
What is a proper way to download the worst quality? (lastly I tried -f worst -x but it doesn't work)
Edit : Also, I know that I can use the output of -F and slice the lines to determine the worst audio available. But I am probing if there is any way to directly do that using youtube-dl
Haven't tried yet, but, according to the docs, you can use:
wa, worstaudio: Select the worst quality audio-only format. Equivalent to worst*[vcodec=none]
Check the latest paragraphs on the "Sorting Formats" section of the docs for more info.

Download Result of Source Destination (Web Audio API)

I'm building a tool to edit audio with the Web Audio API.
Here is where I'm stuck:
...
source
.connect(gainNode)
.connect(analyser)
.connect(analyser2)
.connect(audioCtx.destination);
};
What I've written (which ends with the code above) successfully allows the user to upload a file, apply effects, and listen to it on play(). How would I then allow the user to click a button to export the results to a WAV file?
I've tried several methods online that have not worked for my use case.
Please let me know if more code is needed. Thank you for taking a look!
If you want a WAV file, I think you have to do that yourself. WAV files are quite simple. In this case, you'll need to add either a ScriptProcessorNode or AudioWorkletNode just before the destination to capture all the audio and convert it to a WAV file that can be downloaded.
If a compressed file is ok, you can look into MediaRecorder to save the data for you.
I ended up solving this by writing an entirely different script to download the file using OfflineAudioContext.
My original script plays the audio with effects, and the second script downloads it with the same effects. Now to figure out why there is latency on the effects while using OfflineAudioContext.

Generating smaller video file size from frames

I am doing a project in which I have a video I divide the video into frames and then the image steganography is applied to the frames and the encoded frames are generated. Then the encoded frames are to be converted into video again. All of the methods are applied successfully but the only problem is that I get the encoded video which is very large then the original video. I am using the movie2avi function to generate the video.
Can someone suggest any way to generate the video which is not very large compared to the original video?
First, if you're using movie2avi, you have a limited choice of very poor codecs (compression formats). If you have a new enough version of Matlab (R2009b+ I think) you should be using the VideoWriter class instead. The choice of codecs is still not very good, but they are of much better quality. You didn't indicate which codec (or OS) you're using so I can't recommend an alternative.
Second, even under ideal circumstances you should expect your movie file to get larger with what you're doing unless you apply additional compression. Adding steganographic content is akin to adding noise so you're making the data harder to compress. In both movie2avi and VideoWriter you can adjust the compression level or quality depending on the codec. Also, the default movie2avi codec under Linux and OS X uses no compression so the file will be huge if you haven't changed that.
If VideoWriter doesn't meet your needs (or if your version doesn't have it) you can try my QTWriter class on GitHub that allows one to export QuickTime movies in Matlab. It works very much like VideoWriter, but allows you to create high quality QuickTime movies using a few image-based codecs. No inter-frame compression is used and the PNG and TIFF formats are lossless (this may be important to your steganographic application) while being very efficient at encoding content like that often generated in Matlab. There is also a JPEG format that may be better suited to general images. The QuickTime files can then be converted to other formats if needed. You can read more and see examples here and download the single M-file here.
This is completely dependent on what you are trying to hide in the original video. Remember that the original video is using a compression codec that can take advantage of minimal change frame to frame and various other things, but if you go and try to hide something in that video through steganography, you are making it more difficult for the compression algorithm to do that, which will definitely result in a larger file. So you have to be careful what you are attempting to do, and how you are attempting to encode it.

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.

How to create quicktime movie from a sequence of images via perl?

I would like to create a quicktime movie from a sequence of still frames via perl. It seems like there should be a relatively simple way to do this, but so far I have not found it. Things I've tried:
Reading the Quicktime file spec and creating the movie file from scratch. This low level approach has worked well for me in the past with TIFF and PDF file formats, but Quicktime seems dauntingly complicated.
Looking at the various quicktime-related perl modules. So far I haven't found one that lets me do what I want (images --> movie) with a minimum of fuss.
Using Applescript and Quicktime Player. This would probably work if I paid for Quicktime Pro, but I'd prefer not to do that.
I'm interested in any suggestions (even non-perl-based ones) for a relatively simple way to assemble a sequence of images into a quicktime movie.
Video encoding isn't really an ideal job for perl -- there are a lot of pieces to put together. I would suggest just using mencoder -- you can use an input of e.g. -mf type=png:fps=30 mf://frame*.png, and an output format of e.g. -of lavf -ovc lavc -lavcopts vcodec=libx264 -o whatever.mov. If you want to dub in audio you can use -audiofile whatever.mp3, and then either -acodec copy if you want it to be MP3 in the movie as well, or perhaps -acodec faac (and -faacopts) if the audio format in the movie needs to be AAC. There are lots of different options to tweak and things to learn but it's pretty much the ideal tool for the job. FFmpeg is nicer to use in a lot of ways, but it doesn't have the mf:// input mode, which makes assembling a video from frames a lot more painful.