Skip to content

Conversation

@izverev
Copy link

@izverev izverev commented Apr 8, 2021

I've try to use ffmpegfs as you write in README, but cue support still in development, docker support not working without fixes, and I know python better than C++. So I've add mp3 support same as Andreas, with creating temporary file via mp3splt.
I've changed, that virtual files always have .flac extension - now it takes from source file

Also fix situation when track have corrupted headers and Mutagen fails with Exception

this is my first pull request on github, so sorry if i'm wrong

@andresch
Copy link
Owner

andresch commented Apr 8, 2021

Hi izverev,

Thanks for the great contribution. I did not think about the use case of mp3 files that contain a full album. I was referring to ffmpegfs for transcoding flac/wav albums to mp3-tracks while splitting up. I think your solution fits nicely to trackfs and I'm mroe than happy to include it.

I did not find time to checkout out and test your code, but from quickly browsing your changes I believe you might have introduced a small bug: By now keeping the source-file extension from the original album file, wav-albums would now become wav-tracks. But since wav-tracks can't hold meta-data, trackfs compresses them into flac too. So the extension would in this case for have to remain .flac instead of .wav. Would you mind checking this?

I would also recommend to change version to 0.3.0. While your feature is not nessessarily a breaking change, it is still a significant addition that deserves a bigger version bump.

Let me know if you find time to do look into the topics. Otherwise I will try it myself, but this will take some time, as work currently doesn't leave me a lot of spare time.

Thanks again for your contribution
Andreas

@izverev
Copy link
Author

izverev commented Apr 8, 2021

Hi, Andreas

I was thinking about wav, but not checks if it will work with wav, because haven't such examples. I'm think you'r right and .wav virtual extension should be changed to .flac, I'll try to figure out, how to do it clearly

Also, unfortunately, I've catched some bugs with mp3splt while It works on my home server, so I need to test it little bit more
But I'm happy to realize, that you like my Idea

Btw, why you not use ffmpeg-python, as acenko did before?

@@ -0,0 +1,50 @@
# =================================
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you have to introduce a new dockerfile for local testing. Have you tried the Dockerfile.dev instead? Dockerfile.dev would allow you to do live editing while testing without the need to rebuild the docker image after every change.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried it, but I have some issues with it, I wasn't finding reasons why, also I need to start it in "production", and your Dokerfile depends on Pypi, so I've wrote my own)

I can remove it from pull request, If you want)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add some comments on how to use Docker.dev. Then we can decide if there is still a need for another one.

@andresch
Copy link
Owner

andresch commented Apr 8, 2021

Btw, why you not use ffmpeg-python, as acenko did before?

Two reasons:

  • I wanted to keep the container as small as possible (ffmpegfs is a quite huge package with tons of dependencies compared to flac)
  • I was hoping a would find a way to simply "extract" a track from an flac album without the need to re-encoding it as this would significantly increase the performance of trackfs. but unfortunately so far without success.

@izverev
Copy link
Author

izverev commented Apr 8, 2021

  • I wanted to keep the container as small as possible (ffmpegfs is a quite huge package with tons of dependencies compared to flac)

one more reason, why I'm not like ffmpegfs, also they use debian as base in Dockerfile and I built it more than half an hour..))

  • I was hoping a would find a way to simply "extract" a track from an flac album without the need to re-encoding it as this would significantly increase the performance of trackfs. but unfortunately so far without success.

Unfortunately, I don't think it's possible, to figure out it we should look into FLAC compression algorithm. Maby it can works with wav...

@andresch
Copy link
Owner

andresch commented Apr 8, 2021

Unfortunately, I don't think it's possible, to figure out it we should look into FLAC compression algorithm. Maby it can works with wav...

I browsed a bit through the FLAC spec and from what I believe I understood a stream gets compressed in multiple independent chunks. So it might be possible to reuse most chunks and only re-compress the first and last chuck around the split points. But as I could not find any ready to use tool that does this already and the overall complexity of the task was exceeding my "time-budget" for this hobby-project I did not further look into evaluating if this might work.

@izverev
Copy link
Author

izverev commented Apr 12, 2021

  • I've added FusePath.VEXTENSION dict for use virtual extensions
  • changed logic for subprocess.run from string to array arguments and removed shell=True to stdout=PIPE, it creates many problems with security (quotes in title, exclamation point and etc)
  • changed VERSION as asked before

TODO - rewrite wav extraction same as flac, maby refactor tags creation to separate function from TrackManager._extract_flac_track

Just start re-scanning all my music on Plex. will look if will be new bugs

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

Successfully merging this pull request may close these issues.

2 participants