Add soft subtitles to YouTube Stream Now?

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Add soft subtitles to YouTube Stream Now?

Steven Kan
First time poster, so please be kind if I ask anything stupid!

I have a live BeeCam feed on YouTube:

https://www.youtube.com/channel/UCE0jx2Z6qbc5Co8x8Kyisag/live <https://www.youtube.com/channel/UCE0jx2Z6qbc5Co8x8Kyisag/live>

using YouTube’s “Stream Now” feature, which is distinct from a streaming “event” because I don’t have to schedule it. Whenever I’m pushing video to YouTube, the channel goes live.

The stream is supplied by a Raspberry Pi running as an ffmpeg “relay server,” e.g. it’s not doing any transcoding; it’s just repacking an RTSP stream from an off-the-shelf camera:

./ffmpeg -re -thread_queue_size 512 -rtsp_transport tcp -i "rtsp://anonymous:password@192.168.1.11:554" -f concat -safe 0 -i playlist.txt -vcodec copy -acodec copy -t 01:47:02 -f flv "rtmp://a.rtmp.youtube.com/live2/my-youtube-streaming-key”

The -t and playlist.txt are because my camera lacks and audio feed, and YT requires an audio stream, so I have a collection of royalty-free mp3s in the playlist, and I’m wrapping this command in a loop.

When I run this on my RPi 2, CPU utilization for ffmpeg is <<<<10%, which is what I want, because I will have up to 3 instances of ffmpeg pushing 3 camera streams to 3 YT channels during honey bee swarm season in Spring.

What I want to do is add some captions to the video as soft subtitles, e.g. my location, the present temperature, and the weather forecast. I don’t have enough CPU on the Pi to burn these into the video stream.

Is this possible in ffmpeg and with YouTube’s “stream now” feature?

I can get ffmpeg to put a soft subtitle into a local .mkv file:

./ffmpeg -i video.mp4" -i SubtitleTest.srt -acodec copy -scodec copy out.mkv

but I changing the output to .m4v, mp4, or .flv results in errors such as:

Subtitle codec 'ass' for stream 2 is not compatible with FLV

and pushing mkv to YouTube via:

./ffmpeg -i video.mp4" -acodec copy -f mkv "rtmp://a.rtmp.youtube.com/live2/my-youtube-streaming-key”

returns:

Requested output format 'mkv' is not a suitable output format
rtmp://a.rtmp.youtube.com/live2/my-youtube-streaming-key <rtmp://a.rtmp.youtube.com/live2/my-youtube-streaming-key>

Am I doing this fundamentally wrong? Or is this just not possible? If it’s possible I will continue reading documentation until I get it working!!!

Thanks!

_______________________________________________
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: Add soft subtitles to YouTube Stream Now?

Moritz Barsnick
On Tue, Nov 19, 2019 at 22:45:44 -0600, Steven Kan wrote:
> First time poster, so please be kind if I ask anything stupid!

Not at all!

> I have a live BeeCam feed on YouTube:
> https://www.youtube.com/channel/UCE0jx2Z6qbc5Co8x8Kyisag/live <https://www.youtube.com/channel/UCE0jx2Z6qbc5Co8x8Kyisag/live>

Cure mice, if I may say so. (You're actually trying to show bees,
right? I caught a glimpse of a mouse though.)

> The -t and playlist.txt are because my camera lacks and audio feed,
> and YT requires an audio stream, so I have a collection of
> royalty-free mp3s in the playlist, and I’m wrapping this command in a
> loop.

In my experience, you can also provide an empty audio stream. It only
needs to be of a certain rate, and stereo, IIRC. But your solution
seems fine.

> What I want to do is add some captions to the video as soft
> subtitles, e.g. my location, the present temperature, and the weather
> forecast. I don’t have enough CPU on the Pi to burn these into the
> video stream.
>
> Is this possible in ffmpeg and with YouTube’s “stream now” feature?

Check this page:
https://support.google.com/youtube/answer/3068031?hl=en

YouTube currently only accepts FLV streams, and subtitles only as EIA
608/708 captions. As far as I can tell, ffmpeg is currently not capable
of creating or embedding these captions.

There's an enhancement request for muxing support:
https://trac.ffmpeg.org/ticket/1778#comment:10

> Subtitle codec 'ass' for stream 2 is not compatible with FLV

ffmpeg's FLV muxer only accepts "id_text" ("Raw text subtitle") subs,
whatever that is.

I see some indications that Open Broadcast Encoder can create 608
captions, but I haven't found more info.

Hope this helps,
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: Add soft subtitles to YouTube Stream Now?

Steven Kan
> On Nov 20, 2019, at 7:11 AM, Moritz Barsnick <[hidden email]> wrote:
>
> On Tue, Nov 19, 2019 at 22:45:44 -0600, Steven Kan wrote:
>> What I want to do is add some captions to the video as soft
>> subtitles, e.g. my location, the present temperature, and the weather
>> forecast. I don’t have enough CPU on the Pi to burn these into the
>> video stream.
>>
>> Is this possible in ffmpeg and with YouTube’s “stream now” feature?
>
> Check this page:
> https://support.google.com/youtube/answer/3068031?hl=en
>
> YouTube currently only accepts FLV streams, and subtitles only as EIA
> 608/708 captions. As far as I can tell, ffmpeg is currently not capable
> of creating or embedding these captions.
>
> There's an enhancement request for muxing support:
> https://trac.ffmpeg.org/ticket/1778#comment:10 <https://trac.ffmpeg.org/ticket/1778#comment:10>

If I’m demuxing your answer correctly, the answer is “no,” at least of now. Thank for your reply; at least now I won’t spend hours trying to find a solution that doesn’t exist! That enhancement request has had no updates for 2 years :-(

EIA 608/708 caption generation appears to be non-trivial!

https://en.wikipedia.org/wiki/CEA-708 <https://en.wikipedia.org/wiki/CEA-708>

I did find this libcaption project:

https://github.com/szatmary/libcaption <https://github.com/szatmary/libcaption>

and this page saying that the captions can be pushed via RTMP:

https://ghuntley.com/notes/closed-captioning/ <https://ghuntley.com/notes/closed-captioning/>

I know this is somewhat OT for ffmpeg, but can I push two RTMP streams to YouTube, one for the a/v, and one for the captions?

Back on-topic, given that libcaption exists, how difficult a task would it be to integrate support into ffmpeg? Is it just a matter of re-muxing the output from libcaption into the ffmpeg output stream? I’m not programmer, unfortunately, but I’m just trying to get a sense for the scope of the problem.

Thanks!
_______________________________________________
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: Add soft subtitles to YouTube Stream Now?

Moritz Barsnick
On Wed, Nov 20, 2019 at 08:43:00 -0600, Steven Kan wrote:
> > https://trac.ffmpeg.org/ticket/1778#comment:10 <https://trac.ffmpeg.org/ticket/1778#comment:10>
>

> If I’m demuxing your answer correctly, the answer is “no,” at least
> of now. Thank for your reply; at least now I won’t spend hours trying
> to find a solution that doesn’t exist! That enhancement request has
> had no updates for 2 years :-(

Indeed, that's the conclusion. :-/

> I did find this libcaption project:
> https://github.com/szatmary/libcaption <https://github.com/szatmary/libcaption>

I had found that as well before I answered. I looked into it again, and
saw the nice examples:

https://github.com/szatmary/libcaption/tree/develop/examples

The add_captions scripts shows how to use the example binaries:
https://github.com/szatmary/libcaption/blob/develop/examples/add_captions
as such:

$ ffmpeg -i $VIDEO -codec copy -f flv - | flv+srt - $SRT - | ffmpeg -i - -codec copy -y $OUTFILE

flv+srt even supports dynamic subtitles:

    flv+srt is capable of reading an srt from a named pipe for the use
    in live captioning. The input must still be formatted as an srt. If
    a null character is received on the pipe The internal srt buffer is
    cleared. In this case the first srt timestamps after the null is
    assumed to be immediate, and captions begins with this text on the
    next frame.

Nifty, huh?

> and this page saying that the captions can be pushed via RTMP:
> https://ghuntley.com/notes/closed-captioning/ <https://ghuntley.com/notes/closed-captioning/>
> I know this is somewhat OT for ffmpeg, but can I push two RTMP streams to YouTube, one for the a/v, and one for the captions?

As far as I understand YouTube's docs, these methods are not supported.

> Back on-topic, given that libcaption exists, how difficult a task
> would it be to integrate support into ffmpeg? Is it just a matter of
> re-muxing the output from libcaption into the ffmpeg output stream?
> I’m not programmer, unfortunately, but I’m just trying to get a sense
> for the scope of the problem.

It has an MIT license, so its code  - or just the relevant parts, as
some of the code deals with demuxing/muxing (and with filtering
streams?) - could even be integrated into ffmpeg.

Cheers,
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: Add soft subtitles to YouTube Stream Now?

Moritz Barsnick
On Wed, Nov 20, 2019 at 16:05:12 +0100, Moritz Barsnick wrote:
> > and this page saying that the captions can be pushed via RTMP:
> > https://ghuntley.com/notes/closed-captioning/ <https://ghuntley.com/notes/closed-captioning/>
> > I know this is somewhat OT for ffmpeg, but can I push two RTMP streams to YouTube, one for the a/v, and one for the captions?
>
> As far as I understand YouTube's docs, these methods are not supported.

Sorry, I missed this. I noticed this option when fiddling with my
YouTube livestream. I don't know how to create this HTTP caption stream
though, I couldn't find documentation.

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: Add soft subtitles to YouTube Stream Now?

Michael Shaffer
In reply to this post by Steven Kan
I noticed your Youtube streams only last a day or so. I have a Python
script I made that keeps the ffmpeg process sending to Youtube. I have 5 IP
cameras going to youtube and they have been going about 9 months without
the stream ending. Anyways, if you want I could show you how the script
works. You would just have to change the stream keys and the bitrate that
each camera uses, so it knows when to restart the stream.

Michael

On Wed, Nov 20, 2019 at 12:17 AM Steven Kan <[hidden email]> wrote:

> First time poster, so please be kind if I ask anything stupid!
>
> I have a live BeeCam feed on YouTube:
>
> https://www.youtube.com/channel/UCE0jx2Z6qbc5Co8x8Kyisag/live <
> https://www.youtube.com/channel/UCE0jx2Z6qbc5Co8x8Kyisag/live>
>
> using YouTube’s “Stream Now” feature, which is distinct from a streaming
> “event” because I don’t have to schedule it. Whenever I’m pushing video to
> YouTube, the channel goes live.
>
> The stream is supplied by a Raspberry Pi running as an ffmpeg “relay
> server,” e.g. it’s not doing any transcoding; it’s just repacking an RTSP
> stream from an off-the-shelf camera:
>
> ./ffmpeg -re -thread_queue_size 512 -rtsp_transport tcp -i "rtsp://
> anonymous:password@192.168.1.11:554" -f concat -safe 0 -i playlist.txt
> -vcodec copy -acodec copy -t 01:47:02 -f flv "rtmp://
> a.rtmp.youtube.com/live2/my-youtube-streaming-key”
>
> The -t and playlist.txt are because my camera lacks and audio feed, and YT
> requires an audio stream, so I have a collection of royalty-free mp3s in
> the playlist, and I’m wrapping this command in a loop.
>
> When I run this on my RPi 2, CPU utilization for ffmpeg is <<<<10%, which
> is what I want, because I will have up to 3 instances of ffmpeg pushing 3
> camera streams to 3 YT channels during honey bee swarm season in Spring.
>
> What I want to do is add some captions to the video as soft subtitles,
> e.g. my location, the present temperature, and the weather forecast. I
> don’t have enough CPU on the Pi to burn these into the video stream.
>
> Is this possible in ffmpeg and with YouTube’s “stream now” feature?
>
> I can get ffmpeg to put a soft subtitle into a local .mkv file:
>
> ./ffmpeg -i video.mp4" -i SubtitleTest.srt -acodec copy -scodec copy
> out.mkv
>
> but I changing the output to .m4v, mp4, or .flv results in errors such as:
>
> Subtitle codec 'ass' for stream 2 is not compatible with FLV
>
> and pushing mkv to YouTube via:
>
> ./ffmpeg -i video.mp4" -acodec copy -f mkv "rtmp://
> a.rtmp.youtube.com/live2/my-youtube-streaming-key”
>
> returns:
>
> Requested output format 'mkv' is not a suitable output format
> rtmp://a.rtmp.youtube.com/live2/my-youtube-streaming-key <rtmp://
> a.rtmp.youtube.com/live2/my-youtube-streaming-key>
>
> Am I doing this fundamentally wrong? Or is this just not possible? If it’s
> possible I will continue reading documentation until I get it working!!!
>
> Thanks!
>
> _______________________________________________
> 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: Add soft subtitles to YouTube Stream Now?

Verachten Bruno
That's a very interesting subject (to me at least).
I would like to embed automatic (or human generated, depending on the
budget) subtitles to help hearing-impaired people grab most of the
talk in our conference.
I am producing H.264 and sending it (for the time being) to YouTube,
so your request is not far from my needs.
I will follow this subject with great attention.
Thanks.

On Wed, Nov 20, 2019 at 5:20 PM Michael Shaffer <[hidden email]> wrote:

>
> I noticed your Youtube streams only last a day or so. I have a Python
> script I made that keeps the ffmpeg process sending to Youtube. I have 5 IP
> cameras going to youtube and they have been going about 9 months without
> the stream ending. Anyways, if you want I could show you how the script
> works. You would just have to change the stream keys and the bitrate that
> each camera uses, so it knows when to restart the stream.
>
> Michael
>
> On Wed, Nov 20, 2019 at 12:17 AM Steven Kan <[hidden email]> wrote:
>
> > First time poster, so please be kind if I ask anything stupid!
> >
> > I have a live BeeCam feed on YouTube:
> >
> > https://www.youtube.com/channel/UCE0jx2Z6qbc5Co8x8Kyisag/live <
> > https://www.youtube.com/channel/UCE0jx2Z6qbc5Co8x8Kyisag/live>
> >
> > using YouTube’s “Stream Now” feature, which is distinct from a streaming
> > “event” because I don’t have to schedule it. Whenever I’m pushing video to
> > YouTube, the channel goes live.
> >
> > The stream is supplied by a Raspberry Pi running as an ffmpeg “relay
> > server,” e.g. it’s not doing any transcoding; it’s just repacking an RTSP
> > stream from an off-the-shelf camera:
> >
> > ./ffmpeg -re -thread_queue_size 512 -rtsp_transport tcp -i "rtsp://
> > anonymous:password@192.168.1.11:554" -f concat -safe 0 -i playlist.txt
> > -vcodec copy -acodec copy -t 01:47:02 -f flv "rtmp://
> > a.rtmp.youtube.com/live2/my-youtube-streaming-key”
> >
> > The -t and playlist.txt are because my camera lacks and audio feed, and YT
> > requires an audio stream, so I have a collection of royalty-free mp3s in
> > the playlist, and I’m wrapping this command in a loop.
> >
> > When I run this on my RPi 2, CPU utilization for ffmpeg is <<<<10%, which
> > is what I want, because I will have up to 3 instances of ffmpeg pushing 3
> > camera streams to 3 YT channels during honey bee swarm season in Spring.
> >
> > What I want to do is add some captions to the video as soft subtitles,
> > e.g. my location, the present temperature, and the weather forecast. I
> > don’t have enough CPU on the Pi to burn these into the video stream.
> >
> > Is this possible in ffmpeg and with YouTube’s “stream now” feature?
> >
> > I can get ffmpeg to put a soft subtitle into a local .mkv file:
> >
> > ./ffmpeg -i video.mp4" -i SubtitleTest.srt -acodec copy -scodec copy
> > out.mkv
> >
> > but I changing the output to .m4v, mp4, or .flv results in errors such as:
> >
> > Subtitle codec 'ass' for stream 2 is not compatible with FLV
> >
> > and pushing mkv to YouTube via:
> >
> > ./ffmpeg -i video.mp4" -acodec copy -f mkv "rtmp://
> > a.rtmp.youtube.com/live2/my-youtube-streaming-key”
> >
> > returns:
> >
> > Requested output format 'mkv' is not a suitable output format
> > rtmp://a.rtmp.youtube.com/live2/my-youtube-streaming-key <rtmp://
> > a.rtmp.youtube.com/live2/my-youtube-streaming-key>
> >
> > Am I doing this fundamentally wrong? Or is this just not possible? If it’s
> > possible I will continue reading documentation until I get it working!!!
> >
> > Thanks!
> >
> > _______________________________________________
> > 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".



--
Bruno Verachten
_______________________________________________
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: Add soft subtitles to YouTube Stream Now?

Steven Kan
In reply to this post by Michael Shaffer
Hi Michael,

Thanks! I actually have a cron job to stop, pause, and restart the streams every 12 hours, because otherwise the YT archived videos sometimes fail to upload.

Somewhere in my processing chain something usually craps out every few days, but even then I would sometimes have streams that would go on for 3-4 days, and those would stuck in “Processing. . . “ forever, and never be available to watch afterward. This is critical for me, because one of my primary motivations for having this/these streams is to capture when a swarm moves into my swarm trap. By observing scouting behavior in early Spring I can usually tell that I’m within 3-4 days of a swarm moving in, but there’s no predicting exactly when. So I need to ensure that all of my archives get saved successully, like this one:

https://www.youtube.com/watch?v=OtjpylAEP8I&feature=youtu.be&t=1800 <https://www.youtube.com/watch?v=OtjpylAEP8I&feature=youtu.be&t=1800>

(that was post-processed to make a 2-up, but each half was taken by a camera, pushed to YT by ffmpeg)

So I actually have a watchdog timer running for each of my streams, plus the cron job to interrupt everything, twice a day.

But thanks for the offer!

> On Nov 20, 2019, at 10:11 AM, Michael Shaffer <[hidden email]> wrote:
>
> I noticed your Youtube streams only last a day or so. I have a Python
> script I made that keeps the ffmpeg process sending to Youtube. I have 5 IP
> cameras going to youtube and they have been going about 9 months without
> the stream ending. Anyways, if you want I could show you how the script
> works. You would just have to change the stream keys and the bitrate that
> each camera uses, so it knows when to restart the stream.
>
> Michael
>
> On Wed, Nov 20, 2019 at 12:17 AM Steven Kan <[hidden email]> wrote:
>
>> First time poster, so please be kind if I ask anything stupid!
>>
>> I have a live BeeCam feed on YouTube:
>>
>> https://www.youtube.com/channel/UCE0jx2Z6qbc5Co8x8Kyisag/live <
>> https://www.youtube.com/channel/UCE0jx2Z6qbc5Co8x8Kyisag/live>
>>
>> using YouTube’s “Stream Now” feature, which is distinct from a streaming
>> “event” because I don’t have to schedule it. Whenever I’m pushing video to
>> YouTube, the channel goes live.
>>
>> The stream is supplied by a Raspberry Pi running as an ffmpeg “relay
>> server,” e.g. it’s not doing any transcoding; it’s just repacking an RTSP
>> stream from an off-the-shelf camera:
>>
>> ./ffmpeg -re -thread_queue_size 512 -rtsp_transport tcp -i "rtsp://
>> anonymous:password@192.168.1.11:554" -f concat -safe 0 -i playlist.txt
>> -vcodec copy -acodec copy -t 01:47:02 -f flv "rtmp://
>> a.rtmp.youtube.com/live2/my-youtube-streaming-key”
>>
>> The -t and playlist.txt are because my camera lacks and audio feed, and YT
>> requires an audio stream, so I have a collection of royalty-free mp3s in
>> the playlist, and I’m wrapping this command in a loop.
>>
>> When I run this on my RPi 2, CPU utilization for ffmpeg is <<<<10%, which
>> is what I want, because I will have up to 3 instances of ffmpeg pushing 3
>> camera streams to 3 YT channels during honey bee swarm season in Spring.
>>
>> What I want to do is add some captions to the video as soft subtitles,
>> e.g. my location, the present temperature, and the weather forecast. I
>> don’t have enough CPU on the Pi to burn these into the video stream.
>>
>> Is this possible in ffmpeg and with YouTube’s “stream now” feature?
>>
>> I can get ffmpeg to put a soft subtitle into a local .mkv file:
>>
>> ./ffmpeg -i video.mp4" -i SubtitleTest.srt -acodec copy -scodec copy
>> out.mkv
>>
>> but I changing the output to .m4v, mp4, or .flv results in errors such as:
>>
>> Subtitle codec 'ass' for stream 2 is not compatible with FLV
>>
>> and pushing mkv to YouTube via:
>>
>> ./ffmpeg -i video.mp4" -acodec copy -f mkv "rtmp://
>> a.rtmp.youtube.com/live2/my-youtube-streaming-key”
>>
>> returns:
>>
>> Requested output format 'mkv' is not a suitable output format
>> rtmp://a.rtmp.youtube.com/live2/my-youtube-streaming-key <rtmp://
>> a.rtmp.youtube.com/live2/my-youtube-streaming-key>
>>
>> Am I doing this fundamentally wrong? Or is this just not possible? If it’s
>> possible I will continue reading documentation until I get it working!!!
>>
>> Thanks!
>>
>> _______________________________________________
>> 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".
Reply | Threaded
Open this post in threaded view
|

Re: Add soft subtitles to YouTube Mouse Stream?

Steven Kan
In reply to this post by Moritz Barsnick
Danke für deine Hilfe!

Yes, I have mice in my yard :-(

They can actually invade a weak hive and wreak havoc! Do you remember approximately when you saw it? YT automatically archives the footage twice a day, so I’d like to review it and see the mouse!

Thank again!

> On Nov 20, 2019, at 7:11 AM, Moritz Barsnick <[hidden email] <mailto:[hidden email]>> wrote:
>
> On Tue, Nov 19, 2019 at 22:45:44 -0600, Steven Kan wrote:
>> I have a live BeeCam feed on YouTube:
>> https://www.youtube.com/channel/UCE0jx2Z6qbc5Co8x8Kyisag/live <https://www.youtube.com/channel/UCE0jx2Z6qbc5Co8x8Kyisag/live> <https://www.youtube.com/channel/UCE0jx2Z6qbc5Co8x8Kyisag/live <https://www.youtube.com/channel/UCE0jx2Z6qbc5Co8x8Kyisag/live>>
>
> Cure mice, if I may say so. (You're actually trying to show bees,
> right? I caught a glimpse of a mouse though.)

_______________________________________________
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: Add soft subtitles to YouTube Stream Now?

Steven Kan
In reply to this post by Verachten Bruno
The good news is that all the required pieces appear to exist; the bad news is that no one has yet (to my knowledge) glued them together to make a functional solution. Here’s someone who has gotten very close:

https://github.com/szatmary/libcaption/issues/55#issuecomment-525688953

"I would like to share some of my findings regarding the 'broken' output from flv+srt when you use pipe eg '-' instead of file.

As a TS my goal is also to inject CC in the livestream. I only use Gstreamer instead of ffmpeg.
I was able to generate input data with gstreamer(h264 video wraped in flv) pass it to flv+srt and save to a file successfully.
gst-launch-1.0 videotestsrc ! ...etc ... ! flvmux ! fdsink | flv+srt - mysrtfile.srt output_with_cc.flv

The problem was when I was trying to pass output from flv+srt further to the next process (ffmpeg or gstreamer) for re-sending the result data to streaming server. I was able to capture this (broken) output to a file and compare it with working output created by flv+srt eg 'output_with_cc.flv' and there where a bunch of added lines with 'Matches: 2 Start pts: 4.271000' etc.
Those are produced by vtt.c (line 164 and 168) uncommenting this lines has helped to resolve this issue for now.

I assume this lines should not be printed when using pipe and it's bug."



> On Nov 20, 2019, at 2:16 PM, Verachten Bruno <[hidden email]> wrote:
>
> That's a very interesting subject (to me at least).
> I would like to embed automatic (or human generated, depending on the
> budget) subtitles to help hearing-impaired people grab most of the
> talk in our conference.
> I am producing H.264 and sending it (for the time being) to YouTube,
> so your request is not far from my needs.
> I will follow this subject with great attention.
> Thanks.
>
> On Wed, Nov 20, 2019 at 5:20 PM Michael Shaffer <[hidden email]> wrote:
>>
>> I noticed your Youtube streams only last a day or so. I have a Python
>> script I made that keeps the ffmpeg process sending to Youtube. I have 5 IP
>> cameras going to youtube and they have been going about 9 months without
>> the stream ending. Anyways, if you want I could show you how the script
>> works. You would just have to change the stream keys and the bitrate that
>> each camera uses, so it knows when to restart the stream.
>>
>> Michael
>>
>> On Wed, Nov 20, 2019 at 12:17 AM Steven Kan <[hidden email]> wrote:
>>
>>> First time poster, so please be kind if I ask anything stupid!
>>>
>>> I have a live BeeCam feed on YouTube:
>>>
>>> https://www.youtube.com/channel/UCE0jx2Z6qbc5Co8x8Kyisag/live <
>>> https://www.youtube.com/channel/UCE0jx2Z6qbc5Co8x8Kyisag/live>
>>>
>>> using YouTube’s “Stream Now” feature, which is distinct from a streaming
>>> “event” because I don’t have to schedule it. Whenever I’m pushing video to
>>> YouTube, the channel goes live.
>>>
>>> The stream is supplied by a Raspberry Pi running as an ffmpeg “relay
>>> server,” e.g. it’s not doing any transcoding; it’s just repacking an RTSP
>>> stream from an off-the-shelf camera:
>>>
>>> ./ffmpeg -re -thread_queue_size 512 -rtsp_transport tcp -i "rtsp://
>>> anonymous:password@192.168.1.11:554" -f concat -safe 0 -i playlist.txt
>>> -vcodec copy -acodec copy -t 01:47:02 -f flv "rtmp://
>>> a.rtmp.youtube.com/live2/my-youtube-streaming-key”
>>>
>>> The -t and playlist.txt are because my camera lacks and audio feed, and YT
>>> requires an audio stream, so I have a collection of royalty-free mp3s in
>>> the playlist, and I’m wrapping this command in a loop.
>>>
>>> When I run this on my RPi 2, CPU utilization for ffmpeg is <<<<10%, which
>>> is what I want, because I will have up to 3 instances of ffmpeg pushing 3
>>> camera streams to 3 YT channels during honey bee swarm season in Spring.
>>>
>>> What I want to do is add some captions to the video as soft subtitles,
>>> e.g. my location, the present temperature, and the weather forecast. I
>>> don’t have enough CPU on the Pi to burn these into the video stream.
>>>
>>> Is this possible in ffmpeg and with YouTube’s “stream now” feature?
>>>
>>> I can get ffmpeg to put a soft subtitle into a local .mkv file:
>>>
>>> ./ffmpeg -i video.mp4" -i SubtitleTest.srt -acodec copy -scodec copy
>>> out.mkv
>>>
>>> but I changing the output to .m4v, mp4, or .flv results in errors such as:
>>>
>>> Subtitle codec 'ass' for stream 2 is not compatible with FLV
>>>
>>> and pushing mkv to YouTube via:
>>>
>>> ./ffmpeg -i video.mp4" -acodec copy -f mkv "rtmp://
>>> a.rtmp.youtube.com/live2/my-youtube-streaming-key”
>>>
>>> returns:
>>>
>>> Requested output format 'mkv' is not a suitable output format
>>> rtmp://a.rtmp.youtube.com/live2/my-youtube-streaming-key <rtmp://
>>> a.rtmp.youtube.com/live2/my-youtube-streaming-key>
>>>
>>> Am I doing this fundamentally wrong? Or is this just not possible? If it’s
>>> possible I will continue reading documentation until I get it working!!!
>>>
>>> Thanks!
>>>
>>> _______________________________________________
>>> 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".
>
>
>
> --
> Bruno Verachten
> _______________________________________________
> 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: Add soft subtitles to YouTube Mouse Stream?

Moritz Barsnick
In reply to this post by Steven Kan
On Wed, Nov 20, 2019 at 14:30:27 -0600, Steven Kan wrote:
> Danke für deine Hilfe!

Gerne!

> Yes, I have mice in my yard :-(
>
> They can actually invade a weak hive and wreak havoc! Do you remember
> approximately when you saw it? YT automatically archives the footage
> twice a day, so I’d like to review it and see the mouse!

I wasn't aware of that. Basically, about five minutes before I wrote my
email, so around 14:05h CET. Have you considered downloading the
archived YouTube stream and doing motion detection on it?

Actually, I found it:
https://youtu.be/gh7bUtECd0Y?t=29118

Viel Glück mit den Biestern,
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: Add soft subtitles to YouTube Mouse Stream?

Steven Kan
Thank you for finding that! And, a few minutes later, in he goes:

https://youtu.be/gh7bUtECd0Y?t=29460 <https://youtu.be/gh7bUtECd0Y?t=29460>

Just before he pokes his nose in, you can see a guard bee at the far right of the entrance, not doing her job.

Back on-topic, I also have had an issue with these Reolink cameras, in that sometimes they get into a weird state that ffmpeg doesn’t like, and ffmpeg starts dumping out:

[rtsp @ 0x302c2f0] RTP: PT=60: bad cseq e680 expected=0b49
[rtsp @ 0x302c2f0] RTP: PT=60: bad cseq 93ab expected=0b49
[rtsp @ 0x302c2f0] RTP: PT=60: bad cseq 93ac expected=0b49
[rtsp @ 0x302c2f0] RTP: PT=60: bad cseq e682 expected=0b49

forever.

Has anyone seen this error, and/or know what it means? Stopping and restarting ffmpeg doesn’t fix this problem; I need to reboot the camera.

But I’m trying to grok how ffmpeg could put a camera into a bad state, just by connecting via rtsp.

????

> On Nov 21, 2019, at 1:58 AM, Moritz Barsnick <[hidden email]> wrote:
>
> On Wed, Nov 20, 2019 at 14:30:27 -0600, Steven Kan wrote:
>> Danke für deine Hilfe!
>
> Gerne!
>
>> Yes, I have mice in my yard :-(
>>
>> They can actually invade a weak hive and wreak havoc! Do you remember
>> approximately when you saw it? YT automatically archives the footage
>> twice a day, so I’d like to review it and see the mouse!
>
> I wasn't aware of that. Basically, about five minutes before I wrote my
> email, so around 14:05h CET. Have you considered downloading the
> archived YouTube stream and doing motion detection on it?
>
> Actually, I found it:
> https://youtu.be/gh7bUtECd0Y?t=29118
>

_______________________________________________
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".