Audio Stream Mapping issue

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

Audio Stream Mapping issue

Tim Nicholson
According to http://ffmpeg.org/ffmpeg.html#Main-options
"ffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT
encodes all video streams with libx264 and copies all audio streams"

However I have an mxf file with 1 video and 4 audio streams I am trying
to rewrap as a mov where I seem unable to get more than a single audio
stream copied.

I have tried the following command lines:-

ffmpeg -i in.mxf -vcodec copy -acodec copy tim2.mov

ffmpeg -i in.mxf -vcodec copy -acodec copy -ac 4 tim2.mov

ffmpeg -i in.mxf -vcodec copy -c:a copy tim2.mov

ffmpeg -i in.mxf -vcodec copy -c:a:0 copy -c:a:1 copy -c:a:2 copy -c:a:3
copy  tim2.mov

fmpeg -i in.mxf -vcodec copy -ac 4 -c:a:0 copy -c:a:1 copy -c:a:2 copy
-c:a:3 copy  tim2.mov

But all produce the same result:-

ffmpeg version N-34849-g07c7ffc-by_Tim, Copyright (c) 2000-2011 the
FFmpeg developers
   built on Nov 14 2011 12:24:11 with gcc 4.5.1 20101208 [gcc-4_5-branch
revision 167585]
   configuration: --extra-version=by_Tim --enable-static
--disable-shared --enable-gpl --enable-nonfree --enable-version3
--prefix=/mnt/store-0/tims/ffmpeg-tux/usr/local
--enable-runtime-cpudetect --extra-cflags='-static
-I/mnt/store-0/tims/ffmpeg-tux/usr/local/include'
--extra-ldflags='-static -L/mnt/store-0/tims/ffmpeg-tux/usr/local/lib'
--progs-suffix=STATIC --enable-libfaac --enable-libx264
   libavutil    51. 24. 1 / 51. 24. 1
   libavcodec   53. 33. 0 / 53. 33. 0
   libavformat  53. 20. 0 / 53. 20. 0
   libavdevice  53.  4. 0 / 53.  4. 0
   libavfilter   2. 48. 1 /  2. 48. 1
   libswscale    2.  1. 0 /  2.  1. 0
   libpostproc  51.  2. 0 / 51.  2. 0

Seems stream 0 codec frame rate differs from container frame rate: 50.00
(50/1) -> 25.00 (50/2)
Input #0, mxf, from 'JH3-AVCi100.mxf':
   Duration: 00:00:31.96, start: 0.000000, bitrate: 117147 kb/s
     Stream #0:0: Video: h264 (High 4:2:2 Intra), yuv422p10le, 1920x1080
[SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 50 tbc
     Stream #0:1: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
     Stream #0:2: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
     Stream #0:3: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
     Stream #0:4: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
Output #0, mov, to 'tim2.mov':
   Metadata:
     encoder         : Lavf53.20.0
     Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv422p10le,
1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 25 tbn, 25 tbc
     Stream #0:1: Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, 1
channels, 768 kb/s
Stream mapping:
   Stream #0:0 -> #0:0 (copy)
   Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help

--
Tim

http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
                                       
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Audio Stream Mapping issue

Tim Nicholson
On 15/11/11 08:46, Tim Nicholson wrote:

> According to http://ffmpeg.org/ffmpeg.html#Main-options
> "ffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT
> encodes all video streams with libx264 and copies all audio streams"
>
> However I have an mxf file with 1 video and 4 audio streams I am trying
> to rewrap as a mov where I seem unable to get more than a single audio
> stream copied.
>
> I have tried the following command lines:-
>
> ffmpeg -i in.mxf -vcodec copy -acodec copy tim2.mov
>
> ffmpeg -i in.mxf -vcodec copy -acodec copy -ac 4 tim2.mov
>
> ffmpeg -i in.mxf -vcodec copy -c:a copy tim2.mov
>
> ffmpeg -i in.mxf -vcodec copy -c:a:0 copy -c:a:1 copy -c:a:2 copy -c:a:3
> copy tim2.mov
>
> fmpeg -i in.mxf -vcodec copy -ac 4 -c:a:0 copy -c:a:1 copy -c:a:2 copy
> -c:a:3 copy tim2.mov
>
> But all produce the same result:-
>
> [..]
> Stream mapping:
> Stream #0:0 -> #0:0 (copy)
> Stream #0:1 -> #0:1 (copy)

So to answer my own point it seems that the "-map 0" is essential to get
all the tracks*. However according to:-
http://ffmpeg.org/ffmpeg.html#Stream-selection

"By default ffmpeg tries to pick the "best" stream of each type present
in input files and add them to each output file. For video, this means
the highest resolution, for audio the highest channel count. For
subtitle it’s simply the first subtitle stream.
[...]
For full manual control, use the -map option, which disables the
defaults just described. "

In my case with only 1 video and 4 audios I would expect the "default"
of "highest resolution" and "highest channel count" to give me what I
wanted, but it would appear that the audio default is *not* the highest
channel count but the first channel as per the subtitle spec.

*just for the record I used:-

ffmpeg -i in.mxf -map 0 -vcodec copy -acodec copy tim2.mov
--
Tim


http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
                                       
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Audio Stream Mapping issue

hughht5
I believe you may have to use Sox (or another program) until ffmpeg
developers add support for this. Please correct me if im wrong.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Audio Stream Mapping issue

hughht5
I would use the -map_channel option, however the documentation says it is limited at the moment:

(From http://ffmpeg.org/ffmpeg.html)
Note that "-map_channel" is currently limited to the scope of one input for each output; you can’t for example use it to pick multiple input audio files and mix them into one single output.

I hope this is being implemented.

Hugh
Reply | Threaded
Open this post in threaded view
|

Re: Audio Stream Mapping issue

Carl Eugen Hoyos
In reply to this post by Tim Nicholson
HI!

Tim Nicholson <tim.nicholson <at> bbc.co.uk> writes:

> According to http://ffmpeg.org/ffmpeg.html#Main-options
> "ffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT
> encodes all video streams with libx264 and copies all audio streams"
>
> However I have an mxf file with 1 video and 4 audio streams I am trying
> to rewrap as a mov where I seem unable to get more than a single audio
> stream copied.
>
> I have tried the following command lines:-
>
> ffmpeg -i in.mxf -vcodec copy -acodec copy tim2.mov
>
> ffmpeg -i in.mxf -vcodec copy -acodec copy -ac 4 tim2.mov
>
> ffmpeg -i in.mxf -vcodec copy -c:a copy tim2.mov
>
> ffmpeg -i in.mxf -vcodec copy -c:a:0 copy -c:a:1 copy -c:a:2 copy -c:a:3
> copy  tim2.mov
>
> fmpeg -i in.mxf -vcodec copy -ac 4 -c:a:0 copy -c:a:1 copy -c:a:2 copy
> -c:a:3 copy  tim2.mov

Afaict, all command lines you list omit "-map 0" meaning you ask ffmpeg NOT to
map all streams into the output file (but exactly one video and one audio
stream).
Or do I miss something?

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Audio Stream Mapping issue

Clément Bœsch
In reply to this post by hughht5
On Tue, Nov 15, 2011 at 02:05:35AM -0800, hughht5 wrote:
> I would use the -map_channel option, however the documentation says it is
> limited at the moment:
>
> (From http://ffmpeg.org/ffmpeg.html)
> Note that "-map_channel" is currently limited to the scope of one input for
> each output; you can’t for example use it to pick multiple input audio files
> and mix them into one single output.
>

AFAIU, Tim only has one file so it doesn't apply here.

Tim, I'm not sure to understand what you really want from your 4 stereo
audio streams. I can't tell if you want to pick only some (then -map) or
actually merge the channels of each streams into one single audio stream
(then what you need is indeed the -map_channel feature).

> I hope this is being implemented.
>

The multiple files limitation could be bypassed with an audio merge
filter; a WIP was sent on the mailing list by Nicolas. We lack man-power,
and patches are always welcome when it is a feature request :)

Regards,

--
Clément B.

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

attachment0 (501 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Audio Stream Mapping issue

Tim Nicholson
On 15/11/11 10:19, Clément Bœsch wrote:

> On Tue, Nov 15, 2011 at 02:05:35AM -0800, hughht5 wrote:
>> I would use the -map_channel option, however the documentation says it is
>> limited at the moment:
>>
>> (From http://ffmpeg.org/ffmpeg.html)
>> Note that "-map_channel" is currently limited to the scope of one input for
>> each output; you can’t for example use it to pick multiple input audio files
>> and mix them into one single output.
>>
>
> AFAIU, Tim only has one file so it doesn't apply here.
>

Quite so.

> Tim, I'm not sure to understand what you really want from your 4 stereo
> audio streams. I can't tell if you want to pick only some (then -map) or
> actually merge the channels of each streams into one single audio stream
> (then what you need is indeed the -map_channel feature).
>

All I actually wanted to do was rewrap mxf->mov with no other changes.
(They were in fact 4 mono streams mxf does not support stereo streams afaik)

ffmpeg -i in.mxf -map 0 -vcodec copy -acodec copy tim2.mov

or more succinctly:-

ffmpeg -i in.mxf -map 0 -c copy tim2.mov

performs this.

However according to the documentation the -map 0 *should* be
unnecessary as the default *should* be "for audio the highest channel
count" wheeras it seems to be the first audio stream only.



--
Tim


http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
                                       
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Audio Stream Mapping issue

Tim Nicholson
In reply to this post by Carl Eugen Hoyos
On 15/11/11 10:14, Carl Eugen Hoyos wrote:

> HI!
>
> Tim Nicholson<tim.nicholson<at>  bbc.co.uk>  writes:
>
>> According to http://ffmpeg.org/ffmpeg.html#Main-options
>> "ffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT
>> encodes all video streams with libx264 and copies all audio streams"
>>
>> However I have an mxf file with 1 video and 4 audio streams I am trying
>> to rewrap as a mov where I seem unable to get more than a single audio
>> stream copied.
>>
>> I have tried the following command lines:-
>>
>> ffmpeg -i in.mxf -vcodec copy -acodec copy tim2.mov
>>
>> ffmpeg -i in.mxf -vcodec copy -acodec copy -ac 4 tim2.mov
>>
>> ffmpeg -i in.mxf -vcodec copy -c:a copy tim2.mov
>>
>> ffmpeg -i in.mxf -vcodec copy -c:a:0 copy -c:a:1 copy -c:a:2 copy -c:a:3
>> copy  tim2.mov
>>
>> fmpeg -i in.mxf -vcodec copy -ac 4 -c:a:0 copy -c:a:1 copy -c:a:2 copy
>> -c:a:3 copy  tim2.mov
>
> Afaict, all command lines you list omit "-map 0" meaning you ask ffmpeg NOT to
> map all streams into the output file (but exactly one video and one audio
> stream).
> Or do I miss something?

You miss the documentation that states that the default mapping is:-
"For video, this means the highest resolution, for audio the highest
channel count" which says to me that one video of the highest resolution
is mapped and all audio (The highest count).

If this is not what it means then the documentation is ambiguous. since
for subtitles it specifically says "the first subtitle stream", and in
my tests as above it is the first audio as well.


Tim

http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
                                       
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Audio Stream Mapping issue

Clément Bœsch
In reply to this post by Tim Nicholson
On Tue, Nov 15, 2011 at 03:27:48PM +0000, Tim Nicholson wrote:

> On 15/11/11 10:19, Clément Bœsch wrote:
> >On Tue, Nov 15, 2011 at 02:05:35AM -0800, hughht5 wrote:
> >>I would use the -map_channel option, however the documentation says it is
> >>limited at the moment:
> >>
> >>(From http://ffmpeg.org/ffmpeg.html)
> >>Note that "-map_channel" is currently limited to the scope of one input for
> >>each output; you can’t for example use it to pick multiple input audio files
> >>and mix them into one single output.
> >>
> >
> >AFAIU, Tim only has one file so it doesn't apply here.
> >
>
> Quite so.
>
> >Tim, I'm not sure to understand what you really want from your 4 stereo
> >audio streams. I can't tell if you want to pick only some (then -map) or
> >actually merge the channels of each streams into one single audio stream
> >(then what you need is indeed the -map_channel feature).
> >
>
> All I actually wanted to do was rewrap mxf->mov with no other
> changes. (They were in fact 4 mono streams mxf does not support
> stereo streams afaik)
>
My bad, I misread it was mono.

> ffmpeg -i in.mxf -map 0 -vcodec copy -acodec copy tim2.mov
>
> or more succinctly:-
>
> ffmpeg -i in.mxf -map 0 -c copy tim2.mov
>
> performs this.
>
> However according to the documentation the -map 0 *should* be
> unnecessary as the default *should* be "for audio the highest
> channel count" wheeras it seems to be the first audio stream only.
>
The documenation sounds quite obvious to me; the selection pick "the
best", and in case of score equality, only the first one is picked. Maybe
it should indeed be explicited, or the behaviour changed.

Sorry for the first misunderstanding, I'll do some checks and send a patch
for this in a while if no one does.

--
Clément B.

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

attachment0 (501 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Audio Stream Mapping issue

Tim Nicholson
On 15/11/11 16:08, Clément Bœsch wrote:

> On Tue, Nov 15, 2011 at 03:27:48PM +0000, Tim Nicholson wrote:
>> On 15/11/11 10:19, Clément Bœsch wrote:
>>> On Tue, Nov 15, 2011 at 02:05:35AM -0800, hughht5 wrote:
>>>> I would use the -map_channel option, however the documentation says it is
>>>> limited at the moment:
>>>>
>>>> (From http://ffmpeg.org/ffmpeg.html)
>>>> Note that "-map_channel" is currently limited to the scope of one input for
>>>> each output; you can’t for example use it to pick multiple input audio files
>>>> and mix them into one single output.
>>>>
>>>
>>> AFAIU, Tim only has one file so it doesn't apply here.
>>>
>>
>> Quite so.
>>
>>> Tim, I'm not sure to understand what you really want from your 4 stereo
>>> audio streams. I can't tell if you want to pick only some (then -map) or
>>> actually merge the channels of each streams into one single audio stream
>>> (then what you need is indeed the -map_channel feature).
>>>
>>
>> All I actually wanted to do was rewrap mxf->mov with no other
>> changes. (They were in fact 4 mono streams mxf does not support
>> stereo streams afaik)
>>
>
> My bad, I misread it was mono.
>
>> ffmpeg -i in.mxf -map 0 -vcodec copy -acodec copy tim2.mov
>>
>> or more succinctly:-
>>
>> ffmpeg -i in.mxf -map 0 -c copy tim2.mov
>>
>> performs this.
>>
>> However according to the documentation the -map 0 *should* be
>> unnecessary as the default *should* be "for audio the highest
>> channel count" wheeras it seems to be the first audio stream only.
>>
>
> The documenation sounds quite obvious to me; the selection pick "the
> best", and in case of score equality, only the first one is picked. Maybe
> it should indeed be explicited, or the behaviour changed.
>

In my experience, of much documentation writing and editing of others
write ups, something that is abundantly clear to the writer can be
completely misinterpreted by end users approaching things from a
different starting point, it seems to be the way of things. That is why
I first rasied the issue here to try and get a consensus of what the
expected behaviour should be, and then try and understand how the
documentation can be read to mean that...

I am not sure where you get the 'pick "the best"' from the
documentation, it only says this for video, not audio!

I am happy to contribute to better wording, once I understand what the
"correct" behaviour is.


> Sorry for the first misunderstanding, I'll do some checks and send a patch
> for this in a while if no one does.

>


--
Tim


http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
                                       
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Audio Stream Mapping issue

Clément Bœsch
On Tue, Nov 15, 2011 at 04:23:36PM +0000, Tim Nicholson wrote:

> On 15/11/11 16:08, Clément Bœsch wrote:
> >On Tue, Nov 15, 2011 at 03:27:48PM +0000, Tim Nicholson wrote:
> >>On 15/11/11 10:19, Clément Bœsch wrote:
> >>>On Tue, Nov 15, 2011 at 02:05:35AM -0800, hughht5 wrote:
> >>>>I would use the -map_channel option, however the documentation says it is
> >>>>limited at the moment:
> >>>>
> >>>>(From http://ffmpeg.org/ffmpeg.html)
> >>>>Note that "-map_channel" is currently limited to the scope of one input for
> >>>>each output; you can’t for example use it to pick multiple input audio files
> >>>>and mix them into one single output.
> >>>>
> >>>
> >>>AFAIU, Tim only has one file so it doesn't apply here.
> >>>
> >>
> >>Quite so.
> >>
> >>>Tim, I'm not sure to understand what you really want from your 4 stereo
> >>>audio streams. I can't tell if you want to pick only some (then -map) or
> >>>actually merge the channels of each streams into one single audio stream
> >>>(then what you need is indeed the -map_channel feature).
> >>>
> >>
> >>All I actually wanted to do was rewrap mxf->mov with no other
> >>changes. (They were in fact 4 mono streams mxf does not support
> >>stereo streams afaik)
> >>
> >
> >My bad, I misread it was mono.
> >
> >>ffmpeg -i in.mxf -map 0 -vcodec copy -acodec copy tim2.mov
> >>
> >>or more succinctly:-
> >>
> >>ffmpeg -i in.mxf -map 0 -c copy tim2.mov
> >>
> >>performs this.
> >>
> >>However according to the documentation the -map 0 *should* be
> >>unnecessary as the default *should* be "for audio the highest
> >>channel count" wheeras it seems to be the first audio stream only.
> >>
> >
> >The documenation sounds quite obvious to me; the selection pick "the
> >best", and in case of score equality, only the first one is picked. Maybe
> >it should indeed be explicited, or the behaviour changed.
> >
>
> In my experience, of much documentation writing and editing of
> others write ups, something that is abundantly clear to the writer
> can be completely misinterpreted by end users approaching things
> from a different starting point, it seems to be the way of things.
Sure, I think we all agree with that.

> That is why I first rasied the issue here to try and get a consensus
> of what the expected behaviour should be, and then try and
> understand how the documentation can be read to mean that...
>
> I am not sure where you get the 'pick "the best"' from the
> documentation, it only says this for video, not audio!
>

OK, let's quote this:

    By default ffmpeg tries to pick the "best" stream of each type present
    in input files and add them to each output file. For video, this means
    the highest resolution, for audio the highest channel count. For
    subtitle it's simply the first subtitle stream.

"pick the best stream of each type [...] For video, [...], for audio
[...]"

I'm not sure where the confusion comes from…

> I am happy to contribute to better wording, once I understand what
> the "correct" behaviour is.
>

Quickly looking at ffmpeg.c (around L3934), the audio stream picking is
what we already suggested: it loops against all stream, pick the one with
the most number of channels (and thus *ignore* "score" equality) and add
it.

So if you want to fix the documentation, you should IMO just reword in a
sense to explicit the "only one pick per stream type". I'm not a native
English speaker so I'm sure you will be able to propose a better wording
than me; feel free to send a patch on ffmpeg-devel. If you don't, I'll
take the time to of course.

--
Clément B.

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

attachment0 (501 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Audio Stream Mapping issue

Tim Nicholson
On 15/11/11 16:33, Clément Bœsch wrote:

>[...]
>
> OK, let's quote this:
>
>      By default ffmpeg tries to pick the "best" stream of each type present
>      in input files and add them to each output file. For video, this means
>      the highest resolution, for audio the highest channel count. For
>      subtitle it's simply the first subtitle stream.
>
> "pick the best stream of each type [...] For video, [...], for audio
> [...]"
>
> I'm not sure where the confusion comes from…
>

I think the fact that, for audio a single channel, can be packaged
either in its own stream, or be combined with others into a multi
channel stream leads sometimes to thinking of one audio "item" as a
single channel, and at other times as a single stream. The transition
between these ways of thinking occurring subliminally and leading to
confusion (That's my excuse anyway).

>> I am happy to contribute to better wording, once I understand what
>> the "correct" behaviour is.
>>
>
> Quickly looking at ffmpeg.c (around L3934), the audio stream picking is
> what we already suggested: it loops against all stream, pick the one with
> the most number of channels (and thus *ignore* "score" equality) and add
> it.
>

With your help I think I have it sorted in my own mind, now. But I think
the doc could be improved.

> So if you want to fix the documentation, you should IMO just reword in a
> sense to explicit the "only one pick per stream type". I'm not a native
> English speaker so I'm sure you will be able to propose a better wording
> than me; feel free to send a patch on ffmpeg-devel. If you don't, I'll
> take the time to of course.

Never tried submitting a patch so will haver to bone up on how to do it...

--
Tim


http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
                                       
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Audio Stream Mapping issue

Clément Bœsch
On Tue, Nov 15, 2011 at 05:03:53PM +0000, Tim Nicholson wrote:

> On 15/11/11 16:33, Clément Bœsch wrote:
> >[...]
> >
> >OK, let's quote this:
> >
> >     By default ffmpeg tries to pick the "best" stream of each type present
> >     in input files and add them to each output file. For video, this means
> >     the highest resolution, for audio the highest channel count. For
> >     subtitle it's simply the first subtitle stream.
> >
> >"pick the best stream of each type [...] For video, [...], for audio
> >[...]"
> >
> >I'm not sure where the confusion comes from…
> >
>
> I think the fact that, for audio a single channel, can be packaged
> either in its own stream, or be combined with others into a multi
> channel stream leads sometimes to thinking of one audio "item" as a
> single channel, and at other times as a single stream. The
> transition between these ways of thinking occurring subliminally and
> leading to confusion (That's my excuse anyway).
>
The N mono channel to 1 stream can't really be autodetected, this is why
the -map_channel option now exists btw :)

> >>I am happy to contribute to better wording, once I understand what
> >>the "correct" behaviour is.
> >>
> >
> >Quickly looking at ffmpeg.c (around L3934), the audio stream picking is
> >what we already suggested: it loops against all stream, pick the one with
> >the most number of channels (and thus *ignore* "score" equality) and add
> >it.
> >
>
> With your help I think I have it sorted in my own mind, now. But I
> think the doc could be improved.
>
Certainly, and such changes are always welcome.

> >So if you want to fix the documentation, you should IMO just reword in a
> >sense to explicit the "only one pick per stream type". I'm not a native
> >English speaker so I'm sure you will be able to propose a better wording
> >than me; feel free to send a patch on ffmpeg-devel. If you don't, I'll
> >take the time to of course.
>
> Never tried submitting a patch so will haver to bone up on how to do it...
>

For such a trivial patch you can just write here the new paragraph, I'll
write the patch and put your name in the credits. You can also try the
"hard way": http://ffmpeg.org/developer.html#Submitting-patches-1

--
Clément B.

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

attachment0 (501 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Audio Stream Mapping issue

Carl Eugen Hoyos
In reply to this post by Tim Nicholson
Tim Nicholson <tim.nicholson <at> bbc.co.uk> writes:

> You miss the documentation that states that the default mapping is:-
> "For video, this means the highest resolution, for audio the highest
> channel count" which says to me that one video of the highest resolution
> is mapped and all audio (The highest count).

The default is (and always was) to map one audio stream to the destination file,
iirc there is a heuristic to choose the right stream which often works fine but
sometimes chooses the wrong stream, see "audio streams" a few days ago.

(If you believe the documentation is wrong - I did not check - please send a
patch to -devel.)

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Audio Stream Mapping issue

Carl Eugen Hoyos
In reply to this post by Clément Bœsch
Clément Bœsch <ubitux <at> gmail.com> writes:

> > Never tried submitting a patch so will haver to bone up on how to do it...
>
> For such a trivial patch you can just write here the new paragraph, I'll
> write the patch and put your name in the credits. You can also try the
> "hard way": http://ffmpeg.org/developer.html#Submitting-patches-1

As the old patch application monkey, I still accept patches made with
git diff >patchfile,diff attached as plain/text.

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Audio Stream Mapping issue

Tim Nicholson
In reply to this post by Clément Bœsch
On 15/11/11 17:20, Clément Bœsch wrote:
> On Tue, Nov 15, 2011 at 05:03:53PM +0000, Tim Nicholson wrote:
[...]

>> With your help I think I have it sorted in my own mind, now. But I
>> think the doc could be improved.
>>
>
> Certainly, and such changes are always welcome.
>
>>> So if you want to fix the documentation, you should IMO just reword in a
>>> sense to explicit the "only one pick per stream type". I'm not a native
>>> English speaker so I'm sure you will be able to propose a better wording
>>> than me; feel free to send a patch on ffmpeg-devel. If you don't, I'll
>>> take the time to of course.
>>
>> Never tried submitting a patch so will haver to bone up on how to do it...
>>
>
> For such a trivial patch you can just write here the new paragraph, I'll
> write the patch and put your name in the credits. You can also try the
> "hard way": http://ffmpeg.org/developer.html#Submitting-patches-1

Here is my suggestion

-------------cut--------------------
By default ffmpeg includes only one stream of each type (video, audio,
subtitle) present in input files and adds them to each output file.
It picks the "best" of each based upon the following criteria;
for video it is the stream with the highest resolution, for audio the
stream with the most channels, for subtitle it's the first subtitle stream.
In the case where several streams of the same type rate equally, the
lowest numbered stream is chosen.

-----------------cut-------------------------

If you are happy to  submit it then meanwhile I will have a play at all
the git stuff required for doing it the "hard way" so hopefully I will
be better placed to be more useful next time...

--
Tim


http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
                                       
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Audio Stream Mapping issue

Clément Bœsch
On Thu, Nov 17, 2011 at 04:16:39PM +0000, Tim Nicholson wrote:

> On 15/11/11 17:20, Clément Bœsch wrote:
> >On Tue, Nov 15, 2011 at 05:03:53PM +0000, Tim Nicholson wrote:
> [...]
> >>With your help I think I have it sorted in my own mind, now. But I
> >>think the doc could be improved.
> >>
> >
> >Certainly, and such changes are always welcome.
> >
> >>>So if you want to fix the documentation, you should IMO just reword in a
> >>>sense to explicit the "only one pick per stream type". I'm not a native
> >>>English speaker so I'm sure you will be able to propose a better wording
> >>>than me; feel free to send a patch on ffmpeg-devel. If you don't, I'll
> >>>take the time to of course.
> >>
> >>Never tried submitting a patch so will haver to bone up on how to do it...
> >>
> >
> >For such a trivial patch you can just write here the new paragraph, I'll
> >write the patch and put your name in the credits. You can also try the
> >"hard way": http://ffmpeg.org/developer.html#Submitting-patches-1
>
> Here is my suggestion
>
> -------------cut--------------------
> By default ffmpeg includes only one stream of each type (video,
> audio, subtitle) present in input files and adds them to each output
> file.
> It picks the "best" of each based upon the following criteria;
> for video it is the stream with the highest resolution, for audio
> the stream with the most channels, for subtitle it's the first
> subtitle stream.
> In the case where several streams of the same type rate equally, the
> lowest numbered stream is chosen.
>
> -----------------cut-------------------------
Thank you, just submitted this version to ffmpeg-devel (you should have
received a copy of the patch). It will be discussed if necessary and
should be applied soon.

[...]

--
Clément B.

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

attachment0 (501 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Audio Stream Mapping issue

rogerdpack2
In reply to this post by Clément Bœsch
> The multiple files limitation could be bypassed with an audio merge
> filter; a WIP was sent on the mailing list by Nicolas. We lack man-power,
> and patches are always welcome when it is a feature request :)

Do you have a link you could provide for Nicolas' WIP? (quick google
search seemed unfruitful).
Thanks!
-r
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user