Skip to content

Playground command parsing error #593

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

Open
tehfra opened this issue May 29, 2025 · 2 comments
Open

Playground command parsing error #593

tehfra opened this issue May 29, 2025 · 2 comments
Assignees
Labels
Type: Bug Bug or Bug fixes

Comments

@tehfra
Copy link

tehfra commented May 29, 2025

Commandline:

ffmpeg.exe -nostdin -analyzeduration 100M -probesize 100M -i "input_video.mkv" -vf "scale=-1:-1:flags=lanczos,pad=1920:1080:-1:-1,subtitles='subtitles.srt':stream_index=0:force_style='Fontname=Gotham Rounded Medium,Fontsize=17,Alignment=2,PrimaryColour=&Hffffff&,MarginV=25'" -sn -map 0:a:0 -map 0:v:0 -c:a aac -b:a 192k -ac 2 -c:v libx264 -crf 18 -preset slow -tune film -aq-strength 1.8 -mbtree 0 -pix_fmt yuv420p -y -hide_banner -loglevel error -stats -map_metadata -1 -map_chapters -1 "output_video.mp4"

Error:

Error parsing FFmpeg command: Unexpected token '#', "# Error: " is not valid JSON

@lucemia lucemia self-assigned this May 29, 2025
@lucemia lucemia added the Type: Bug Bug or Bug fixes label May 29, 2025
@lucemia
Copy link
Contributor

lucemia commented May 29, 2025

NOTE: need to support more complex filter syntax

https://ffmpeg.org/ffmpeg-filters.html#Filtergraph-syntax-1

A filterchain consists of a sequence of connected filters, each one connected to the previous one in the sequence. A filterchain is represented by a list of ","-separated filter descriptions.

A filtergraph consists of a sequence of filterchains. A sequence of filterchains is represented by a list of ";"-separated filterchain descriptions.

A filter is represented by a string of the form: [in_link_1]...[in_link_N]filter_name@id=arguments[out_link_1]...[out_link_M]

If an output pad is not labelled, it is linked by default to the first unlabelled input pad of the next filter in the filterchain. For example in the filterchain

@lucemia
Copy link
Contributor

lucemia commented May 29, 2025

@tehfra

Thanks for the report. The issue comes from two FFmpeg filtergraph rules that aren’t fully supported yet:

  1. Unlabeled pad linking:
    If an output pad is not labelled, it is implicitly linked to the first unlabelled input pad of the next filter.
  2. Filterchain definition:
    A filterchain consists of a sequence of connected filters, each one connected to the previous one. It’s represented by a list of comma-separated filter descriptions.

Our parser currently doesn’t handle these implicit connections correctly. We’ll work on adding proper support for these filterchain behaviors soon. Thanks again for your detailed example!

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

No branches or pull requests

2 participants