[FFmpeg-user] Corrupt 3gp video

Mark R Bannister mark at proseconsulting.co.uk
Mon Dec 17 16:45:33 CET 2012


On 13/12/2012 17:03, Carl Eugen Hoyos wrote:
> Mark R Bannister <mark <at> proseconsulting.co.uk> writes:
>
>> I've been hacking ffplay and libavformat, and have
>> successfully got it past init_input() in avformat_open_input()
>> by running av_probe_input_buffer() against an avio_open2() of
>> the good file, then  re-running avio_open2() on the bad file
>> before returning from init_input().
> This sounds as if using "ffmpeg -f mov -i file" may have been
> easier...
>
>> However, now s->iformat->read_header() fails with the
>> message:
>>
>> [mov,mp4,m4a,3gp,3g2,mj2 @ 0x681b20] moov atom not found
> It may be theoretically possible to read the file (I am not
> 100% sure), FFmpeg certainly does not support it.
> You could take the moov atom from another file from the same
> camera, add it to the end of the file and fix the offset of
> the atom in the beginning of the file (mdat ?)
>
> Carl Eugen

Thanks for the suggestion.  I recreated the moov atom from another video 
recorded on the same day from the same Android smartphone.  I corrected 
the length of the mdat atom.  AtomicParsley can now dump information 
about the file just fine, including all the relevant atoms.

However, when played in a media player (including ffplay), while the 
first video frame is correct, subsequent frames are partially garbled or 
ghosting.  The audio track is garbled too.

So clearly there is more to a moov atom than just information about how 
the video and audio was encoded.  (I'm learning about MPEG4 as I go 
along here, so please bear with me).

ffplay is sending lots of diagnostic messages to stdout as it tackles 
this file.  Here are some examples:

[mpeg4 @ 0x6842c0] header damaged
[mpeg4 @ 0x6842c0] ac-tex damaged at 39 9
[mpeg4 @ 0x6842c0] Error at MB: 498
[mpeg4 @ 0x6842c0] concealing 1063 DC, 1063 AC, 1063 MV errors in P frame
Frame changed from size:0x0 to size:800x480B vq=  206KB sq=    0B f=0/0
[amrnb @ 0x685580] dtx mode not implemented. Update your FFmpeg version 
to the newest one from Git. If the problem still occurs, it means that 
your file has a feature which has not been implemented.
[amrnb @ 0x685580] Note: libopencore_amrnb supports dtx
[amrnb @ 0x685580] Corrupt bitstream
     Last message repeated 17 times
[amrnb @ 0x685580] dtx mode not implemented. Update your FFmpeg version 
to the newest one from Git. If the problem still occurs, it means that 
your file has a feature which has not been implemented.
[amrnb @ 0x685580] Note: libopencore_amrnb supports dtx
[amrnb @ 0x685580] Corrupt bitstream
     Last message repeated 19 times0 aq=    0KB vq=  450KB sq=    0B f=0/0
[mpeg4 @ 0x6842c0] Error at MB: 976
[mpeg4 @ 0x6842c0] concealing 600 DC, 600 AC, 600 MV errors in P frame
[mpeg4 @ 0x6842c0] ac-tex damaged at 25 23
[mpeg4 @ 0x6842c0] Error at MB: 1198
[mpeg4 @ 0x6842c0] concealing 374 DC, 374 AC, 374 MV errors in P frame
[mpeg4 @ 0x6842c0] header damaged
[mpeg4 @ 0x6842c0] ac-tex damaged at 7 13=  387KB sq=    0B f=0/0
[mpeg4 @ 0x6842c0] Error at MB: 670
[mpeg4 @ 0x6842c0] concealing 892 DC, 892 AC, 892 MV errors in P frame
[amrnb @ 0x685580] Corrupt bitstream
     Last message repeated 4 times
[mpeg4 @ 0x6842c0] header damaged
[mpeg4 @ 0x6842c0] 2. marker bit missing in 3. esc
[mpeg4 @ 0x6842c0] Error at MB: 391
[mpeg4 @ 0x6842c0] concealing 1172 DC, 1172 AC, 1172 MV errors in P frame
[mpeg4 @ 0x6842c0] header damaged  0KB vq=  342KB sq=    0B f=0/0
[mpeg4 @ 0x6842c0] ac-tex damaged at 41 7
[mpeg4 @ 0x6842c0] Error at MB: 398
[mpeg4 @ 0x6842c0] concealing 1165 DC, 1165 AC, 1165 MV errors in P frame
[mpeg4 @ 0x6842c0] ac-tex damaged at 43 9
[mpeg4 @ 0x6842c0] Error at MB: 502
[mpeg4 @ 0x6842c0] concealing 1056 DC, 1056 AC, 1056 MV errors in P frame
[mpeg4 @ 0x6842c0] header damaged  0KB vq=  298KB sq=    0B f=0/0
[mpeg4 @ 0x6842c0] ac-tex damaged at 35 4
[mpeg4 @ 0x6842c0] Error at MB: 239
[mpeg4 @ 0x6842c0] concealing 1314 DC, 1314 AC, 1314 MV errors in P frame
[mpeg4 @ 0x6842c0] header damaged
[mpeg4 @ 0x6842c0] ac-tex damaged at 35 20
[mpeg4 @ 0x6842c0] Error at MB: 1055
[mpeg4 @ 0x6842c0] concealing 518 DC, 518 AC, 518 MV errors in P frame
[amrnb @ 0x685580] Corrupt bitstreamKB vq=  164KB sq=    0B f=0/0
     Last message repeated 3 times

So I know the moov atom is good, because it came from another 3gp video 
that plays just fine.  So what more do I need to understand about the 
moov atom, and the role it plays in helping the video player determine 
exactly where to get each video and audio frame? The moov atom I ripped 
is 30K in size, so there must be lots of data in there I'm going to need 
to fix ...

Checking with MediaInfo, I see the reference file video uses variable 
frame rate mode.  Could this have a bearing on the problem?  If the 
frame rate is variable, how does a media player know where to locate the 
start of each new frame?

Any ideas / suggestions would be very greatly appreciated.

Thanks,
Mark.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3758 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20121217/aff2c853/attachment.p7s>


More information about the ffmpeg-user mailing list