DLNA display more than just the name

rodp

Member
Hi All,

Is there a way, via the normal DLNA server my Humax HDR Fox T2 offers or Mediatomb to display more than just the name (that I presume if from some sort of metadata stored in the file header). For instance I record programs from the radio but when navigating through the Audio section of the DLNA (via my android UPNP player) I can only see the name of the show which doesn't include the date. Hence I don't know which is the newest / oldest. The filename is visible if you go by the directory route which thankfully includes the date but this isn't an option in other DLNA servers that I transfer files to, hence I'm hoping that what I figure out in the humax I can adopt to others (eg my ASUS RT n66u router).

Thanks in advance

Rodp
 
I do not use DLNA servers so I am guessing (dangerous) but I suspect that MediaTomb doesn't really understand the Humax .ts/.hmt file structure and so is only able to supply limited information (and the built in DLNA server chooses not to).

MediaTomb probably understands mp3 files better so what happens if you extract audio to MP3 - it would also reduce the file size significantly.
 
Hi MymsMan,

Forgot to say, they are already extracted MP3 files (left as MP2 though) that I've moved into the music folder.

Thanks

Rodp
 
The custom firmware uses the id3v2 program to add attribute to the mp3 file and only sets the recording year attribute
Code:
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"

It would be a fairly trivial change to append date and time to the song title.
Storing date and time as mp3 attributes seems more complex TDAT and TIME attributes were introduced in id3 v2.3 and replaced by TDRC in v2.4 so which tags should be set?
 
Hi MymsMan,

Thanks for the code. If the data is difficult would be possible to append the filename and add it to an existing field. My knowledge of ID3 tags are not very good but a quick google showed me it might be possible to do something offline as a one off: http://superuser.com/questions/1015239/put-date-modified-field-of-the-mp3-file-into-its-id3-tag. trouble is if you run this multiple times, would it add the info twice? It would be good for the humax to do this by itself but I do also have the need to run through all the existing files too.

Thanks

Rodp
 
I've kept out of this because I don't know what you're getting at. If you are saying you would like something like an info button to work through DLNA, I would say you are onto a hiding to nothing (unless you have already seen something else that works the way you would like, using DLNA as the communication mechanism). The server has to provide the information, and the client has to be able to use it.

My recommendation is that you try a different approach - eg the VLC app. I've not managed to make it work in iOS through SMB, but it has the features required to access a network using DLNA, FTP, or SMB, and therefore view the metadata for a media file as if it were stored locally (by FTP or SMB). The problem with Humax recordings is that the metadata isn't in the media file but stored in the sidecar files, which of course VLC doesn't understand.
 
Hi Black Hole,

Thanks for the reply. I'm talking about the ID3 tag in the MP3 file which I assume is created by the humax system when it extracts and creates the MP3 files from a ts file after the recording has finished. Is there a way to influence the information which is entered into the ID3 tags at time or creation? I've been using an android app UPNP which works relatively well in my setup. I've tried VLC app but it won't control another renderer like UPNP can so I was trying to make the ID3 tag more informative from UPNP by for example adding the full filename of MP3 file into the ID3 tag so that UPNP (and other DLNA apps / players) can display this (it doesn't have a SMB method available.... unless I figure out how to map a drive in a non rooted android which is most likely possible but a little cumbersome).

Hope that explains things

Thanks

Rodp
 
The Humax system doesn't create MP3 at all. You must be talking about the CF's extract audio option, therefore it's open to negotiation (according to how much it floats af's boat). Are you are using the slow conversion to proper MP3 or the fast conversion to MP2-in-an-MP3-wrapper?

I don't see any way the DLNA server is going to do anything with file content, only file properties.
 
Hi,

That's correct, I'm using the extract audio option. At the moment I've using the fast conversion as UPNP on my android can play MP2 but it needs must I could look into moving to proper MP3. If the date modified (in format yyyy-mm-dd) could be added to the title that would probably work and make it unique and identifiable in a DLNA client list.

Thanks

Rodp
 
The webif options to create mp2/ mp3 files use ffmpeg. If you select mp2 format, then the mp2 audio stream is copied from the (m2)ts file to an mp2 file (and renamed to mp3). To create a true mp3 file the audio is trancoded. This process could be modified to append the time and date directly but this would need a change to webif. You could rename the recordings manually in webif though.
Using ffmpeg from the command line it is possible to add and modify various id3 tags (see here) but I don't know what information the DLNA server passes to its clients.
Sweeper would seem to be you easiest option. You could set it up to append a timestamp to mp3 file titles. I am assuming that this is possible: can sweeper be used in this way for mp3 files?
 
I agree that timestamps are added to the actual filename but it's the ID3 tag that needs to be amended too too for I just see the same generic name in my DLNA client on my phone without this timestamp I'll add a picture when I get home tonight.
 
By default, all new recordings have timestamps appended to their titles. Does the mp3 conversion process remove this from the title? If not, job done.
Time stamp is part of the default file name, it is not part of the the default Title which is what is copied to the mp3 Song attribute
Recording time stamp is not, currently, copied to any mp3 attribute - only the year
 
ok, so can that be changed so that it does?

Thanks

Rodp
That depends on what you mean by that

If that is setting the mp3 time attributes
I would suggest you try (using a telnet session) the id3v2 command to see if setting the the mp3 time attributes is actually reflected in the display in your remote mp3 player.
(you might need to rebuild the dlna index as well)
If it is proved to work then AF123 might include it in the extract process

If that is modifying the recording title on the HUMAX prior to running audio extract you will need to look at Sweeper rules

If that is modifying the recording title on the MP3 whilst running audio extract you will need to look to ask AF123 nicely to update the extract process
Alternatively you could add the following file to mod/etc/recmon.d/radio_mp3 (and mark execuatble) which will auto extract all radio recording as they record.
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] [clock format [$ts get start] -format {%Y-%m-%d %H:%M}]" \
         --TDAT "[clock format [$ts get start] -format {%Y-%m-%d}]" \
        --comment "[$ts get synopsis]" \
        --album "[$ts get channel_name]" \
        --year "[clock format [$ts get start] -format {%Y}]" \
        "${base}.mp3"]
}
puts "radio_mp3 Processed $shname"
Updated to also set TDAT attribute - version of id3v2 on system does not support TDRC timestamp
 
Last edited:
Back
Top