leandromoreira / ffmpeg-libav-tutorial

FFmpeg libav tutorial - learn how media works from basic to transmuxing, transcoding and more. Translations: πŸ‡ΊπŸ‡Έ πŸ‡¨πŸ‡³ πŸ‡°πŸ‡· πŸ‡ͺπŸ‡Έ πŸ‡»πŸ‡³ πŸ‡§πŸ‡·
https://github.com/leandromoreira/ffmpeg-libav-tutorial
BSD 3-Clause "New" or "Revised" License
9.94k stars 956 forks source link

add avregister all before create avFormatContext #53

Closed kennykarnama closed 4 years ago

kennykarnama commented 4 years ago

Hi just found an issue when i try to run without using docker container. The issue was avformat_open_input returns error -1094995529 Here is the log

LOG: initializing all the containers, codecs and protocols.
LOG: opening the input file (2.mp4) and loading format (container) header
LOG: ERROR could not open the file, error code (Invalid data found when processing input)

Practically, it was caused because of no muxer/demuxer registerd based on this : https://stackoverflow.com/questions/39778605/ffmpeg-avformat-open-input-not-working-invalid-data-found-when-processing-input

to solve it i added

 av_register_all();
  avcodec_register_all();
leandromoreira commented 4 years ago

Hi @kennykarnama thanks for the heads up but calling these two functions is actually not needed anymore in ffmpeg 4.0 you had to call it because you're using an older version.

kennykarnama commented 4 years ago

oh ok will close it then thanks