• The forum software that supports hummy.tv will be upgraded to XenForo 2.3 on Wednesday the 20th of November 2024 starting at 7pm

    There will be some periods where the forum is unavailable, please bear with us. More details can be found in the upgrade thread.

Sweeper rule to rename file extension

rodp

Member
HI All,

Is there a way / are there any extra command lines that could be used to rename a file from mp3 to mp3L2 within sweeper. I was hoping the rename function would do it but perhaps I'm not using it correctly. I did have another idea which was to use Sweeper to create the mp3 file itself - in that case, what would the extra options I'd need to add into the box to make the file extension .mp3L2


I referred to the Wiki page to see what tokens there were but when testing / running it doesn't seem to pick up the files. (could we get a "?" at the side linking to this wiki page? https://wiki.hummy.tv/wiki/Sweeper)

1606817915694.png

this is the report
1606818018936.png

these are the files waiting to be renamed. I hope the reply isn't going to be the sweeper rules only work on .ts files!!
1606818174035.png


Alternate idea: extract to mp3 using sweeper - what would the options be to extract and rename to an extension of '.mp3L2'?
1606817398513.png


Thanks

Rodp
 

Attachments

  • 1606817354893.png
    1606817354893.png
    62 KB · Views: 2
Basicly Sweeper works on recordings not files
Rename is intended for working on a complete set of files for a recording - not a single file

Sweeper extensions to allow arbitrary commands have been oft proposed, but never implemented
 
rename a file from mp3 to mp3L2 within sweeper. I was hoping the rename function would do it but perhaps I'm not using it correctly.
That's well outside anticipated requirements. The rename function is only for the main part of the filename, and applies to the whole set of files which comprise a recording.

As a special fix, it wouldn't be difficult to run a script periodically to rename any .mp3 it finds in a specific folder to .mp3l2 (or whatever you want). Even I can do that, with my limited coding knowledge.

Out of interest, what is this for? I've never come across .mp3l2 before (although the meaning is obvious). MP3 level II is usually called MP2.

For information, the quick extraction of audio (from a StDef recording) produces MP2 (even if the file is labelled .mp3), whereas setting slow extraction (in WebIF >> Settings) performs proper conversion to MP3.
 
Is there a way / are there any extra command lines that could be used to rename a file from mp3 to mp3L2 within sweeper.
From your screenshots and your desire to have them labelled as some form of MP2, these "MP3" files are being produced by having Auto-audio enabled.
If you do rename them, all other things remaining unaltered, after a rename those files will be recreated again with the MP3 extension., and then the rename would try to rename those and cause a clash with the first version that was renamed. Or do you have a work around for that?
 
Last edited:
Out of interest, what is this for? I've never come across .mp3l2 before (although the meaning is obvious). MP3 level II is usually called MP2.

We've been here before Black Hole... I use a chromecast to play recorded radio. The recordings are too long (2-3hours) for the slow extraction option to MP3 Layer III to complete in the time that the box is normally awake (the conversion seems to restart from the beginning each time the system reboots if the file didn't complete). So I decided to keep to MP2. The problem is that Chromecast devices can't play MP2 so using Mediatomb I have create a new profile and if the file extension is mp3L2 (my personal choice of extension) then mediatomb will convert on the fly to wav and stream it to the chromecast. Works a treat. I'm just trying to automate the process rather than having to remember to rename all mp3 files. Perhaps the issue here is that could the fast audio extract method actually name the file MP2 instead of MP3? That would mean I wouldn't have to do all this renaming stuff.

Thanks

Rodp
 
From your screenshots and your desire to have them labelled as some form of MP2, these "MP3" files are being produced by having Auto-audio enabled.
If you do rename them, all other things remaining unaltered, after a rename those files will be recreated again with the MP3 extension., and then the rename would try to rename those and cause a clash with the first version that was renamed. Or do you have a word around for that?

I will have to test this out but I'm aware that the auto extraction will only work on .ts files and when I've moved the mp3 files I've not seen them recreated but I've not knowingly moved them within the week so this combined with an auto expire setting (set to 3 days), which then removed the .ts and it's associated files but leaves the mp3 files alone. Not moving the files until after 3 days might be the reason I'm not seeing the files be recreated or might there be a flag that confirms that extraction has occurred? Not sure, but if I use sweeper to do the task of conversion and deleting then moving (and renaming?) then that would stop any recreation I guess.

Thanks

Rodp
 
Perhaps the issue here is that could the fast audio extract method actually name the file MP2 instead of MP3?
The problem with that is many media players will happily play MP3 layer II .mp3 files (except my car audio!), but would not recognise a .mp2 extension. If your need is to have every .mp3 renamed .mp2, that is very simple to do either every boot or on a cron schedule.
 
The problem with that is many media players will happily play MP3 layer II .mp3 files (except my car audio!), but would not recognise a .mp2 extension. If your need is to have every .mp3 renamed .mp2, that is very simple to do either every boot or on a cron schedule.
Yes but, as I outlined in post #4, the Auto convert will then create a second MP£ of the same programme, which in turn may then cause issues when the rename tries to rename that second MP3 to MP2 as the MP2 already exists.
 
Yeah, but one could leave behind a zero-byte .mp3 placeholder and check for zero bytes in the script.
 
It sounds like the easiest route to a solution is find out what arguments / tokens I can use for sweeper when it performs the audio extraction and (hopefully) name it with .mp3L2 extension and then put a flag on it so that it doesn't do it again. Sweeper can do all that. I guess you'd need to tell ffmpeg to save it in the destination folder too as I assume sweeper won't move files other than .ts and it's associated files.

I'm assuming the audio extraction is ffmpeg based. Can you use ffmpeg arguments in the options box within sweeper?

Thanks

Rodp
 
I'm assuming the audio extraction is ffmpeg based. Can you use ffmpeg arguments in the options box within sweeper?
Yes, Not as far as I am aware
An opportunity to learn a bit of JIM code and poke around /mod/webif to find out where the conversion is taking place
 
Back
Top