caydey / ffshare

An android app to compress image, video and audio files through ffmpeg before sharing them
GNU General Public License v3.0
615 stars 30 forks source link

Feature: embed chapters #98

Open Noitarud opened 4 months ago

Noitarud commented 4 months ago

Some media are long covering a wide variety of subjects, chapters can be handy if the player supports it.

Here is my personal how-to I use when I do it on my computer: Chapters: Extract the ffmetadata file to see what is here already: …-f ffmetadata FFMETADATAFILE; to apply: _…-i FFMETADAFILE -mapmetadata 1 -codec copy… . To replace? (following the ;FFM… heading, the global strings are TITLE= ARTIST= ENCODER=; Following these it reads "[Chapter]" and "[Stream]" sections. Each Chapter section to have [timebase=1/1000] _Start=_ns, _End=_ns _Title=_name, TB is milliseconds (not globalable), nanosec if missing, requires 4000000000 for 4s, suggest second to not overlap with first) else requires START=1984000000000, special characters (=,;,#,\,CR) must be escaped with a backslash_ (;#_ are comments, symbols such as …’“”/¹²³¼½¾§ are omitted even with \ (fract tested only).); Title=Chapter #1; do not place spaces on either side of the =.). Length limit may be 128 Characters (128th character has bug) though encountered shorter situations, not sure about escapes. (perhaps you can mark "\subchapter", but better to have chapter abbreviated: subchapter)

caydey commented 4 months ago

I'm a bit confused on what you are requesting, how would you imagine this being implemented, such as what settings options added

Noitarud commented 4 months ago

I did think to myself* that if I carry on sending things I would be implying you make a GUI front-end for the entirety of ffmpeg (so, appologies).

In the instructions I left myself, I would

  1. extract the metadata on chapters using ffmpeg.
  2. And then I would use a text editor
  3. and then I would run ffmpeg again to combine the files. The app's simple "select file" interface seems to imply I cannot merge multiple files, so I assumed I cannot include metadata either.

If you wanted to create an interface (inside a "customise file" menu, visible after reading in the file) that would tabulate and overwrite the chapter info, that would be up to you, but in allowing chapter customisation you would encourage users to organise themselves better.

*after suggesting the perspective correction thing(it seems to have disappeared if I had posted it).