-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support output mpegts with only audio stream #23
Comments
hi @jalonsoa, yes we can do it. If I'm not being betrayed by my memory, all you need to do is change the oformat on output_format_context: diff --git ngx_http_aac_module.c ngx_http_aac_module.c
index dbff3a7..776de23 100644
--- ngx_http_aac_module.c
+++ ngx_http_aac_module.c
@@ -173,7 +173,7 @@ static int ngx_http_aac_extract_audio(ngx_pool_t *pool, ngx_log_t *log, ngx_str
io_context = avio_alloc_context(exchange_area, buffer_size, 1, (void *)destination, NULL, write_packet, NULL);
output_format_context->pb = io_context;
- output_format_context->oformat = av_guess_format("adts", NULL, NULL);
+ output_format_context->oformat = input_format_context->oformat;
avcodec_copy_context(output_audio_stream->codec, input_audio_stream->codec);
avformat_write_header(output_format_context, NULL);
Don't forget to change the mimetype to |
Hi Flavio ! thanks j On Tue, Jan 13, 2015 at 1:16 AM, Flávio Ribeiro notifications@github.com
|
Hi Flavio ! this is the gdb stack when the nginx crash. #0 0x00007fd2f65f2bbd in avformat_write_header () from I have avformat 53 (and all work fine with aac, but with this patch thanks On Tue, Jan 13, 2015 at 11:00 AM, Justo Alonso justo.alonso@gmail.com
|
And ... one point. In line 143 ... the "goto exit" line should go after the log, right?
|
Sorry,
|
hey @jalonsoa, yeah your patch makes sense. Can you send a pull request? Regarding my patch, I'll try to figure out what's going on, but can you try this approach below first? diff --git ngx_http_aac_module.c ngx_http_aac_module.c
index dbff3a7..fa87a00 100644
--- ngx_http_aac_module.c
+++ ngx_http_aac_module.c
@@ -123,6 +123,8 @@ static int ngx_http_aac_extract_audio(ngx_pool_t *pool, ngx_log_t *log, ngx_str
AVFormatContext *input_format_context = NULL;
AVFormatContext *output_format_context = NULL;
+ AVOutputFormat *fmt;
AVStream *input_audio_stream;
AVStream *output_audio_stream;
AVPacket packet, new_packet;
@@ -173,7 +175,8 @@ static int ngx_http_aac_extract_audio(ngx_pool_t *pool, ngx_log_t *log, ngx_str
io_context = avio_alloc_context(exchange_area, buffer_size, 1, (void *)destination, NULL, write_packet, NULL);
output_format_context->pb = io_context;
- output_format_context->oformat = av_guess_format("adts", NULL, NULL);
+ fmt = av_guess_format("mpegts", NULL, NULL);
+ output_format_context->oformat = fmt;
avcodec_copy_context(output_audio_stream->codec, input_audio_stream->codec);
avformat_write_header(output_format_context, NULL); |
Hi Flavio, thanks |
great, tell me if the last diff works for you 🍻 |
Hi Flavio, For example, if we select mpegts output format, we expect that the fragments in the new m3u8 audio list be ts files ... so you can't remove aac extension and paste ts to build the source path (ngx_http_aac_module.c, build_source_path function - line 209) We have many ways a .- remove the extension in nginx (rewrite), and the module paste the ts extension to get the source what do you think about ? j |
hi @jalonsoa, I think that the best way to deal with it is by searching for the extension and replacing to .ts in order to get the real file (letter b). |
closed by 225babf |
Hi,
android >4.4.3 don't support m3u8 live with aac files. Only support mpegts as fragments on m3u8 playlist.
We can generate an ts file with only the aac stream inside ?
thanks
j
The text was updated successfully, but these errors were encountered: