Error extracting srt

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Error extracting srt

Alex Zachopoulos
Hi all,

I want to extract the SRT stream from mp4 files.
On my MacPro with High Sierra running ffmpeg 3.3 all is fine.
On my MacBook Pro with Catalina running ffmpeg 4.3 I keep getting an error.
This is the command I use to extract Stream #0:2 (subtitle) from file
1.mp4, on both computers:

ffmpeg -i 1.mp4 -vn -an -codec:s:0.2 srt 1.srt

On the MacBook Pro with Catalina and ffmpeg 4.3 is complains, twice:
First, somewhere down the middle of the dump it says:
*[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fd3b4009800] stream 0, timescale not set*

Then at the end of the dump it says:
*[srt @ 0x7fd3b300ce00] Invalid stream specifier: s:0.2.*
*    Last message repeated 1 times*

Like I said, the same command works without a hitch on the MacPro.
Anyone can help with any pointers, it'll be much appreciated.
Alex
_______________________________________________
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: Error extracting srt

Moritz Barsnick
On Wed, Aug 05, 2020 at 22:28:15 +0100, Alex Zachopoulos wrote:
> This is the command I use to extract Stream #0:2 (subtitle) from file
                                              ^^ This is an input stream
                                                 specifier, for mapping
> 1.mp4, on both computers:
>
> ffmpeg -i 1.mp4 -vn -an -codec:s:0.2 srt 1.srt
                                 ^^ This is an output stream specifier.

You want to tell ffmpeg to encode the first *output* subtitle stream as
SRT. That's not "0:2", neither "0.2", that's just "0".

If you have only one output SRT stream - which should be the case,
since your output SRT file can only include one stream - you can omit
the output stream specifier: "-codec:s"

In your case, you can omit the "-codec:s" totally, because the suffix
of your output file implies it.

> *[srt @ 0x7fd3b300ce00] Invalid stream specifier: s:0.2.*

I assume the stream specifier parser used to just ignore the ".2", and
it no longer does, and errors out instead.

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: Error extracting srt

Alex Zachopoulos
Thank you SO much Moritz!

On Fri, Aug 7, 2020 at 12:20 PM Moritz Barsnick <[hidden email]> wrote:

> On Wed, Aug 05, 2020 at 22:28:15 +0100, Alex Zachopoulos wrote:
> > This is the command I use to extract Stream #0:2 (subtitle) from file
>                                               ^^ This is an input stream
>                                                  specifier, for mapping
> > 1.mp4, on both computers:
> >
> > ffmpeg -i 1.mp4 -vn -an -codec:s:0.2 srt 1.srt
>                                  ^^ This is an output stream specifier.
>
> You want to tell ffmpeg to encode the first *output* subtitle stream as
> SRT. That's not "0:2", neither "0.2", that's just "0".
>
> If you have only one output SRT stream - which should be the case,
> since your output SRT file can only include one stream - you can omit
> the output stream specifier: "-codec:s"
>
> In your case, you can omit the "-codec:s" totally, because the suffix
> of your output file implies it.
>
> > *[srt @ 0x7fd3b300ce00] Invalid stream specifier: s:0.2.*
>
> I assume the stream specifier parser used to just ignore the ".2", and
> it no longer does, and errors out instead.
>
> 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".
_______________________________________________
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".