Manipulating Radio Recordings

Thanks. Just tested and working but slow, as people have said
It should be quite simple using a recmon.d script with chaseget and ffmpeg to run the audio extraction in parallel with the recording so that you could start listening via mp3 whilst it is still recording, transfer to another device would be possible a few seconds after recording completed.

Whether there is any real need for this is another matter!
 
I'll back that idea. Can't say I have a desperate need, but it sounds like a useful facility.
 
Try creating executable file /mod/etc/recmon.d/radio_mp3
Code:
#!/mod/bin/jimsh

source /mod/webif/lib/setup
require ts.class settings.class


if {[lindex $argv 0] ne "-start"} exit
set rfile [lindex $argv 1]
set ts [ts fetch "$rfile.ts"]
if {![$ts flag "Radio"]}  {exit}
set settings [settings]

set base [file rootname $rfile]
set shname [file tail $base]
set dir [file dirname $rfile]

sleep 60
puts "radio_mp3 Processing $shname"
flush stdout
set cmd [list chaseget $rfile.ts 0 | nice -n 19 ffmpeg -y -benchmark -v 0 -i pipe:0 -f mp3 -vn]

if {![[settings] audiomp3]} {
    lappend cmd -acodec copy
}
lappend cmd "${base}.mp3"

#puts "$cmd"
exec {*}$cmd

if {[system pkginst id3v2]} {
    puts [exec /mod/bin/id3v2 \
        --song "[$ts get title]" \
        --comment "[$ts get synopsis]" \
        --album "[$ts get channel_name]" \
        --year "[clock format [$ts get start] -format {%Y}]" \
        "${base}.mp3"]
}
puts "radio_mp3 Processed $shname"

It will automatically create mp3 file for all radio recordings as they are recorded with 1 minute time slip
(code based on the webif audio extraction option)

Very limited testing but could be made into a package if sufficient demand
 
Hi All,

Just came across this thread. I'm very aware that the radio that comes down from freeview is a MPEG 1 layer 2 so not technically mp3 (MPEG 1 layer 3). There are conflicting messages from different websites and people (apparently in the know) that MPEG 1 layer 2 files should have the extension .mp2. However, the humax won't display mp2 files when you try to view them in the audio media list via the tv, meaning you can't play them. The only supported extension it seems is mp3 (not even flac or wav show up!). but the is technically the wrong extensions isn't it?

My point is that external players (eg Chromecast) won't play humax mp3 file (without converting them on the fly or beforehand) as they are actually mp2 plus. Also there are problems with other music players / renderers (eg. BubbleUPnP) that won't currently look at the header of the file and only look at the extension to work out what format it is. Yes it will convert it but it has to download the whole file first and so with recordings that last 2-3 hours, it can mean you are waiting for a long time before it starts playing. This is using Samba and not DLNA as with DLNA I can tell mediatomb to convert it to wav on the fly and it will play but you don't have any ability to seek and I have a need to control permissions so a Samba network folder is the way to go with that.

Any thoughts on this - can the humax be made to to see mp2 files from the media player list?

Thanks

Rodp
 
Back
Top