Guys help with the problem already the whole head broke I can not figure it out.
I'm trying to run a simple example of playing a video file (so far without synchronization) from here . The video is reproduced normally, instead of the sound of cod and noise, although it is written that I should play as it should be ..... I just can not understand what it is connected with.

ffmpeg version:

 ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 4.7 (Debian 4.7.2-5) configuration: --prefix=/usr/local --enable-shared --enable-ffplay -- enable-libx264 --enable-gpl --disable-nvenc libavutil 55. 34.100 / 55. 34.100 libavcodec 57. 64.101 / 57. 64.101 libavformat 57. 56.100 / 57. 56.100 libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100 libswscale 4. 2.100 / 4. 2.100 libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100 / 54. 1.100' 

    1 answer 1

    At least two nuances that can be (provide the file "problem") significant:

    • Audio processing is done in a separate stream, while video is in the same. Although the audio data is less, but more critical to their timely non-availability during playback. Take out the video processing to your stream too.
    • I see that you are configuring SDL for the Signed 16bit sample format, while the rest of the data is taken from the codec. Are you sure that after decoding an audio sample you have it S16? And always will be? There are two tips: or more accurately look at the output of the decoder and similarly adjust the SDL, or adjust the resampler (swresample) and bring any input format into clear SDL.

    Look at the ffplay code, it does roughly what you want to do and uses SDL2.

    • Thank you so much! Set up a resampler and voila .... here it is))))) - Andrey_RnD