How to play different video files as one file? - caching

I want to concatenate different video files (playlist) as one file, so user can play them as if they were one movie, I read about pre-buffering, but I didn't find a clear way to do so, also is it possible to just play a certain portion of a file without downloading the whole file,
Regards,

Related

Sort videos by bytes/second

I'm trying to find a way to sort videos by their bytes/second (b/s) ratio. I don't mean the b/s rates which one can set when rendering videos, but the actual "how big is this file" divided by "how long is the video" ratio.
The videos are in different folders (all contained in one parent folder) and I don't want to change their location with the sorting. I want a descending list with the filename, optionally the path to that file and the ratio of b/s; commandline-output would be fine.
Is there any way to do this in Windows natively? I assume there isn't, so my question is rather: How would one do that? My best guess is to try to write a .bat script for that but there might also be programs for something like that already.
Ok, this seems quite easy to do by getting the bitrate of the files via ffmpeg
FFMPEG - batch extracting media duration and writing to a text file

Add subtile (srt) file to existing mkv file

Is it possible to add a subtitle file (srt) to an existing mkv file?
I can easily embed the srt file in a new mkv file, but it is quite time-consuming.
If it is not possible just to add a srt file to the mkw container can anyone explain why?
I’m using MKVToolNix ver. 9.5.0
Cheers
/Jonas
As suggested I found an explaining answer in a superuser group.
"It cannot just be added at the end. The srt file needs to be splitted into the individual lines and interleaved with the video and audio blocks through the whole file. The clusters and cues need to be adjusted for all tracks, headers need to be added and updated. It is a complicated process."
https://www.matroska.org/technical/diagram/index.html

When recording MP4 using ffmpeg suddenly power off

Now I used C language and ffmpeg realize a multiplex real-time audio and video to MP4 files of the program and everything works fine, but when in the process of reuse of sudden power failure, the recording is MP4 file is damaged, VLC can not play this file.
I think reason is no call to write the trailer function av_write_trailer , causing index and time stamp information lost, I use araxis merge tool compared the successful call av_write_trailer function of file and a no av_write_trailer to call the damaged files and found two different points:
1. Damaged files in the file header box number value not right
2. The damaged file no end of file.
Now I want to repair after power on my program can automatically repair the damaged files, in Google did not find effective methods.
my train of thought is in the normal recording process saves per second a damaged file is missing two information: box number and end of file, save it to a local file, when writing the MP4 file integrity delete this file after, if power off damaged, then in the next power, read the file and the corresponding information to write the damaged files corresponding position to. But now the problem is that I don't know how to save the number of box and the end of the file, I this is feasible? If possible, what should I do? Looking forward to your reply!
The main cause of MP4 file damage is due to header or trailer not written properly on the file , then , whole file become a junk data. Thus none of the media player able to play the broken mp4 file.
So,
First , broken file has to be repaired before playing the file.
there are some applications and tricks available to repair and get the data back
links are given below :
http://grauonline.de/cms2/?page_id=5 (Windows / Mac)(paid :( )
https://github.com/ponchio/untrunc (Linux based OS)(ofcourse,free!!!)
Second, Manually repairing the corrupt file using HEX editor.
Logic behind this hack :
This hack requires a broken mp4 file and good video file where both videos are captured from the same camera .Also its size should be larger than the broken mp4 file.
Open both video file in any HEX editor. Copy trailer part from good video file to broken video file and save it!Done!!
Note : Always have a backup of video file.
follow these links for detailed informations :
http://janit.iki.fi/repair-corrupted-mp4-video/
https://www.lfs.net/forum/thread/45156-Repair-a-corrupt-mp4-file%3F
http://hackaday.com/2015/04/02/manual-data-recovery-with-a-hex-editor/
http://www.hexview.org/hex-repair-corrupt-file.html
Third, Even tough MP4 file has many advantages , this kind of error is unpredictable and difficult to handle it.
Thus , Using format such as MPG and AV_CODEC_ID_MPEG1VIDEO/AV_CODEC_ID_MPEG2VIDEO (FFMPEG) may help to avoid this kind of error. The mentioned MPG format does not require any header/trailer.if there is any sudden power failure MPG file can play the file whatever frames are stored so far.
Note : there are other formats and codec also available with this kind of properties.

Accessing & Manipulating video frames from .mp4 file in Windows Phone 7 app

As you may know, when you record a video on a windows phone, it is saved as a .mp4. I want to be able to access the video file (even if it's only stored in isolated storage for the app), and manipulate the pixel values for each frame.
I can't find anything that allows me to load a .mp4 into an app, then access the frames. I want to be able to save the manipulated video as .mp4 file as well, or be able to share it.
Has anyone figured out a good set of steps to do this?
My guess was to first load the .mp4 file into a Stream object. From here I don't know what exactly I can do, but I want to get it into a form where I can iterate through the frames, manipulate the pixels, then create a .mp4 with the audio again once the manipulation is completed.
I tried doing the exact same thing once. Unfortunately, there are no publicly available libraries that will help you with this. You will have to write your own code to do this.
The way to go about this would be to first read up on the storage format of mp4 and figure out how the frames are stored there. You can then read the mp4, extract the frames, modify them and stitch them back in the original format.
My biggest concern is that the hardware might not be powerful enough to accomplish this in a sufficiently small amount of time.

How to write a script in ruby that adds the playtime of movies up

I have various folders with .avi and .mkv files in it.
I would like to write a script in ruby to count all these files and extract their playtime to see how much time I have spent watching movies.
I am new to programming, so I have no idea how to access the metadata in these files.
Any help on how to do this?
I have never used it, but there is a gem called rvideo, which allows you to get video file metadata (it uses ffmpeg underneath).
According to the documentation to get the video file duration you'd just have to run:
RVideo::Inspector.new(:file => "some_file.avi").duration
Couple that with Dir.glob, and you're pretty much set.

Resources