0

I have several videos which produce reading errors in ffmpeg, thus hindering me to play them in VLC (for example). Is there a way to either skip those problematic parts, or to fix them?
The exact error is:

[matroska,webm @ 0x3a13a20] Read error at pos. 11794050343 (0x2befaed27)
[NULL @ 0x3a18380] Unable to find a suitable output format for '2'
2: Invalid argument

generated by the command ffmpeg -v error -i "sample.mkv" -map 0:1 -f null - 2

The video itself has the following encoding (by mediainfo):

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : [email protected]
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 2h 1mn
Bit rate                                 : 10.8 Mbps
Width                                    : 1 920 pixels
Height                                   : 1 040 pixels
Display aspect ratio                     : 1.85:1
Frame rate mode                          : Constant
Frame rate                               : 23.976 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.227
Stream size                              : 8.95 GiB (81%)
Writing library                          : x264 core 59 r819M 0414d78
Encoding settings                        : cabac=1 / ref=4 / deblock=1:0:0 / analyse=0x3:0x113 / me=umh / subme=6 / me-prepass=0 / brdo=1 / mixed_ref=1 / me_range=12 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=0 / threads=6 / nr=0 / decimate=1 / mbaff=0 / bframes=4 / b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=3 / wpredb=1 / bime=1 / keyint=250 / keyint_min=25 / scenecut=40(pre) / rc=2pass / bitrate=10849 / ratetol=1.0 / rceq='blurCplx^(1-qComp)' / qcomp=1.00 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=24000 / vbv_bufsize=9000 / ip_ratio=1.10 / pb_ratio=1.10 / aq=2:1.00
Language                                 : English
Default                                  : Yes
Forced                                   : No

Audio #1
ID                                       : 2
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Codec ID                                 : A_AC3
Duration                                 : 2h 1mn
Bit rate mode                            : Constant
Bit rate                                 : 640 Kbps
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Stream size                              : 555 MiB (5%)
Title                                    : eng
Language                                 : English
Default                                  : No
Forced                                   : No

Audio #2
ID                                       : 3
Format                                   : DTS
Format/Info                              : Digital Theater Systems
Mode                                     : 16
Format settings, Endianness              : Big
Codec ID                                 : A_DTS
Duration                                 : 2h 1mn
Bit rate mode                            : Constant
Bit rate                                 : 1 510 Kbps
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Bit depth                                : 24 bits
Compression mode                         : Lossy
Stream size                              : 1.28 GiB (12%)
Title                                    : ger
Language                                 : German
Default                                  : Yes
Forced                                   : No

Moving to another location does not fix the error.

7
  • How can we reproduce the issue?
    – llogan
    Mar 8, 2016 at 2:46
  • By using one of my defect files (as far as I know at the moment). Is there another way to produce that error?
    – arc_lupus
    Mar 8, 2016 at 7:15
  • You didn't actually show the exact error, so I'm not sure what the error is. Can you provide a short sample input file?
    – llogan
    Mar 8, 2016 at 17:26
  • I added the error, should I just cut the sample with the error out of the full file? If yes, which program can be used for that?
    – arc_lupus
    Mar 9, 2016 at 21:54
  • 1
    Why is the 2 there at the end? If it's for stderr, you aren't redirecting it anywhere.
    – Gyan
    Mar 11, 2016 at 10:51

2 Answers 2

2

I would determine if this is a corrupt file or a corrupt disk. A "read error" sounds like a bad disk to me. If that is the case you probably have bigger problems than reading that video file. I would suggest doing a complete backup of the disk. You can use dd_rescue (or ddrescue) for that purpose which doesn't stop on bad sectors but makes a copy of everything readable on the disk. Once you have got that done, you can take care of the video file on the backup disk.

http://www.garloff.de/kurt/linux/ddrescue/ https://www.gnu.org/software/ddrescue/

If the disk is on the verge of failing, the worst you can do is continuing to use it since it may stop working completely anytime soon.

9
  • I checked the disk using badblocks, and it showed no errors, thus I assume that the disk is still ok. How can I fix the corrupt file then?
    – arc_lupus
    Mar 11, 2016 at 9:28
  • did you check SMART results as well? See this thread: lime-technology.com/forum/… Mar 11, 2016 at 9:36
  • If you are positive there is no read errors on the disk, I'd try to make a copy of the file and see how that copy behaves in VLC. Mar 11, 2016 at 9:46
  • Unfortunately the external hard disk does not support SMART, at least according to gnome-disks
    – arc_lupus
    Mar 11, 2016 at 10:26
  • The copy does not behave differently, it still freezes at the same point
    – arc_lupus
    Mar 11, 2016 at 10:46
0

I've recently had some success with this problem. In my case I was receiving the error converting from MKV to MP4. The cause of the issue was that the process that created the MKV file failed silently when I ran out of disk space so the source feed to ffmpeg was already corrupt; the error was indicating there was no data to convert beyond that point in the source.

Fortunately I was able to recreate the MKV from it's source (after freeing up disk space of course).

Further, as mentioned in Mulvya's comment on your question, the "2" here seems to be what the command is complaining about.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.