Capture multiple streams into same container?

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

Capture multiple streams into same container?

Simon
Greetings all, I'm a pretty low-level ffmpeg user, just doing screen
captures, compressions, and some simple format conversions. I have not made
much progress understanding more advanced key concepts; I apologize if this
is a basic question.

I have a four-input video capture card, (Blackmagic DeckLink) and I
successfully built ffmpeg with support for that. I can capture using the
card, and I can run two captures concurrently as independent processes
putting output into two different files. I haven't tried running all four
at once (though that's my long-term goal, along with another four audio
channels from a USB capture device).

However, I would like to be able to put the multiple streams into a single
file. There are a couple of reasons for this, and if my expectations are
misplaced, now's a great time to tell me. One is that I'd like the
timecodes to be synchronized, another is that I'd prefer a single command
to start everything, and end everything, at the same instant. This, I hope
will reduce the complexity of synchronizing the channels in later editing.

But I have no clue how to start with this. I tried simply adding more input
channels to my input specifications:

ffmpeg -f decklink -i 'DeckLink Quad HDMI Recorder (1)' -f decklink -i
'DeckLink Quad HDMI Recorder (4)'  -c:v copy -c:a copy -metadata
title=DeckLinkCapture  capture.mov

But all I got was a ton of buffer overruns, and a file that ffprobe said
only contained one video stream.

I believe that .mov can hold multiple streams, but I have not particular
reason for using that file format, other than I often use it when I go with
a prores compression. (I'm hoping that later in this project I might get
enough CPU power to go that route, and reduce bandwidth and storage
requirements to less insane levels)

Can someone point me at a template for a command line that might do what I
need? If the explanation or resources might help me understand the concepts
better, that would be a bonus (and might result in my becoming a little
more self-sufficient!)

Cheers,
Simon


--
Simon Roberts
(303) 249 3613
_______________________________________________
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: Capture multiple streams into same container?

Tom Sparks-2
mkv is a better output format to use

On 24/06/2020, Simon Roberts <[hidden email]> wrote:

> Greetings all, I'm a pretty low-level ffmpeg user, just doing screen
> captures, compressions, and some simple format conversions. I have not made
> much progress understanding more advanced key concepts; I apologize if this
> is a basic question.
>
> I have a four-input video capture card, (Blackmagic DeckLink) and I
> successfully built ffmpeg with support for that. I can capture using the
> card, and I can run two captures concurrently as independent processes
> putting output into two different files. I haven't tried running all four
> at once (though that's my long-term goal, along with another four audio
> channels from a USB capture device).
>
> However, I would like to be able to put the multiple streams into a single
> file. There are a couple of reasons for this, and if my expectations are
> misplaced, now's a great time to tell me. One is that I'd like the
> timecodes to be synchronized, another is that I'd prefer a single command
> to start everything, and end everything, at the same instant. This, I hope
> will reduce the complexity of synchronizing the channels in later editing.
>
> But I have no clue how to start with this. I tried simply adding more input
> channels to my input specifications:
>
> ffmpeg -f decklink -i 'DeckLink Quad HDMI Recorder (1)' -f decklink -i
> 'DeckLink Quad HDMI Recorder (4)'  -c:v copy -c:a copy -metadata
> title=DeckLinkCapture  capture.mov
>
> But all I got was a ton of buffer overruns, and a file that ffprobe said
> only contained one video stream.
>
> I believe that .mov can hold multiple streams, but I have not particular
> reason for using that file format, other than I often use it when I go with
> a prores compression. (I'm hoping that later in this project I might get
> enough CPU power to go that route, and reduce bandwidth and storage
> requirements to less insane levels)
>
> Can someone point me at a template for a command line that might do what I
> need? If the explanation or resources might help me understand the concepts
> better, that would be a bonus (and might result in my becoming a little
> more self-sufficient!)
>
> Cheers,
> Simon
>
>
> --
> Simon Roberts
> (303) 249 3613
> _______________________________________________
> 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: Capture multiple streams into same container?

Moritz Barsnick
In reply to this post by Simon
On Tue, Jun 23, 2020 at 21:31:25 -0600, Simon Roberts wrote:
> But I have no clue how to start with this. I tried simply adding more input
> channels to my input specifications:
>
> ffmpeg -f decklink -i 'DeckLink Quad HDMI Recorder (1)' -f decklink -i
> 'DeckLink Quad HDMI Recorder (4)'  -c:v copy -c:a copy -metadata
> title=DeckLinkCapture  capture.mov

By default, ffmpeg only maps one of each stream type (video, audio,
subs), as described here:
https://ffmpeg.org/ffmpeg.html#Automatic-stream-selection

In your case, you need to explicitly map multiple inputs:

$ ffmpeg -f decklink -i 'DeckLink Quad HDMI Recorder (1)' -f decklink -i 'DeckLink Quad HDMI Recorder (4)' -map 0 -map 1 -c:v copy -c:a copy -metadata title=DeckLinkCapture capture.mov

(Note the "-map 0 -map 1" addition.)

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: Capture multiple streams into same container?

Simon
On Wed, Jun 24, 2020 at 5:43 AM Moritz Barsnick <[hidden email]> wrote:

> On Tue, Jun 23, 2020 at 21:31:25 -0600, Simon Roberts wrote:
> > But I have no clue how to start with this. I tried simply adding more
> input
> > channels to my input specifications:
> [... elided my incorrect command...]
>


> By default, ffmpeg only maps one of each stream type (video, audio,
> subs), as described here:
> https://ffmpeg.org/ffmpeg.html#Automatic-stream-selection
>
> In your case, you need to explicitly map multiple inputs:
>
> $ ffmpeg -f decklink -i 'DeckLink Quad HDMI Recorder (1)' -f decklink -i
> 'DeckLink Quad HDMI Recorder (4)' -map 0 -map 1 -c:v copy -c:a copy
> -metadata title=DeckLinkCapture capture.mov
>
> (Note the "-map 0 -map 1" addition.)
>
> Many thanks Moritz, I'll go tinker with this, and engage with that
documentation you refer to too. The overall docs can be quite overwhelming
when one doesn't have a clue where to start!

Cheers,
Simon
_______________________________________________
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: Capture multiple streams into same container?

Simon
In reply to this post by Tom Sparks-2
On Wed, Jun 24, 2020 at 3:41 AM Tom Sparks <[hidden email]> wrote:

> mkv is a better output format to use
>

Thanks for this Tom, can you expand on what the benefits are? I think I
ended up with mov as it seemed to be the "natural" choice for apple prores
content, but there was no thought went into it, just "what somebody said" :)




> On 24/06/2020, Simon Roberts <[hidden email]> wrote:
> > Greetings all, I'm a pretty low-level ffmpeg user, just doing screen
> > captures, compressions, and some simple format conversions. I have not
> made
> > much progress understanding more advanced key concepts; I apologize if
> this
> > is a basic question.
> >
> > I have a four-input video capture card, (Blackmagic DeckLink) and I
> > successfully built ffmpeg with support for that. I can capture using the
> > card, and I can run two captures concurrently as independent processes
> > putting output into two different files. I haven't tried running all four
> > at once (though that's my long-term goal, along with another four audio
> > channels from a USB capture device).
> >
> > However, I would like to be able to put the multiple streams into a
> single
> > file. There are a couple of reasons for this, and if my expectations are
> > misplaced, now's a great time to tell me. One is that I'd like the
> > timecodes to be synchronized, another is that I'd prefer a single command
> > to start everything, and end everything, at the same instant. This, I
> hope
> > will reduce the complexity of synchronizing the channels in later
> editing.
> >
> > But I have no clue how to start with this. I tried simply adding more
> input
> > channels to my input specifications:
> >
> > ffmpeg -f decklink -i 'DeckLink Quad HDMI Recorder (1)' -f decklink -i
> > 'DeckLink Quad HDMI Recorder (4)'  -c:v copy -c:a copy -metadata
> > title=DeckLinkCapture  capture.mov
> >
> > But all I got was a ton of buffer overruns, and a file that ffprobe said
> > only contained one video stream.
> >
> > I believe that .mov can hold multiple streams, but I have not particular
> > reason for using that file format, other than I often use it when I go
> with
> > a prores compression. (I'm hoping that later in this project I might get
> > enough CPU power to go that route, and reduce bandwidth and storage
> > requirements to less insane levels)
> >
> > Can someone point me at a template for a command line that might do what
> I
> > need? If the explanation or resources might help me understand the
> concepts
> > better, that would be a bonus (and might result in my becoming a little
> > more self-sufficient!)
> >
> > Cheers,
> > Simon
> >
> >
> > --
> > Simon Roberts
> > (303) 249 3613
> > _______________________________________________
> > 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".



--
Simon Roberts
(303) 249 3613
_______________________________________________
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: Capture multiple streams into same container?

Tom Sparks-2
On 25/06/2020, Simon Roberts <[hidden email]> wrote:
> On Wed, Jun 24, 2020 at 3:41 AM Tom Sparks <[hidden email]> wrote:
>
>> mkv is a better output format to use
>>
>
> Thanks for this Tom, can you expand on what the benefits are? I think I
> ended up with mov as it seemed to be the "natural" choice for apple prores
> content, but there was no thought went into it, just "what somebody said" :)
>
mkv support every know format*

the could be a case when you want to store the:
* video in FFV1 (lossless) or AV1 (lossy) or Mjpeg (i-frame)
* audio in opus (lossy) or flac (lossless)

this link talk more about using proress with ffmpeg:
https://trac.ffmpeg.org/wiki/Encode/VFX

you can disregard everything else I said if you want to
>
* except really old formats like realaudio/video
_______________________________________________
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: Capture multiple streams into same container?

Carl Eugen Hoyos-2
In reply to this post by Simon
Am Mi., 24. Juni 2020 um 22:46 Uhr schrieb Simon Roberts
<[hidden email]>:
>
> On Wed, Jun 24, 2020 at 3:41 AM Tom Sparks <[hidden email]> wrote:
>
> > mkv is a better output format to use
> >
>
> Thanks for this Tom, can you expand on what the benefits are?
> I think I ended up with mov as it seemed to be the "natural"
> choice for apple prores content

Which is correct.

Note that above suggestion would not have helped you in any way
with your original issue.

Carl Eugen
_______________________________________________
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: Capture multiple streams into same container?

Simon
In reply to this post by Tom Sparks-2
On Wed, Jun 24, 2020 at 4:26 PM Tom Sparks <[hidden email]> wrote:

> On 25/06/2020, Simon Roberts <[hidden email]> wrote:
> > On Wed, Jun 24, 2020 at 3:41 AM Tom Sparks <[hidden email]>
> wrote:
> >
> >> mkv is a better output format to use
> >>
> >
> > Thanks for this Tom, can you expand on what the benefits are? I think I
> > ended up with mov as it seemed to be the "natural" choice for apple
> prores
> > content, but there was no thought went into it, just "what somebody
> said" :)
> >
> mkv support every know format*
>

Oh, that's good to know, thank you.
[...]

this link talk more about using proress with ffmpeg:
> https://trac.ffmpeg.org/wiki/Encode/VFX


This looks very interesting too; my project definitely involves balancing
CPU usage in compression with resulting data size, with the absolute
requirement that the compression be 100% guaranteed to be real time. With
modest hardware and three full-HD channels plus a 720p channel, it's a fine
line and no doubt a better understanding of the prores encoder and its
options will be very valuable.

>
> you can disregard everything else I said if you want to
>

I think I would disregard educated comments at my peril!

thanks again :)
_______________________________________________
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".