Skip to content
This repository has been archived by the owner on Jun 11, 2020. It is now read-only.

Audio broken #11

Open
pockethook opened this issue Jun 17, 2013 · 18 comments
Open

Audio broken #11

pockethook opened this issue Jun 17, 2013 · 18 comments

Comments

@pockethook
Copy link

A lot of noise/clicking/garbage can be heard in addition to something that vaguely resembles what should be heard.

I've tried tutorial 3 and 7 but neither play audio correctly. I've tried this on both Windows 7 and Arch Linux with the latest versions of g++/VC++, FFMpeg and SDL to the same avail. FFPlay works fine on both machines.

@pockethook
Copy link
Author

The problem only occurs with non-PCM_S16 audio. MP3/MP2 audio plays back slightly off and at a higher pitch, playing back FLAC produces noise.

@pprahul
Copy link

pprahul commented Aug 16, 2013

I also had same problem playing mpeg1 video and mp2 audio (mpa) in an mp4 container. Is it the problem with the inability of SDL to play audio which is in planar format.

Tried setting the decode format to non-planar using the below code (inserted in stream_component_open) , and seems to be fixed:

...
if (codecCtx->sample_fmt == AV_SAMPLE_FMT_S16P) {
codecCtx->request_sample_fmt = AV_SAMPLE_FMT_S16;
}

..

Does it solve the problem for you too ? @pockethook

@Maniulo
Copy link

Maniulo commented Aug 16, 2013

@pprahul I've been struggling with this issue for several days now too, and your fix did work, thanks!

Also, without the fix, tutorials run fine on FFmpeg 1.0.1 and below.

@illuusio
Copy link

illuusio commented Sep 5, 2013

This one is fixed on https://github.com/illuusio/ffmpeg-tutorial and pull request #17. tutorial03.c ain't fixed but I goes the same.

@tetepoive974
Copy link

Hi,
I have the same issue with a mp4 video in h264 and AAC.Do you know how to fix it?
thanks

@illuusio
Copy link

Audio issues are solved in my repo..

@tetepoive974
Copy link

Yes but Do you try with a mp4 video in h264 and an AAC audio? I try it but the song seem to be very slow.Can you confirm me ?thanks

@illuusio
Copy link

which version of ffmpeg? Can you provide sample of non working..

@tetepoive974
Copy link

it's the version 2.0.1 and with the version 2.5.2 it's the same thing.
Can you try with this video ?
http://we.tl/i1wIOwRwh7
thanks you

@illuusio
Copy link

Ok.. you have pretty high rate video bit crappy audio 👯 . Problem is no working conversion from 22000 to you wanted output. So audio sound little bit chubby. I'll try to fix it but takes awhile.

@tetepoive974
Copy link

Thanks you very much for your help

@tetepoive974
Copy link

Hi,
Do you know what is the process to obtain a good sound with the example I give you?I will try to corrige by myself .
thanks

@mpenkov
Copy link
Owner

mpenkov commented Feb 16, 2015

Try asking on the ffmpeg mailing list.

https://www.ffmpeg.org/contact.html

On Monday, February 16, 2015, tetepoive974 notifications@github.com wrote:

Hi,
Do you know what is the process to obtain a good sound with the example I
give you?I will try to corrige by myself .
thanks

Reply to this email directly or view it on GitHub
#11 (comment)
.

@illuusio
Copy link

I'm currently over burned with work so take alook at http://roxlu.com/2014/039/decoding-h264-and-yuv420p-playback they should lead your way. They are made for AVConv but should work on FFmpeg also and most of the time asking questions like this on FFmpeg mailing list will lead you just be ashamed not be pro.

@mrglobal
Copy link

I pinged Tuukka and with his gracious help, I got this working on QT on Windows 10 and FFMPEG build from https://ffmpeg.zeranoe.com/builds/ latest Aug 1st 2017 build. I use 32 bit, Shared and Dev.

Tut_04_illusio.zip

regards

Sean

@balapradeepswork
Copy link

I tried doing all these fix for non planer output in tutorial 05 but there is no sound at all. However, if I don't do resampling to AV_PIX_FMT_S16 there is some noise.
Can you help me Please.

@illuusio
Copy link

Without seeing code there is not much anyone can do

@MilaCridlig
Copy link

Was able to play a mp4 video with audio whose codecs appear below. Based on http://dranger.com/ffmpeg/ and updates from https://github.com/illuusio/ffmpeg-tutorial, it runs Windows x64, Visual Studio 2015, SDL2, ffmpeg 4.0 and C++.

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ‘crawl.mp4’:
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 1970-01-01T00:00:00.000000Z
Duration: 00:00:29.00, start: 0.000000, bitrate: 689 kb/s
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1344x680, 612 kb/s, 10 fps, 10 tbr, 10 tbn, 20 tbc (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 75 kb/s (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : SoundHandler
screen final size: 1344x680

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants