Editing a file using FFMPEG on webif command line telnet / console, file permissions limited to owner

rodp

Member
Hi All,

I was just converting the audio of a mp4 file on my humax (it was 10Gb in size so thought it easier to do it on the machine as it was working at almost realtime speed. However upon createing the file, i discovered that the permissions were only set to owner (read and write) whilst group and public hadn't been set meaning that when trying to access it via Samba (to VLC or windows explorer from a windows 10 pc) it says I don't have permission.

Via Filezilla - this is the permissions of the original file I copied onto the humax
1677233555115.png

this is the converted file
1677233575642.png

is there a setting I need to change perhaps in the smb.conf file or do I have to remember to do some sort of chmod command after I do each file from running ffmpeg in the console window. (i did also use an abduco session so that I could close my window and come back to it but presume that wouldn't have impacted anything). I connect to the samba drive via the user settop, below is the settings on the smb.conf file

Code:
[Media2]
   comment = Media2
   path = /media/My Video
   public = no
   writable = yes
   guest ok = no
   browsable = yes
   create mask = 0644
   directory mask = 0755
   hide dot files = no
   valid users = settop

Part from the extra line 'guest ok' this resembles the standard [Media] one normally found above (albeit commented out)

So is it Samba or is it the process of creating the file via the console which is the problem.. or both!!

Thanks

Rodp
 
Everything we do on the HDR-FOX is at root, so I'm mystified, but it seems to me that setting "public = no" isn't the default and it should be "public = yes".
 
No Luck. All other files can be access fine without any changes to the smb.conf. I've tried a few different settings but still no luck. I even tried
Code:
force user = root
which then worked but that's probably not advisable. Perhaps now the file is written it doesn't matter what settings I try. I can play all the other files as per the original settings.

So it sounds like I'll have to change permissions. I tried to do it via filezilla but it doesn't work - as it says 'Response:500 Sorry, no such command'. Please could someone advise and provide an example of the CHMOD command so that I can have a go in the telnet window?

I did also wonder whether the 'create mask' setting is the problem as it's set to something other than 755 so when a file is created via the user it is assigned the wrong permissions, ie 600 as per filezilla screen shot below. However, this might be irrelevant as i ran ffmpeg via the webif terminal window, so that would be root user wouldn't it?

Rather puzzling!

Thanks

Rodp

In filezilla it says 600 which I assume is dependent on the permissions ticked.
1677287501590.png

Of a file that can be played over samba it is 755
1677287536827.png
 
it was 10Gb in size
I expect you mean 10 GB.
public = no
guest ok = no
These are aliases for the same thing, so there is no point having both.
I even tried
Code:
force user = root
which then worked but that's probably not advisable.
Actually, it seems like a reasonable solution to your problem.
Please could someone advise and provide an example of the CHMOD command so that I can have a go in the telnet window?
chmod 644 filename

Which Samba version are you running on the HDR?
 
ok, the CHMOD thing has helped - Thanks prpr.

Now I can delve a little further.... A new problem has materialised. It looks like the FFMPEG process
Code:
ffmpeg -i "23-02-02 CGS X Show - Bugsy.mp4" -c:v copy -acodec aac -b:a 196k "23-02-02 CGS X Show - Bugsy (AAC).mp4"
on the terminal window has not created a workable file and is hanging the humax every so often and when ever you try playing it on the tv, it freezes (on the media list) at the point of you starting to play it. It doesn't even show the first frame or say that it can't be played!

The original file works fine on both PC (via Samba) and on the tv (except that the humax says the audio won't play as the original audio is 'DVD LPCM Audio (lpcm)' hence the reason I converted it to AAC')

When there is a bad mp4 file, the Humax really doesn't like it and the humaxtv log message in the webif header plays up as it freezes pluf the redring remains red after a recording has finished (see pic). That means the humaxtv app has crashed again and the remote won't be responsive so the only way is to reboot via killing humaxtv PID from the terminal window or power cycling (the reboot option in the diagnostics webif page won't work as it still thinks it's recording). I get this all the time with MP4s, I wish the humax could handle mp4 better. I even have the problem with one that play actually play ok on the humax - their presence on the drive remains a problem - it would be great to know how to stop this from happening???

Back to the issue at hand, I will try converting the audio to mp3 but that might take some time but it's worth seeing if it that works better. Also I did do a test run of 10 seconds before I did the whole file and that did play ok on the humax so maybe when doing the full movie ffmpeg did have a problem and didn't complete. I will have to ask it to create a log next time.

Which Samba version are you running on the HDR?

It's 3.6.25-1 (beta version, Samba 2 as it were)

@prpr - i don't want to use force user = root as ultimately I'm wanting to shut down the DLNA (but keep content sharing up and running so that it decrypts) and control access via Samba as I can then control the parent folder etc. (Really interesting to see copying a file from the humax to my PC via samba is about 2MB/s tpday but via FTP it's about 8MB/s - both via wifi. Maybe it needs a reboot. I'll have to do some more testing on that otherwise that speed is not going to be quick enough for watching programs on multiple devices at the same time).

I'll come back after doing some more ffmpeg via the terminal window testing.

Thanks

Rodp

Rat Race recording ended many hours ago but because the mp4 file is corrupt - it's frozen the banner and the humtv process.
1677371575818.png

'top' showing humaxtv CPU is 118% ?!?! why is it above 100?!!
1677371685579.png
 
Last edited:
Update - I downloaded the edited AAC version of the file onto my PC and VLC message is showing this

1677371515254.png

so yeah - ffmpeg didn't do a good job when doing the full file.
 
and just a word on the network speed - playing the file from the humax via Samba to my PC is too slow as VLC is constantly increasing the cache. (this is after a reboot aswell). Other humax recorded based programs seem to be fine. Bitrate is about 7.5Mb/s which for a MP4 file is a little high. So I'll have to see if optimising the file a little helps say take it down to 1.2Mb/s (I do mean my lower case b in this instance as it's mega bits per second)



1677372212946.png

1677372311016.png
 
Maybe you're running into memory limitations? Are you running swapper?

1677539660362.png
yep.

My testing on the humax is not entirely a true test as the current ffmpeg build doesn't have h.264 encoding capabilities so trying 'mpeg4' as the codec. So far have tried converting 10 minutes but that failed - same messages on VLC. Tried just 60 seconds of video on the humax and that's worked fine - took a couple of hours though! So I think I can say that I'm just stuck with a badly cut video where someone has left it at a mahousive H.264 8Mb/s rate which the humax can't deploy via Samba at a fast enough rate AND i'm stuck with the humax not having enough power to covvert it.... so I will have to find 10GB or so space on my pc to then convert it after all! oh well - you win some you loose some.

Code:
fmpeg -i <filename> -c:v mpeg4 -b:v 2M -acodec aac -b:a 196k -v verbose -t 60 <filename>

Final thing - anyone figured out a way to stop the humax freezing when there are newly created mp4 files on the system (/media folder)? When this happens, my only choice is to power cycle or kill humaxtv. The problem is that, I have plenty of mp4 files on the HDD but it's new ones OR ones that are corupt (as in this case!) that appear to cause it to have an issue (that includes youtube-dl mp4 files).

After some time (and rebooting / power cycling numerous times as the remote or front panel doesn't respond) it does in the end seem to give up and ignore them - time will tell on this I guess but I'd rather be able to tell it to ignore them or ignore a specific folder in the first place.

USB stick I hear you say??? - maybe... but will youtube-dl save onto a usb stick straight off so that it doesn't touch the root folder? Samba access might also be a bit tricky then too.

Any thoughts most welcome.

Thanks

Rodp
 
My testing on the humax is not entirely a true test as the current ffmpeg build doesn't have h.264 encoding capabilities so trying 'mpeg4' as the codec. So far have tried converting 10 minutes but that failed - same messages on VLC. Tried just 60 seconds of video on the humax and that's worked fine - took a couple of hours though!
Waitaminute... you never said anything about trying to encode video! That's far too hard for the poor little HDR-FOX, even with swapper (which would be doing its nut and the reason for your 0.8% real time). Audio encoding is doable, I regularly transcode broadcast MP2 to proper MP3 and that runs at about 22% RT.
 
Waitaminute... you never said anything about trying to encode video!

I had to reduce the video bitrate down because there was stuttering playback via samba, (last resort - wouldn't normally convert video but needed to proove that ffmpeg on the system does work as expected and it was purley the mahousive video bitrate that was causing the issue). I've got to wait and see if this 'now-playable' mp4 file plays up and does the normal freezing but currently the humax is saying that it's playing the 10min version (which is corrupt) and it's likely to continue to do this until I reboot it.

Still looking for ideas on how to fix the freezing thing.

Thanks

Rodp
 
anyone figured out a way to stop the humax freezing when there are newly created mp4 files on the system (/media folder)?
Mine doesn't. I could speculate why yours does: thumbnail generation or DLNA indexing when accessing a corrupt .mp4.

I typically get .mp4s by download from iPlayer.
 
Hi Black Hole - could I possibly send you one of the files that causes a problem for you to see if it causes the same issue on your Humax?

Thanks

Rodp
 
For the benefit of other readers:

I have advised the OP he can prevent internal scanning baulking on "malformed" (for want of a better description) files by moving them out of My Video (to a separate folder under /mnt/hd2). This would normally make these files unavailable for playback (presuming they play at all), except the virtual-disk2 package provides the means to mount a folder as if it were a USB drive (and therefore accessible using the SUI via Media > Storage > USB).

The virtual-disk2 package presumes the folder to be mounted is /mnt/hd2/virtual_disk (and creates it if it does not exist), so either call the target folder that or edit /mod/etc/init.d/S89virtual-disk to your own requirements:

Code:
if [ -d /media/drive1/mod ]; then
    vdisk=/media/drive1/virtual_disk
else
    vdisk=/mnt/hd2/virtual_disk
fi

Line 2 (above) assigns the target folder for HD-FOX, line 4 assigns the target folder for HDR-FOX.

NB: Not tested.
 
Last edited:
Further to the above, there is another way (isn't there always?).

If the user were to set up an SMB share to the target non-My Video folder, then instead of modifying virtual-disk2 to access the folder, a share could be set up using network-shares-automount. This would result in the target folder appearing as a drive in Media > Storage > USB, and is possibly a cleaner way to do it (especially if NSA is already in use).
 
Back
Top