Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Invalid stream specifier" error with ffmpeg #185

Open
joel-porquet opened this issue Aug 29, 2023 · 0 comments
Open

"Invalid stream specifier" error with ffmpeg #185

joel-porquet opened this issue Aug 29, 2023 · 0 comments

Comments

@joel-porquet
Copy link

Hi,

I just tried using gnomecast and am encountering some errors with ffmpeg. Essentially, ffmpeg reports streams with specifiers that are then not accepted later as arguments.

When gnomecast runs ffmpeg the first time to get the different streams (video, audio, subtitles), it runs the following command: ffmpeg -i <filename> -f ffmetadata - -f mjpeg -vframes 1 -ss 27 -vf scale=600:-1 <thumbnail.png>.

Ffmpeg then prints a bunch of info, with lines such as: Stream #0:2[0x3](eng): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default).

Upon further processing, gnomecast keeps 0:2[0x3] as the stream specifier for this particular subtitle. The problem is that it is not a valid specifier for later ffmpeg commands:

$ ffmpeg -y -i <filename> -vn -an -map '0:2[0x3]' -codec srt <subtitle.srt>
...
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x559619c31e80] Invalid stream specifier: 2[0x3].
Last message repeated 9 times
Stream map '0:2[0x3]' matches no streams.

In that example, the correct stream specifier should be 0:2 (so with the hexadecimal number within the square brackets):

$ ffmpeg -y -i <filename> -vn -an -map '0:2' -codec srt <subtitle.srt>
...
Stream mapping:
  Stream #0:2 -> #0:0 (mov_text (native) -> subrip (srt))
...

I'm not sure why my ffmpeg prints this extra stream number in hexadecimal, and if there's maybe another option to give when using -f ffmetadata to avoid printing it. Or instead, if gnomecast needs to further process the stream specifier and remove this part of the specifier.

Can you please advise?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant