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

booksplit splits but doesn't tag #1195

Open
ttot1 opened this issue Sep 29, 2022 · 4 comments
Open

booksplit splits but doesn't tag #1195

ttot1 opened this issue Sep 29, 2022 · 4 comments

Comments

@ttot1
Copy link

ttot1 commented Sep 29, 2022

I’ve made sure to have installed all the requirements and have mimicked and compared my results with what I see in the video where Luke demonstrates the script https://www.youtube.com/watch?v=z_CcQhbwINU.

When I run the script with the following command:

sh .local/bin/booksplit.sh audiofile.m4a timecodes.txt

It seems to split the tracks but not tag them. The result is only a directory with the album name and .opus files, each named after a track in the album. But these are not the audio files the script is supposed to output, the script seems to ignore the inputted audio file, making an incomplete execution.

@appeasementPolitik
Copy link
Contributor

I could reproduce this, ffmpeg doesn't overwrite tags for .opus files but it does for other formats. If the tag is not set on the opus file, ffmpeg can set the tag, but not if it is already set to something else. A temporary solution is downloading the file to another format from yt-dlp or re-encoding the file to another format, but this seems like an ffmpeg issue. This also affects the tag script.

@kmj9
Copy link

kmj9 commented Dec 15, 2022

I have a bigger problem. I tried .m4a .webm .opus and always get an error

Invalid duration specification for ss: 00:00:00 {name of first chapter of playlist}

Do I missing somthing ?

@mr-sban
Copy link
Contributor

mr-sban commented Feb 26, 2023

Invalid duration specification for ss: 00:00:00 {name of first chapter of playlist}

Booksplit uses tabs rather than spaces. Replace all the spaces in the document with tabs and it'll work.

@emrakyz
Copy link
Contributor

emrakyz commented Apr 27, 2023

Because the "booksplit" script does not call the script "tag" to write the data. It can be added but I am not sure Luke wants that. So I won't open a PR for that, but I can share both modified scripts here as a workaround, if you need. I have modified the scripts and improved them a little bit, and can get this result now:

image

"tags.txt" looks like this (no tabs just space [HH:MM:SS title] )

00:00:00 The Fake Economy
00:01:09 Virgin antiwork Redditor vs. Chad Fox News
00:03:01 David Graeber's BS Jobs 00:06:08 An example of a BS job in the German military
00:08:09 How many people have fake jobs?

I have also fixed this error @kmj9 mentions I think: "Invalid duration..." but the error I got at first was for the ending of the video. My modification allows the script to process the last track without specifying an end time. So you won't get an error for the last file.

Instructions:

  • Prepare a tags.txt file (name can be whatever) | The format should be HH:MM:SS title

  • Then download your video using "yt-dlp x 'your_URL'"

  • Run the script: bookmark downloaded-file.webm tags.txt

  • Then you will get results like mine.

booksplit.txt Delete ".txt" and make it executable. Place it inside "~/.local/bin"

tag.txt

Luke also says something like "I don't know why we should use -nostdin option with ffmeg."

The reasons are:

  • Since the booksplit script reads user inputs like album/book title, artist/author, and publication year from the standard input, using -nostdin ensures that ffmpeg doesn't accidentally consume any of these inputs.

  • Disabling standard input for ffmpeg helps avoid potential issues where the script might hang or produce unexpected results due to unintended input being consumed by ffmpeg.

  • By using the -nostdin option, the script ensures that ffmpeg only processes the specified input files and doesn't interfere with the standard input used by the script itself.

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

5 participants