LigH
1st October 2009, 16:09
Currently we have a little "challenge" to demux AVC video from a supposed FLV file - which was found to be in fact an MP4 file - using only ffmpeg, mencoder or mplayer.
General
Complete name : atu.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42
File size : 9.41 MiB
Duration : 3mn 51s
Overall bit rate : 341 Kbps
Encoded date : UTC 2008-01-04 23:28:16
Tagged date : UTC 2008-01-04 23:28:16
Video
ID : 2
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Baseline@L1.1
Format settings, CABAC : No
Format settings, ReFrames : 1 frame
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 3mn 51s
Bit rate mode : Variable
Bit rate : 225 Kbps
Maximum bit rate : 1 219 Kbps
Width : 320 pixels
Height : 136 pixels
Display aspect ratio : 2.35:1
Frame rate mode : Constant
Frame rate : 25.000 fps
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.206
Stream size : 6.20 MiB (66%)
Title : (C) 2007 Google Inc. v06.24.2007.
Encoded date : UTC 2008-01-04 23:28:16
Tagged date : UTC 2008-01-04 23:28:16
Audio
ID : 1
Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : LC
Format settings, SBR : No
Codec ID : 40
Duration : 3mn 51s
Bit rate mode : Variable
Bit rate : 114 Kbps
Maximum bit rate : 147 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 44.1 KHz
Resolution : 16 bits
Stream size : 3.15 MiB (33%)
Title : (C) 2007 Google Inc. v06.24.2007.
Encoded date : UTC 2008-01-04 23:28:16
Tagged date : UTC 2008-01-04 23:28:16
The first surprise was to find out that ffmpeg needs a filename extension matching to the wanted output format, or you always get errors like "Unable to find a suitable output format for 'outputfile'". So we were already happy to find working combinations of extension and format; but the result was incorrect, DGAVCIndex could not find any video in the supposedly demuxed file.
So I compared it against MP4Box, which worked fine:
MP4Box.exe -raw 2 -out atu.264 atu.mp4
Result: 6509061 bytes, working in DGAVCIndex
ffmpeg.exe -vcodec copy -an -i atu.mp4 atu.h264
Result: 6497042 bytes, NOT working in DGAVCIndex
ffmpeg.exe -vcodec copy -an -i atu.mp4 -f rawvideo atu.raw
Result: 6497042 bytes, NOT working in DGAVCIndex (atu.raw is binary identical to atu.h264)
So ... is a "raw AVC" file more than just raw? Or does ffmpeg miss to demultiplex a piece of it?
General
Complete name : atu.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42
File size : 9.41 MiB
Duration : 3mn 51s
Overall bit rate : 341 Kbps
Encoded date : UTC 2008-01-04 23:28:16
Tagged date : UTC 2008-01-04 23:28:16
Video
ID : 2
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Baseline@L1.1
Format settings, CABAC : No
Format settings, ReFrames : 1 frame
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 3mn 51s
Bit rate mode : Variable
Bit rate : 225 Kbps
Maximum bit rate : 1 219 Kbps
Width : 320 pixels
Height : 136 pixels
Display aspect ratio : 2.35:1
Frame rate mode : Constant
Frame rate : 25.000 fps
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.206
Stream size : 6.20 MiB (66%)
Title : (C) 2007 Google Inc. v06.24.2007.
Encoded date : UTC 2008-01-04 23:28:16
Tagged date : UTC 2008-01-04 23:28:16
Audio
ID : 1
Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : LC
Format settings, SBR : No
Codec ID : 40
Duration : 3mn 51s
Bit rate mode : Variable
Bit rate : 114 Kbps
Maximum bit rate : 147 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 44.1 KHz
Resolution : 16 bits
Stream size : 3.15 MiB (33%)
Title : (C) 2007 Google Inc. v06.24.2007.
Encoded date : UTC 2008-01-04 23:28:16
Tagged date : UTC 2008-01-04 23:28:16
The first surprise was to find out that ffmpeg needs a filename extension matching to the wanted output format, or you always get errors like "Unable to find a suitable output format for 'outputfile'". So we were already happy to find working combinations of extension and format; but the result was incorrect, DGAVCIndex could not find any video in the supposedly demuxed file.
So I compared it against MP4Box, which worked fine:
MP4Box.exe -raw 2 -out atu.264 atu.mp4
Result: 6509061 bytes, working in DGAVCIndex
ffmpeg.exe -vcodec copy -an -i atu.mp4 atu.h264
Result: 6497042 bytes, NOT working in DGAVCIndex
ffmpeg.exe -vcodec copy -an -i atu.mp4 -f rawvideo atu.raw
Result: 6497042 bytes, NOT working in DGAVCIndex (atu.raw is binary identical to atu.h264)
So ... is a "raw AVC" file more than just raw? Or does ffmpeg miss to demultiplex a piece of it?