WyattBlue / auto-editor

Auto-Editor: Efficient media analysis and rendering
https://auto-editor.com
The Unlicense
2.71k stars 402 forks source link

Can't set 'name' while exporting to premiere. "Error! variable [...] not found. Did you mean a string literal." #450

Closed krawieck closed 3 months ago

krawieck commented 4 months ago

Bug description

When trying to auto-edit a 3 minute video, and export to premiere it works fine. But when adding name="Your name here" to the command it gives an error: Error! variable `Your` not found. Did you mean a string literal.. I am using powershell.

Here is the command I tried:

PS C:\Users\[...]> auto-editor example.mp4 --export 'premiere:name="Your name here"'
Error! variable `Your` not found. Did you mean a string literal.

with --debug option enabled:

PS C:\Users\[...]> auto-editor example.mp4 --export 'premiere:name="Your name here"' --debug
Debug: Temp Directory: C:\Users\biers\AppData\Local\Temp\tmppm5blt90
Debug: Removed Temp Directory.
Traceback (most recent call last):
  File "C:\Users\biers\scoop\apps\python\current\Lib\site-packages\auto_editor\utils\cmdkw.py", line 107, in go
    results = interpret(env, Parser(Lexer(build.name, text)))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\biers\scoop\apps\python\current\Lib\site-packages\auto_editor\lang\palet.py", line 1851, in interpret
    result.append(my_eval(env, parser.expr()))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\biers\scoop\apps\python\current\Lib\site-packages\auto_editor\lang\palet.py", line 1555, in my_eval
    raise MyError(
auto_editor.lib.err.MyError: variable `Your` not found. Did you mean a string literal.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\biers\scoop\apps\python\current\Scripts\auto-editor.exe\__main__.py", line 7, in <module>
  File "C:\Users\biers\scoop\apps\python\current\Lib\site-packages\auto_editor\__main__.py", line 332, in main
    edit_media(paths, ffmpeg, args, temp, log)
  File "C:\Users\biers\scoop\apps\python\current\Lib\site-packages\auto_editor\edit.py", line 189, in edit_media
    output, export = set_output(args.output_file, args.export, src, log)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\biers\scoop\apps\python\current\Lib\site-packages\auto_editor\edit.py", line 44, in set_output
    export = parse_export(_export, log)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\biers\scoop\apps\python\current\Lib\site-packages\auto_editor\edit.py", line 147, in parse_export
    log.error(e)
  File "C:\Users\biers\scoop\apps\python\current\Lib\site-packages\auto_editor\utils\log.py", line 65, in error
    raise message
  File "C:\Users\biers\scoop\apps\python\current\Lib\site-packages\auto_editor\edit.py", line 143, in parse_export
    _tmp = parse_with_palet(text, parsing[name], {})
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\biers\scoop\apps\python\current\Lib\site-packages\auto_editor\utils\cmdkw.py", line 145, in parse_with_palet
    kwargs[_norm_name(attr.n)] = go(val, attr.contract)
                                 ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\biers\scoop\apps\python\current\Lib\site-packages\auto_editor\utils\cmdkw.py", line 109, in go
    raise ParserError(e)
auto_editor.utils.cmdkw.ParserError: variable `Your` not found. Did you mean a string literal.

What's your platform?

Python Version: 3.12.2 64-bit
Platform: Windows 11 amd64
FFmpeg Version: N-110322-g0c25da5a28-g1440bf15e2+1
FFmpeg Path: C:\Users\biers\scoop\persist\python\Lib\site-packages\ae_ffmpeg\Windows\ffmpeg.exe
Auto-Editor Version: 24w09a

What command did you use

auto-editor example.mp4 --export 'premiere:name="Your name here"'

What properties does your input video have?

auto-editor info .\example.mp4

.\example.mp4:
 - video:
   - track 0:
     - codec: h264
     - fps: 60
     - resolution: 1920x1080
     - aspect ratio: 16:9
     - pixel aspect ratio: 1
     - duration: 122.6
     - pix fmt: yuv420p
     - color range: tv

     - color space: bt709

     - color primaries: bt709

     - color transfer: bt709
     - timebase: 1/15360
     - bitrate: 2440947
     - lang: und
 - audio:
   - track 0:
     - codec: aac
     - samplerate: 44100
     - channels: 2
     - duration: 122.60136054421768
     - bitrate: 126913
     - lang: und
 - container:
   - duration: 122.623008
   - bitrate: 2580404

ffmpeg -hide_banner -i example.mp4

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'example.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf60.16.100
  Duration: 00:02:02.62, start: 0.010000, bitrate: 2580 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 2440 kb/s, 60 fps, 60 tbr, 15360 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc60.31.102 libx264
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 126 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
At least one output file must be specified

Comments

I suspect it has something to do with parsing. Also the video was downloaded using streamlink piped to ffmpeg

unsky559 commented 3 months ago

I have same issue here #446

WyattBlue commented 3 months ago

If you have this error, you are experiencing a skill issue. Learn the escape sequences for premiere:name="Your name here" in your shell.