Page 1 of 1

Converting PART to MP4

Posted: Mon Jan 22, 2018 11:55 pm
by joejim
I have a PART file (per Windows Explorer Properties), test.part file. This is download of live sport broadcast from Firefox, HLS stream.
I am trying to convert to MP4.
Sometimes download is completed and I get .mp4.part file extension such as test.mp4.part.
or sometimes if download is stopped, I get test.part file.

So I tried following commands.

.\ffmpeg -i test.part -codec copy file.mp4 gives me "Invalid data found when processing input error."
.\ffmpeg -i test.mp4.part -codec copy file.mp4 gives me "no such file in directory"
.\ffmpeg -i test.mp4 -codec copy file.mp4 gives me "no such file in directory"

I get same errors with -codec replaced by -c, such as .\ffmpeg -i test.mp4 -c copy file.mp4

Any suggestions as to how to convert PART to MP4?
It seem like should be a simple process but not working.

Re: Converting PART to MP4

Posted: Mon Jan 22, 2018 11:59 pm
by joejim
Before I posted my question, I did search on PART, convert to MP4, etc.. NOTHING that I found in this forum, but plenty on internet search (but NONE worked)
Hummmm?? I thought converting PART to MP4 would be a popular topic but I guess I am wrong?

Re: Converting PART to MP4

Posted: Tue Jan 23, 2018 12:40 am
by therube
Don't know that a ".part" file is supposed to be anything except what the particular application that created it expected it to be.

Anyhow, assuming that a .part file is a partially (or fully) downloaded video (audio) file, why not just drop the .part part (;-) & rename it to .mp4.

So instead of test.part, make it test.part.mp4.
(Leaving the .part part may clue you in to the fact of how it came to be & that it may not necessarily be complete or correct.)

(Oh, from Firefox. In that case, a .part file simply signifies it is a file that was downloading that never completed to the point that the "temporary" copy of it, the .part file in this case, was not written out to the expected output directory, for whatever reason. FF downloads somewhere in to %TMP% or similar, then moves the completed file to its intended location. So the .part could be a .xpi or a .gif or a .jpg or a .zip or... a .mp4, possibly.)

Now that you have a file named *.mp4 instead of .part, open it.
Does it play?
Does it play fully or might it be truncated or otherwise incomplete?

MediaInfo (or other utility) might clue you in to whether the file is incomplete.
(Or even ffprobe ;-).)

If the file is incomplete or otherwise has trouble playing, using ffmpeg to copy it, as you were attempting to do, might (or might not) help out. (Can't hurt to try.)

With ffmpeg, -c and -copy are synonyms, so either way is fine.
The -i has to properly identify its input.
So if the file is named, test.part, you should use, -i test.part.
You cannot "force" a file to be something it isn't, or make ffmpeg think a file is something it isn't by sticking in a "hint" in its name, to the -i parameter, so test.mp4 & test.mp4.part rightfully should fail, as those files do not exist. What is there is test.part.

Now test.part may or may not be a .mp4, may or may not be valid.
Again assuming this .part file is a .mp4, it is possible that it contains "invalid data", but can still play.

So try playing your file.mp4 & see what you get.
Likewise you can open test.part & file.mp4 in MediaInfo (ffprobe) & see what that says about input & output files.

(Oh, btw, youtube-dl, by default - but it doesn't have to, uses the file extension of .part, for its partially downloaded files.)