Copy all subtitle streams? Possible?

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

Copy all subtitle streams? Possible?

Mark Filipak
'-c:a copy' or '-acodec copy' will copy (all?) audio tracks. I have 2 questions:
Do I need to also specify a '-map' directive? and
Is there an equivalent directive for copying subtitle streams?

I have searched throughout the docs and on the net until my eyes are blurry.

(I must confess that I'm still somewhat mystified by the '-map' directive.)

Thanks much,
Mark.
_______________________________________________
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: Copy all subtitle streams? Possible?

Gyan Doshi-2


On 30-03-2020 10:32 am, Mark Filipak wrote:
> '-c:a copy' or '-acodec copy' will copy (all?) audio tracks. I have 2
> questions:
> Do I need to also specify a '-map' directive? and
> Is there an equivalent directive for copying subtitle streams?

     -c:s copy  or  -scodec copy will copy subtitle streams.

For stream selection and mapping or lack of, see
http://ffmpeg.org/ffmpeg.html#Stream-selection


Regards,
Gyan
_______________________________________________
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: Copy all subtitle streams? Possible?

kumowoon1025
In reply to this post by Mark Filipak
Hey,

> '-c:a copy' or '-acodec copy' will copy (all?) audio tracks. I have 2 questions:
> Do I need to also specify a '-map' directive? and
> Is there an equivalent directive for copying subtitle streams?

IIRC, -codec only specifies the codec, and stream selection is done by -map, except when you explicitly specify an encoder for a stream type and there is at least one stream that matches that specifier, then it will select one of that stream as well, according to the normal stream selection rules, in addition to the ones already selected.

So it might stream copy one audio track to the output when it wasn’t before at most, which might have been all of them for many input files. But I don’t think there is a muxer that only selects a video stream by default and also has a default audio stream encoder.  I think it’s more of a convenience feature for subtitles, since if you specify a subtitle format then you obviously want at least one subtitle track included in the output and you probably picked a compatible format at that.

Regards,
Ted Park

_______________________________________________
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: Copy all subtitle streams? Possible?

Mark Filipak
In reply to this post by Gyan Doshi-2
Thanks, Gyan!

On 03/30/2020 01:17 AM, Gyan Doshi wrote:
>
>
> On 30-03-2020 10:32 am, Mark Filipak wrote:
>> '-c:a copy' or '-acodec copy' will copy (all?) audio tracks. I have 2 questions:
>> Do I need to also specify a '-map' directive? and
>> Is there an equivalent directive for copying subtitle streams?
>
>      -c:s copy  or  -scodec copy will copy subtitle streams.

Oh, that's great! Thanks.

> For stream selection and mapping or lack of, see http://ffmpeg.org/ffmpeg.html#Stream-selection

Ah! "Stream-selection"! Silly me. I looked for '-map'.

"ffmpeg provides the -map option for manual control of stream selection in each output file. Users
can skip -map and let ffmpeg perform automatic stream selection as described below. The -vn / -an /
-sn / -dn options can be used to skip inclusion of video, audio, subtitle and data streams
respectively, whether manually mapped or automatically selected, except for those streams which are
outputs of complex filtergraphs."

This is great. Just the other day I searched in vain for a way to skip video so I could copy just
the audio streams to merge in with a video I'd transcoded earlier. Well: '-vn', there it is.

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".
Reply | Threaded
Open this post in threaded view
|

Re: Copy all subtitle streams? Possible?

Gyan Doshi-2
In reply to this post by kumowoon1025


On 30-03-2020 10:56 am, Ted Park wrote:
> Hey,
>
>> '-c:a copy' or '-acodec copy' will copy (all?) audio tracks. I have 2 questions:
>> Do I need to also specify a '-map' directive? and
>> Is there an equivalent directive for copying subtitle streams?
> IIRC, -codec only specifies the codec, and stream selection is done by -map, except when you explicitly specify an encoder for a stream type and there is at least one stream that matches that specifier, then it will select one of that stream as well, according to the normal stream selection rules, in addition to the ones already selected.

Only for subtitles. -codec will not automatically select a stream for
other types. See http://ffmpeg.org/ffmpeg.html#Stream-handling

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