Re: [FFmpeg-user] Add soft subtitles to YouTube Mouse Stream?

2019-11-20 Thread Moritz Barsnick
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
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] ffmpeg cuvid not transcoding properly

2019-11-20 Thread Andy
It seems like again I hit the wall. While one mpeg2 source works with
the mpeg2_cuvid option, the other gives me troubles.

ffmpeg -threads 1 -vsync 1 -hwaccel cuvid -c:v mpeg2_cuvid -deint 1
-drop_second_field 1 -i 'http://0.0.0.0:46007' -c:v h264_nvenc -vb
1000k -preset:v medium -c:a aac -ac 2 -ar 48k -ab 96k -map 0:0 -map
0:1 -f flv rtmp://0.0.0.0:1940/live/1
ffmpeg version N-95728-g1354c39 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.12) 20160609
  configuration: --enable-cuda --enable-cuvid --enable-nvenc
--enable-nonfree --enable-libnpp
--extra-cflags=-I/usr/local/cuda/include
--extra-ldflags=-L/usr/local/cuda/lib64 --enable-libx264
--enable-libfdk-aac --enable-gpl
  libavutil  56. 35.101 / 56. 35.101
  libavcodec 58. 62.100 / 58. 62.100
  libavformat58. 35.100 / 58. 35.100
  libavdevice58.  9.100 / 58.  9.100
  libavfilter 7. 66.100 /  7. 66.100
  libswscale  5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc55.  6.100 / 55.  6.100
[mpegts @ 0x3092a40] Could not find codec parameters for stream 0
(Video: mpeg2video ([27][0][0][0] / 0x001B), none(tv)): unspecified
size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'http://0.0.0.0:46007':
  Duration: N/A, start: 67033.565011, bitrate: 192 kb/s
  Program 107
Metadata:
  service_name: NTV
  service_provider: NTV BD
Stream #0:0[0x327]: Video: mpeg2video ([27][0][0][0] / 0x001B),
none(tv), 90k tbr, 90k tbn, 90k tbc
Stream #0:1[0x2c3]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz,
stereo, fltp, 192 kb/s
[AVHWFramesContext @ 0x3a36600] [IMGUTILS @ 0x7ffc3bcc6230] Picture
size 0x0 is invalid
[mpeg2_cuvid @ 0x3098a40] Error initializing a CUDA frame pool
cuvid hwaccel requested for input stream #0:0, but cannot be initialized.
[mpeg2_cuvid @ 0x3098a40] ff_get_format failed: -1
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (mpeg2_cuvid) -> h264 (h264_nvenc))
  Stream #0:1 -> #0:1 (mp2 (native) -> aac (native))
Error while opening decoder for input stream #0:0 : Operation not permitted
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Add soft subtitles to YouTube Stream Now?

2019-11-20 Thread Steven Kan
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  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  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  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 >> 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
>>> ffmpeg-user@ffmpeg.

Re: [FFmpeg-user] Add soft subtitles to YouTube Stream Now?

2019-11-20 Thread Steven Kan
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 


(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  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  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 > 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
>> ffmpeg-user@ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>> 
>> To unsubscribe, visit link above, or email
>> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg

Re: [FFmpeg-user] Add soft subtitles to YouTube Mouse Stream?

2019-11-20 Thread Steven Kan
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  > 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 
>>  
>> > >
> 
> 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
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Add soft subtitles to YouTube Stream Now?

2019-11-20 Thread 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  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  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  > 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
> > ffmpeg-user@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".



-- 
Bruno Verachten
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-user] Producing several quality video streams from one 1080p stream.

2019-11-20 Thread Verachten Bruno
Hi there,

First of all, sorry for being vague, I don't have ffmpeg command line
options yet, I'm just trying to know if I'm totally mistaken, or if my
idea could be implemented quite safely/easily.

I'm currently thinking of getting rid of YouTube for streaming within
the company I work for (because YT consumes so much bandwidth, and you
have not guarantee whatsoever about the quality, and even not talking
about IP and so on).
I could install big (but kind of old aka free) generic X86_64 servers
in the server room, and using Kaltura on them, or even buy a fine
piece of hardware that would do everything (it would take months to
get the agreement), but I'd like to setup a POC first and foremost.
I know ffserver has been abandoned, so it's out of the picture.

I have lots of tiny and dirt cheap Linux ARM machines that can H.264 encode.
I have machines producing content (which could be RAW, or H.264).
So I thought of having the content producers multicast thanks to
ffmpeg, and the small machines grabbing it, reducing the
bitrate/quality, and then broadcasting to whatever machine could
handle content delivery to the final user. I'm not so sure that's
smart, as most of the video delivery software may want to do the
downgrading by themselves.
The goal of the POC would be to do most of the work on the edge of the
network with ffmpeg (i.e. directly in the conference rooms) so that
the server software could be hosted on the simplest, smallest and
cheapest server with the simplest software possible to multicast.

I suppose there are smarter ways with ffmpeg to get from a 1080p to
lesser quality streams than just multicasting, encoding/downgrading,
broadcasting to a server, and then multicasting.

If you managed to read me until there, would you have any idea or
recommandation?

Thanks.
-- 
Bruno Verachten
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] encoding H264 from pictures, encoding values manipulation

2019-11-20 Thread Carl Eugen Hoyos
Am Mi., 20. Nov. 2019 um 16:39 Uhr schrieb Jorge Mas :

> im trying to generate a video with the same h264 encoding parameters
> as a video that was given to me.

In addition to what Moritz wrote, I'd like to add that this may not be
possible depending on the used encoders.

Carl Eugen
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] encoding H264 from pictures, encoding values manipulation

2019-11-20 Thread Moritz Barsnick
On Wed, Nov 20, 2019 at 16:38:49 +0100, Jorge Mas wrote:
>   ./ffmpeg.exe -framerate 25 -i $picture%04d.jpg -g 1 -c:v libx264
> -profile:v baseline -level 4.0 -crf 20 -pix_fmt yuv420p $picture.mp4
>   ./ffmpeg.exe -i $picture.mp4 -vcodec copy -vbsf h264_mp4toannexb -an
> $picture.mp4.h264

You don't need to do this in two steps.

> after analyzing both of videos with a tool named  SpecialVH264, several
> parameters differ between both videos, i.e:
> constraint_set0_flag in the original video is 0, but in the one that im
> generating the value is 1.

You should also show us the difference of the console outputs of
$ ffmpeg -i inputvideo
$ ffmpeg -i outputvideo

You should also show us the complete, uncut console output of your
conversion.

> is there a way that i can manipulate that constraint_set0_flag parameter?

If I understand correctly, the flag says something about the profile.
Indeed, libx264 has these code lines:
https://github.com/mirror/x264/blob/d4099dd4c722f52c4f3c14575d7d39eb8fadb97f/encoder/set.c#L129

> sps->b_constraint_set0  = sps->i_profile_idc == PROFILE_BASELINE;
> sps->b_constraint_set1  = sps->i_profile_idc <= PROFILE_MAIN;

So it seems your video is created with the Baseline profile. (We would
be able to see if you provided those outputs.)

Basically, choose a higher profile, e.g. by adding the encoder option
  -profile:v Main
or
  -profile:v High

(It depends what you want constraint_set1_flag to be.)

Cheers,
Moritz
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Add soft subtitles to YouTube Stream Now?

2019-11-20 Thread Michael Shaffer
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  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  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
> ffmpeg-user@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Add soft subtitles to YouTube Stream Now?

2019-11-20 Thread 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/ 
> > 
> > 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
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-user] encoding H264 from pictures, encoding values manipulation

2019-11-20 Thread Jorge Mas
Hello.

Im new using ffmpeg and mostly in the video field.

im trying to generate a video with the same h264 encoding parameters as a
video that was given to me.

im generating a h264 video parting from pictures, the commands that im
using are the following:

  ./ffmpeg.exe -framerate 25 -i $picture%04d.jpg -g 1 -c:v libx264
-profile:v baseline -level 4.0 -crf 20 -pix_fmt yuv420p $picture.mp4
  ./ffmpeg.exe -i $picture.mp4 -vcodec copy -vbsf h264_mp4toannexb -an
$picture.mp4.h264

after analyzing both of videos with a tool named  SpecialVH264, several
parameters differ between both videos, i.e:
constraint_set0_flag in the original video is 0, but in the one that im
generating the value is 1.

is there a way that i can manipulate that constraint_set0_flag parameter?

thanks
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Add soft subtitles to YouTube Stream Now?

2019-11-20 Thread Moritz Barsnick
On Wed, Nov 20, 2019 at 08:43:00 -0600, Steven Kan wrote:
> > 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 
> 

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/ 
> 
> 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
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Add soft subtitles to YouTube Stream Now?

2019-11-20 Thread Steven Kan
> On Nov 20, 2019, at 7:11 AM, Moritz Barsnick  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 
> 

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  

I did find this libcaption project:

https://github.com/szatmary/libcaption 

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

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
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Concatenating grows file size

2019-11-20 Thread Cecil Westerhof
Moritz Barsnick  writes:

> On Wed, Nov 20, 2019 at 11:54:43 +0100, Cecil Westerhof wrote:
>> ffmpeg -f concat -safe 0 -i <(echo "${files}") -c copy ${newFile}.mts
>>
>> I would expect the resulting file to have the same size as the
>> original files, but the size grows. The input files are together
>> 10.6 GB while the concatenated file is 10.9 GB. That is 3% extra. Is
>> this normal, or am I doing something wrong?
>
> That is probably to be expected. What ffmpeg does is to remux your
> streams. ffmpeg's MPEG-TS muxer may not be as efficient as the
> original, and/or have other options, leading to a differing size.

Because the '-c copy' I did not expect that, but I do not have to
worry then.

Also, in the past I had another camera which produce MP4 files and I
think there the sizes stayed the same, but I am not sure.


> Does the suffix .mts imply the M2TS format? If so, you may need to
> specify "-mpegts_m2ts_mode 1" to achieve this, which will make the
> muxer operate differently. You can also check out other available
> options with "ffmpeg -h muxer=mpegts". But I suppose you should just
> accept that the difference is expected, if that's okay for you.

Was just wondering if something went wrong. But that is not the case.
What I get is OK. Later I will look in the options you mentioned.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Add soft subtitles to YouTube Stream Now?

2019-11-20 Thread 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 
> 

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
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Concatenating grows file size

2019-11-20 Thread Moritz Barsnick
On Wed, Nov 20, 2019 at 11:54:43 +0100, Cecil Westerhof wrote:
> ffmpeg -f concat -safe 0 -i <(echo "${files}") -c copy ${newFile}.mts
>
> I would expect the resulting file to have the same size as the
> original files, but the size grows. The input files are together
> 10.6 GB while the concatenated file is 10.9 GB. That is 3% extra. Is
> this normal, or am I doing something wrong?

That is probably to be expected. What ffmpeg does is to remux your
streams. ffmpeg's MPEG-TS muxer may not be as efficient as the
original, and/or have other options, leading to a differing size.

Does the suffix .mts imply the M2TS format? If so, you may need to
specify "-mpegts_m2ts_mode 1" to achieve this, which will make the
muxer operate differently. You can also check out other available
options with "ffmpeg -h muxer=mpegts". But I suppose you should just
accept that the difference is expected, if that's okay for you.

Cheers,
Moritz
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Reducing video file size

2019-11-20 Thread James Northrup
i don't always make reccomendations about codecs and filters I'm unfamiliar
with, but luckily i wrote a tool to accelerate the buffoonery in times of
critical need

https://jnorthrup.github.io/ffblockly/

[image: image.png]
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-user] Concatenating grows file size

2019-11-20 Thread Cecil Westerhof
I use the following Bash code to concatenate some video files:
first=15
last=20
files=$(
for i in $(seq ${first} ${last}) ; do
printf "file ${PWD}/%05d.MTS\n" $i
done
)
newFile=$(printf "%05d-%05d" ${first} ${last})
ffmpeg -f concat -safe 0 -i <(echo "${files}") -c copy ${newFile}.mts

I would expect the resulting file to have the same size as the
original files, but the size grows. The input files are together
10.6 GB while the concatenated file is 10.9 GB. That is 3% extra. Is
this normal, or am I doing something wrong?

I am using version 4.1.4-1~deb10u1.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".