Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#4296 closed defect (fixed)

Segfault when transcoding MLV file

Reported by: sgofferj Owned by:
Priority: important Component: avformat
Version: git-master Keywords: mlv
Cc: pross Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Segfault occurs already when just inputting file. Unfortunately, the static build package does not contain ffmpeg_g, so gdb is not possible. I'll try to upload the file to the ftp. If it is to big, I will update the ticket with a download link.

sgofferj@enterprise:~$ uname -a
Linux enterprise 3.13.0-45-generic #74-Ubuntu SMP Tue Jan 13 19:36:28 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

sgofferj@enterprise:~$ ffmpeg/ffmpeg -v 9 -loglevel 99 -i 100CANON/M04-2027.MLV
ffmpeg version N-44018-g77f326d- http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2015 the FFmpeg developers

built with gcc 4.9.2 (Debian 4.9.2-10)
configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --cc=gcc-4.9
libavutil 54. 18.100 / 54. 18.100
libavcodec 56. 21.102 / 56. 21.102
libavformat 56. 19.100 / 56. 19.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 9.103 / 5. 9.103
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100

Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'.
Reading option '-i' ... matched as input file with argument '100CANON/M04-2027.MLV'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 9.
Successfully parsed a group of options.
Parsing a group of options: input file 100CANON/M04-2027.MLV.
Successfully parsed a group of options.
Opening an input file: 100CANON/M04-2027.MLV.
[mlv @ 0x3caaf80] Format mlv probed with size=2048 and score=100
Ignoring attempt to set invalid timebase 1/0 for st:1
st:0 removing common factor 2 from timebase
Segmentation fault (core dumped)

Attachments (1)

bug_4296_sample_file_segfault_MLV_format_cut.mlv (2.4 MB ) - added by Carl Eugen Hoyos 10 years ago.

Change History (15)

comment:1 by sgofferj, 10 years ago

Uploaded sample file bug_4296_sample_file_segfault_MLV_format_first10MB.mlv to upload.ffmpeg.org/incoming

comment:2 by Elon Musk, 10 years ago

And link to uploaded sample is also needed.

comment:3 by sgofferj, 10 years ago

I don't understand. I gave the filename for the sample. Anonymous users don't have read access but my guess would be that the link is ftp://upload.ffmpeg.org/incoming/bug_4296_sample_file_segfault_MLV_format_first10MB.mlv

comment:4 by Carl Eugen Hoyos, 10 years ago

Component: undeterminedavformat
Keywords: mlv added
Priority: normalimportant
Reproduced by developer: set
Resolution: fixed
Status: newclosed
Version: unspecifiedgit-master

Should be fixed in ac923ed47002092e16e3fbd252f607e1d68a9106 - thank you for the report!

Do you have a sample that contains actual audio?

by Carl Eugen Hoyos, 10 years ago

comment:5 by sgofferj, 10 years ago

Nope, I have no sample with audio but I can easily create one if it's needed.

comment:6 by Carl Eugen Hoyos, 10 years ago

I don't think we have a sample with audio, it would be welcome!

comment:7 by sgofferj, 10 years ago

Just recorded with audio and guess what - I found a separate .wav-file on the card :D. So I guess, that's no issue.

comment:8 by sgofferj, 10 years ago

Did a test - did not work.

I get tons of

[mov @ 0x308de00] Non-monotonous DTS in output stream 0:1; previous: 33, current: 18; changing to 34. This may result in incorrect timestamps in the output file.

And the file is truncated.

Here is a ZIP (375MB!) with uncut sample video and audio files and an error.log which contains the output: http://stefan.gofferje.net/ffmpeg-bug-4296-sample-files-and-output.zip

comment:9 by sgofferj, 10 years ago

Tested with today's nightly. Confirmed bug is bixed. Thanks a lot!

in reply to:  8 comment:10 by Carl Eugen Hoyos, 10 years ago

Cc: pross added

Replying to sgofferj:

Here is a ZIP (375MB!) with uncut sample video and audio files and an error.log which contains the output: http://stefan.gofferje.net/ffmpeg-bug-4296-sample-files-and-output.zip

Thank you for the sample!

FFmpeg decodes only two seconds (52 frames) of the video stream.
Could you confirm that this file is undamaged?

$ md5sum M07-2200.MLV
b434454abda1e4583c6fe688640fb8bc  M07-2200.MLV

comment:11 by Carl Eugen Hoyos, 10 years ago

The stream works fine (10 seconds) if I disable audio in the sourcecode, audio timestamps seem broken but I don't know if this is the only problem.

comment:12 by sgofferj, 10 years ago

Yes, I can confirm that the file is good. I just downloaded it myself and watched it with MLRawViewer.
See https://bitbucket.org/baldand/mlrawviewer

I tested with another file without audio today and that converted OK, although the result is very dark, very greenish and doesn't use the full dynamic range.

Interesting enough, exporting with MLRawViewer through ffmpeg does not work. I just get a 185bytes file and that's it. But that's probably another story.

Anyways, MLRawViewer should help you check MLV files for inconsistencies and maybe it's source could help you find the issue in ffmpeg?

comment:13 by Carl Eugen Hoyos, 10 years ago

http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/185237

It is supposed to work (better) with the following filter expression, the values taken from ffmpeg -i output but it is apparently wrong for this sample:
-vf 'lutrgb=r=777*val:b=408*val'

A simpler alternative is -vf histeq but this doesn't work well either.

The following looks better here, do you agree? (I may just misunderstand how it works...)
-vf 'lutrgb=r=1.777*val:b=1.408*val'

comment:14 by sgofferj, 10 years ago

That's maybe a good point. However, your link is about CineDec format which is a bit different. I don't get good results with that formula but I can experiment a bit.

Maybe I should include a sample how the video SHOULD look like :).

http://home.gofferje.net/images/screenshot-052.png

Note: See TracTickets for help on using tickets.