In this thread, a VLC developer says that VLC cannot play partially downloaded mp4 files because the info is stored at the end of the file. But recently when I tested the same, adding a mp4 task in Chrome and passing the partial .crdownload to VLC, it worked. VLC played the mp4 without a glitch. I didn't let the download finish and stopped the player in the middle to save bandwidth, but I believe it would have played the entire media while Chrome was still downloading it. I was also able to seek through the video, which some unfinished video formats won't allow. What to make of this? I'm doing a media streamer as a pet project and really wanna know if I can initiate the download and pass the media to vlc via command line after certain amount of bytes are downloaded.
Can VLC play unfinished MP4 files
.mp4streamingvlc-media-player
Best Answer
MP4 files can have the metadata chunk at the beginning or at the end. It is usually at the end for freshly encoded files because the encoder might not know what values to write until it's done encoding the whole video (especially the parts needed for seeking).
But when preparing MP4 files for online streaming, it is common to move metadata to the beginning, e.g. as described in this blog post. (In other words, you're not the first to want to do this – it's everyday business for web browsers.)
Note: Although the post shows a full re-encode being done, I am not sure whether that is actually needed – it should be enough to just remux with
-codec copy -movflags faststart
and avoid the quality loss.There are tools you can use to see the actual structure of a given MP4 file, e.g.:
Here
mdat
contains the actual audio/video data (just a single audio stream in this case) andmoov
contains the metadata (e.g.moov.udta.meta.ilst.©nam
is the track title).