[PATCH]Check if free atoms in mov are actually moov atoms
Hi! Attached patch fixes ticket #1551, this is how vlc decodes the sample. Please comment, Carl Eugen
Carl Eugen Hoyos <cehoyos <at> ag.or.at> writes:
Attached patch fixes ticket #1551, this is how vlc decodes the sample.
As-is, this is probably not such a good idea, the vlc code only uses the "bad" atom if no moov atom was found: http://git.videolan.org/?p=vlc.git;a=commitdiff;h=b5a213db Carl Eugen
On Thursday 06 March 2014 01:29:13 pm Carl Eugen Hoyos wrote:
Carl Eugen Hoyos <cehoyos <at> ag.or.at> writes:
Attached patch fixes ticket #1551, this is how vlc decodes the sample.
As-is, this is probably not such a good idea, the vlc code only uses the "bad" atom if no moov atom was found: http://git.videolan.org/?p=vlc.git;a=commitdiff;h=b5a213db
New patch attached. Please comment, Carl Eugen
On Sat, May 31, 2014 at 10:29:05AM +0200, Carl Eugen Hoyos wrote:
On Thursday 06 March 2014 01:29:13 pm Carl Eugen Hoyos wrote:
Carl Eugen Hoyos <cehoyos <at> ag.or.at> writes:
Attached patch fixes ticket #1551, this is how vlc decodes the sample.
As-is, this is probably not such a good idea, the vlc code only uses the "bad" atom if no moov atom was found: http://git.videolan.org/?p=vlc.git;a=commitdiff;h=b5a213db
New patch attached.
Please comment, Carl Eugen
isom.h | 1 + mov.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) 6a6133045ad254409037d8b423fba00507af6f74 patchmoovfree2.diff diff --git a/libavformat/isom.h b/libavformat/isom.h index a5934af..253451e 100644
LGTM [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If a bugfix only changes things apparently unrelated to the bug with no further explanation, that is a good sign that the bugfix is wrong.
On Sat, May 31, 2014 at 10:29 AM, Carl Eugen Hoyos <cehoyos@ag.or.at> wrote:
On Thursday 06 March 2014 01:29:13 pm Carl Eugen Hoyos wrote:
Carl Eugen Hoyos <cehoyos <at> ag.or.at> writes:
Attached patch fixes ticket #1551, this is how vlc decodes the sample.
As-is, this is probably not such a good idea, the vlc code only uses the "bad" atom if no moov atom was found: http://git.videolan.org/?p=vlc.git;a=commitdiff;h=b5a213db
New patch attached.
Please comment, Carl Eugen
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Do I understand it correctly that this now happens by default? This might be a problem for api users who use libav* to determine if something is a valid file, because it will now treat an invalid file as a valid file. The log output does not help them. I think this is a good default for a player but not for a general purpose api and there should at least be a switch to turn it off or on (maybe someting along the lines of strict_std_compliance in codec context or an AVFMT_FLAG_*). I don't know about the policies for versioning but this may be a reason to bump as it modifies behaviour significantly. Never mind the comment, if I misinterpreted the code.
Robert Krüger <krueger <at> lesspain.de> writes:
On Sat, May 31, 2014 at 10:29 AM, Carl Eugen Hoyos wrote:
On Thursday 06 March 2014 01:29:13 pm Carl Eugen Hoyos wrote:
Carl Eugen Hoyos <cehoyos <at> ag.or.at> writes:
Attached patch fixes ticket #1551, this is how vlc decodes the sample.
New patch attached.
Do I understand it correctly that this now happens by default? This might be a problem for api users who use libav* to determine if something is a valid file, because it will now treat an invalid file as a valid file.
This was FFmpeg's behaviour since forever, think of transport streams without PAT/PMT, avi files without index or wav files that don't conform to the spec. You will also find that decoders accept invalid (audio or video) streams, often without any warning. Carl Eugen
On 31/05/14 09:29, Carl Eugen Hoyos wrote:
On Thursday 06 March 2014 01:29:13 pm Carl Eugen Hoyos wrote:
Carl Eugen Hoyos <cehoyos <at> ag.or.at> writes:
Attached patch fixes ticket #1551, this is how vlc decodes the sample.
As-is, this is probably not such a good idea, the vlc code only uses the "bad" atom if no moov atom was found:
It is not uncommon for a valid mov file to have several "free" atoms that contain valid "moov" information from before an alteration. In the circumstances where some operation gets as far as changing the "current" moov atom to "free", but then fails to create a valid new moov atom, the best choice of which "old" version to use, is probably the last (i.e the one nearest the end of the file) not the first one that matches the type.
New patch attached.
Please comment, Carl Eugen
[..]
-- Tim
tim nicholson <nichot20 <at> yahoo.com> writes:
In the circumstances where some operation gets as far as changing the "current" moov atom to "free", but then fails to create a valid new moov atom, the best choice of which "old" version to use, is probably the last (i.e the one nearest the end of the file) not the first one that matches the type.
I will not be able to improve this without a sample. Sorry, Carl Eugen
On 02/06/14 10:26, Carl Eugen Hoyos wrote:
tim nicholson <nichot20 <at> yahoo.com> writes:
In the circumstances where some operation gets as far as changing the "current" moov atom to "free", but then fails to create a valid new moov atom, the best choice of which "old" version to use, is probably the last (i.e the one nearest the end of the file) not the first one that matches the type.
I will not be able to improve this without a sample.
http://www.datafilehost.com/d/3bd1188d Tried upload.ffmpeg.org but it wasn't playing ball. Its about 2M tops. 3 free atoms, two of which are old moov, and one final moov.
Sorry, Carl Eugen [..]
tim nicholson <nichot20 <at> yahoo.com> writes:
3 free atoms, two of which are old moov, and one final moov.
What should be changed, ie what is the wrong behaviour in your opinion about this file? (It plays here fine both with current and old FFmpeg.) Carl Eugen
On 02/06/14 15:37, Carl Eugen Hoyos wrote:
tim nicholson <nichot20 <at> yahoo.com> writes:
3 free atoms, two of which are old moov, and one final moov.
What should be changed, ie what is the wrong behaviour in your opinion about this file?
nothing is wrong with it, but it is an example of a file with two potential free atoms that could be used as moov's if the genuine moov were to become corrupted (I thought I'd let you do that bit, losing the last 3759 bytes should do it ;) )
(It plays here fine both with current and old FFmpeg.)
So that is your reference, If you truncate it you have a broken file you can test your patch against.
Carl Eugen
participants (4)
-
Carl Eugen Hoyos -
Michael Niedermayer -
Robert Krüger -
tim nicholson