Skip to content
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

Attempt to use RTMP instead of HLS #54

Open
kientux opened this issue Feb 1, 2016 · 0 comments
Open

Attempt to use RTMP instead of HLS #54

kientux opened this issue Feb 1, 2016 · 0 comments

Comments

@kientux
Copy link

kientux commented Feb 1, 2016

I'm trying to replace hls with rtmp in the sdk. Just to test, I change outputPath in setupOutputPath function in KFHLSWriter to my rtmp end point, change output format to flv and add bitstream filter aac_adtsoasc:

- (void) setupOutputFile {
//    NSString *outputPath = [_directoryPath stringByAppendingPathComponent:@"index.m3u8"];
    NSString *outputPath = @"rtmp://<rtmp-endpoint>/live/test";

    _outputFile = [[FFOutputFile alloc] initWithPath:outputPath options:@{kFFmpegOutputFormatKey: @"flv"}];

    FFBitstreamFilter *bitstreamFilter = [[FFBitstreamFilter alloc] initWithFilterName:@"h264_mp4toannexb"];
    FFBitstreamFilter *bitstreamFilterAAC = [[FFBitstreamFilter alloc] initWithFilterName:@"aac_adtstoasc"];
    [_outputFile addBitstreamFilter:bitstreamFilter];
    [_outputFile addBitstreamFilterAudio:bitstreamFilterAAC];
}

(I added addBitstreamFilterAudio: function in FFmpegWrapper so the filter aac_adtstoasc will be added only if codec_id is AV_CODEC_ID_AAC).

That's all I can do for now, the app can run without problem. But if I check the output file with ffmpeg:

ffmpeg -i test.flv

then here's the output:

[flv @ 0x7fe764001000] Could not find codec parameters for stream 1 (Audio: none, 0 channels): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, flv, from 'test.flv':
  Duration: 00:00:14.38, start: 0.402000, bitrate: 1640 kb/s
    Stream #0:0: Video: h264 (Baseline), yuv420p(tv, smpte170m/bt709/bt709), 854x480, 29.97 tbr, 1k tbn, 2k tbc
    Stream #0:1: Audio: none, 0 channels

There's something wrong when encoding audio stream. Any ideas how to fix this?

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

No branches or pull requests

1 participant