[BUG] + file-sequence expansion picks the digit in the extension (clip001.mp4+ only processes clip001.mp4)

Aperta Adatta ai principianti
#2,478 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 7 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
62/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
cli

Direzione di ricerca

Il bug è in add_file_sequence in src/rust/src/parser.rs, che sceglie l'ultima cifra nell'intero nome del file, estensione inclusa. Riproducilo con il caso a due file clip001.mp4+ dell'issue e il controllo vid001.mov+, poi conferma quali cifre vengono scelte. Fatto significa che clip001.mp4+ viene espanso in ogni file numerato e solo le cifre prima dell'ultimo . vengono incrementate. Prima di iniziare, verifica che PR #2456 non modifichi questo codice di selezione delle cifre e conferma prima l'approccio con i maintainer.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

When an input name ends in +, add_file_sequence in src/rust/src/parser.rs is meant to expand a numbered sequence (clip001.mp4+ -> clip001.mp4, clip002.mp4, ...). It looks for the last digit anywhere in the filename, including the extension. For names like .mp4, .mp3, .m4a or .mp2, it picks the digit in the extension instead of the sequence number. It then searches for clip001.mp5, doesn't find it, and silently stops after the first file.

Steps to reproduce

  1. ffmpeg -f lavfi -i testsrc=duration=2:size=320x240:rate=25 -pix_fmt yuv420p clip001.mp4 && cp clip001.mp4 clip002.mp4
  2. ccextractor clip001.mp4+

Expected

Both clip001.mp4 and clip002.mp4 are processed, the same as ccextractor clip001.mp4 clip002.mp4.

Actual

Only clip001.mp4 is processed. The output shows Input: clip001.mp4, the exit code is 0, and there is no message about the missing sequence.

Control

ccextractor vid001.mov+ (with vid001.mov, vid002.mov, vid003.mov) correctly expands to all three files, so the expansion works when the extension has no digit.

Environment

  • Ubuntu, Linux 7.0.0-44
  • CCExtractor 0.96.5, built from commit 77daaddb (master)
  • Build: cmake src -DCMAKE_BUILD_TYPE=Release && make
  • Rust 1.99.1, GPAC 2.4.0 built from source

Related

#2402 (overflow panic on numbers above i32::MAX), #2456 (open PR for #2402) and #2403 (closed, unmerged). This issue is not the overflow bug. I read the full diffs of #2456 and #2403, and neither one touches the code that chooses which digits to increment, so as written they would not fix this. This report is about which digits are chosen, not how large the number can be. I searched upstream issues and PRs for "file sequence", "add_file_sequence", "sequence expansion" and "extension digit" and found no existing report of it.

Possible fix

Search for digits only before the last ., so the extension is ignored. I'm happy to work on this once the maintainers confirm, and can coordinate with #2456 since it...

Lingua principale
C
Stelle
919
Fork
604
Merge medio
13g 12h
PR unite (30g)
7

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di CCExtractor/ccextractor

Tutte le issue di CCExtractor/ccextractor

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.