avformat/mp3: skip junk at the beginning of mp3 files

Apparently it can happen that a mp3 file has junk data between id3 tag
and actual mp3 data. Skip this to avoid outputting nonsense timestamps.
(Two packets had the same timestamps, because the mp3 parser failed to
compute a frame duration.)

In this case, the junk consisted of 1044 bytes of zero, which
incidentally is the same size as normal mp3 frames in this stream. I
suspect the mp3 was edited with some tool which wiped the Xing/LAME
headers. Data near the end of the file suggests it was encoded with
"LAME3.97", but the normal Xing/LAME headers are missing. So this could
be "normal". mpg123 also attempts to skip at least 64KB of junk data by
scanning for headers.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
1 file changed
tree: 4e7cfa774904b1cd7cdba91a5326db1ef69c3496
  1. .gitattributes
  2. .gitignore
  3. COPYING.GPLv2
  4. COPYING.GPLv3
  5. COPYING.LGPLv2.1
  6. COPYING.LGPLv3
  7. CREDITS
  8. Changelog
  9. INSTALL.md
  10. LICENSE.md
  11. MAINTAINERS
  12. Makefile
  13. README.md
  14. RELEASE
  15. arch.mak
  16. cmdutils.c
  17. cmdutils.h
  18. cmdutils_common_opts.h
  19. cmdutils_opencl.c
  20. common.mak
  21. compat/
  22. configure
  23. doc/
  24. ffmpeg.c
  25. ffmpeg.h
  26. ffmpeg_dxva2.c
  27. ffmpeg_filter.c
  28. ffmpeg_opt.c
  29. ffmpeg_vda.c
  30. ffmpeg_vdpau.c
  31. ffplay.c
  32. ffprobe.c
  33. ffserver.c
  34. ffserver_config.c
  35. ffserver_config.h
  36. libavcodec/
  37. libavdevice/
  38. libavfilter/
  39. libavformat/
  40. libavresample/
  41. libavutil/
  42. libpostproc/
  43. library.mak
  44. libswresample/
  45. libswscale/
  46. presets/
  47. tests/
  48. tools/
  49. version.sh
README.md

FFmpeg README

FFmpeg is a collection of libraries and tools to process multimedia content such as audio, video, subtitles and related metadata.

Libraries

  • libavcodec provides implementation of a wider range of codecs.
  • libavformat implements streaming protocols, container formats and basic I/O access.
  • libavutil includes hashers, decompressors and miscellaneous utility functions.
  • libavfilter provides a mean to alter decoded Audio and Video through chain of filters.
  • libavdevice provides an abstraction to access capture and playback devices.
  • libswresample implements audio mixing and resampling routines.
  • libswscale implements color conversion and scaling routines.

Tools

  • ffmpeg is a command line toolbox to manipulate, convert and stream multimedia content.
  • ffplay is a minimalistic multimedia player.
  • ffprobe is a simple analysis tool to inspect multimedia content.
  • ffserver is a multimedia streaming server for live broadcasts.
  • Additional small tools such as aviocat, ismindex and qt-faststart.

Documentation

The offline documentation is available in the doc/ directory.

The online documentation is available in the main website and in the wiki.

Examples

Coding examples are available in the doc/examples directory.

License

FFmpeg codebase is mainly LGPL-licensed with optional components licensed under GPL. Please refer to the LICENSE file for detailed information.