RTMP issue

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

RTMP issue

william keeling
My question is an issue with a program written to live stream to YouTube working is all modes other than rtmp live stream.
The program writes FLV container (H.264 and AAC streams) to FFMPEG standard URL.  The IO context is opened with “avio_open(&io_ctx, url, AVIO_FLAG_WRITE);”.  When written to file: it plays in VLC media player, the file is uploadable to YouTube and FLVCheck tool shows the file conforms to the FLV specification.  But when the URL is rtmp: the stream to YouTube shows connected but never plays live and after if finishes the stream is never processed by YouTube.  When the stream is piped (pipe:1 URL) thru FFMPEG (demuxed and muxed only -- ffmpeg -i - -vcodec copy -acodec copy -f flv rtmp:<URL>) the live stream works without issues.
So, I need to understand what FFMPEG command line is doing with rtmp: URL that I am not doing with the FFMPEG API.
My source code is at github.com/wkeeling63/rcam.  Any ideas you have I would love to hear as I am stumped.

Thanks
William

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: RTMP issue

Moritz Barsnick
Hi William

On Mon, Aug 24, 2020 at 00:40:04 +0000, william keeling wrote:

> My question is an issue with a program written to live stream to
> YouTube working is all modes other than rtmp live stream.

For programming with the ffmpeg libav* libraries, you should usually
turn to the libav-user mailing list, But perhaps we can help.

> finishes the stream is never processed by YouTube. When the stream is
> piped (pipe:1 URL) thru FFMPEG (demuxed and muxed only -- ffmpeg -i -
> -vcodec copy -acodec copy -f flv rtmp:<URL>) the live stream works
> without issues.

At least that means that your content encoding, bit rate, number of
audio channels, and so on, are correct for YouTube. It's just the
muxing, or perhaps something like a flag or metadata.

> So, I need to understand what FFMPEG command line is doing with rtmp: URL that I am not doing with the FFMPEG API.
> My source code is at github.com/wkeeling63/rcam. Any ideas you have I
> would love to hear as I am stumped.

Too bad ths only compiles on Raspberry Pi, so there's no way to
reproduce your muxing issue.

Since you didn't provide a log callback using av_log_set_callback(),
shouldn't your application show all the usual ffmpeg/libav* log output
on stdout? Can you provide us with that ouptut? Raise the log level
with e.g. av_log_set_level(AV_LOG_VERBOSE), if required.

Thanks,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: RTMP issue

william keeling
I added the AV_LOG_VERBOSE and got the following output:

pi@pi2cam:/userland/build/bin $ ./rcam -D dmic_sv -d 5  -q 30 -w 1920 -h 1080 rtmp://a.rtmp.youtube.com/live2/<KEY>
[tcp @ 0x18acb70] Starting connection attempt to 2607:f8b0:401a:7::8 port 1935
[tcp @ 0x18acb70] Successfully connected to 2607:f8b0:401a:7::8 port 1935

[aac @ 0x18ba620] Qavg: 118.451
[AVIOContext @ 0x18aefd0] Statistics: 0 seeks, 341 writeouts


If you can point me to an example of logging callback I will try and add it if you think it will yield more useful information.

Thanks in advance for your ideas and help,
William

________________________________
From: ffmpeg-user <[hidden email]> on behalf of Moritz Barsnick <[hidden email]>
Sent: Monday, August 24, 2020 9:25 AM
To: FFmpeg user discussions <[hidden email]>
Subject: Re: [FFmpeg-user] RTMP issue

Hi William

On Mon, Aug 24, 2020 at 00:40:04 +0000, william keeling wrote:

> My question is an issue with a program written to live stream to
> YouTube working is all modes other than rtmp live stream.

For programming with the ffmpeg libav* libraries, you should usually
turn to the libav-user mailing list, But perhaps we can help.

> finishes the stream is never processed by YouTube. When the stream is
> piped (pipe:1 URL) thru FFMPEG (demuxed and muxed only -- ffmpeg -i -
> -vcodec copy -acodec copy -f flv rtmp:<URL>) the live stream works
> without issues.

At least that means that your content encoding, bit rate, number of
audio channels, and so on, are correct for YouTube. It's just the
muxing, or perhaps something like a flag or metadata.

> So, I need to understand what FFMPEG command line is doing with rtmp: URL that I am not doing with the FFMPEG API.
> My source code is at github.com/wkeeling63/rcam. Any ideas you have I
> would love to hear as I am stumped.

Too bad ths only compiles on Raspberry Pi, so there's no way to
reproduce your muxing issue.

Since you didn't provide a log callback using av_log_set_callback(),
shouldn't your application show all the usual ffmpeg/libav* log output
on stdout? Can you provide us with that ouptut? Raise the log level
with e.g. av_log_set_level(AV_LOG_VERBOSE), if required.

Thanks,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: RTMP issue

Chris Miceli
Hi William,

I'm by no means an expert on the matter but I tried having a look for you.
At least one issue would be that you are not calling
avformat_network_init() which
is a requirement for any protocol which needs network [1]

I would have tested and tried this for you, however I do not have the
hardware laying around.

I wish you the best of luck and let me know how it goes.

[1] - libavformat/libavformat.h lines 40-41

*Chris Miceli*

On Mon, Aug 24, 2020 at 10:17 AM william keeling <[hidden email]>
wrote:

> I added the AV_LOG_VERBOSE and got the following output:
>
> pi@pi2cam:/userland/build/bin $ ./rcam -D dmic_sv -d 5  -q 30 -w 1920 -h
> 1080 rtmp://a.rtmp.youtube.com/live2/<KEY>
> [tcp @ 0x18acb70] Starting connection attempt to 2607:f8b0:401a:7::8 port
> 1935
> [tcp @ 0x18acb70] Successfully connected to 2607:f8b0:401a:7::8 port 1935
>
> [aac @ 0x18ba620] Qavg: 118.451
> [AVIOContext @ 0x18aefd0] Statistics: 0 seeks, 341 writeouts
>
>
> If you can point me to an example of logging callback I will try and add
> it if you think it will yield more useful information.
>
> Thanks in advance for your ideas and help,
> William
>
> ________________________________
> From: ffmpeg-user <[hidden email]> on behalf of Moritz
> Barsnick <[hidden email]>
> Sent: Monday, August 24, 2020 9:25 AM
> To: FFmpeg user discussions <[hidden email]>
> Subject: Re: [FFmpeg-user] RTMP issue
>
> Hi William
>
> On Mon, Aug 24, 2020 at 00:40:04 +0000, william keeling wrote:
>
> > My question is an issue with a program written to live stream to
> > YouTube working is all modes other than rtmp live stream.
>
> For programming with the ffmpeg libav* libraries, you should usually
> turn to the libav-user mailing list, But perhaps we can help.
>
> > finishes the stream is never processed by YouTube. When the stream is
> > piped (pipe:1 URL) thru FFMPEG (demuxed and muxed only -- ffmpeg -i -
> > -vcodec copy -acodec copy -f flv rtmp:<URL>) the live stream works
> > without issues.
>
> At least that means that your content encoding, bit rate, number of
> audio channels, and so on, are correct for YouTube. It's just the
> muxing, or perhaps something like a flag or metadata.
>
> > So, I need to understand what FFMPEG command line is doing with rtmp:
> URL that I am not doing with the FFMPEG API.
> > My source code is at github.com/wkeeling63/rcam. Any ideas you have I
> > would love to hear as I am stumped.
>
> Too bad ths only compiles on Raspberry Pi, so there's no way to
> reproduce your muxing issue.
>
> Since you didn't provide a log callback using av_log_set_callback(),
> shouldn't your application show all the usual ffmpeg/libav* log output
> on stdout? Can you provide us with that ouptut? Raise the log level
> with e.g. av_log_set_level(AV_LOG_VERBOSE), if required.
>
> Thanks,
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".