HD player with large files

I just realized that some of the videos I was planning on using with info-beamer may be larger than 4GB which is the maximum file allowed in the FAT32 file system that it recommends. Is there a workaround for having synchronized videos play that are larger than 4GB?

OK. Apparently I should have examined the SD card before posting. The installer creates a separate EXT4 partition for the files which should work well with my large files. Whew!

I suggest you just split up large files into smaller chunks of ~100MB. That’s way easier to handle than enormous files. Especially if you want synced playback. With one large file you might have to wait one complete cycle before you see anything at all. With a split video, it syncs at each cut.

Splitting is one ffmpeg call, so it’s not too complicated. If you need help, I could probably find the required command line arguments for that.

Good to know. This is a 2 hour long movie playing on the 2 screens, so I’ll have to try that out. Suggested ffmpeg options would be great!

I think something based on this stackoverflow response should work. You might play around with the segment_time value a bit to split into larger chunks. Let me know if that works.

I’m testing the ffmpeg invocation with my shorter test files and P2P and it is working really well. The videos start and then they sync up. Here is the invocation I used:

ffmpeg -i input.mp4 -c copy -map 0 -segment_time 30 -f segment output%03d.mp4

In related notes:

  1. How do I make a playlist to easily put all of these split files together?
  2. If I put assets in a folder, the filename is really hard to see on the setup menu of what assets will be played. Is there a way to widen the filename field?

If you’re comfortable with Python, a small snippet can automated the playlist creation for you:

import requests, re, json
from operator import itemgetter

# TODO: update these values for your account/setup
SETUP_ID = 12345
API_KEY = '???'

s = requests.Session()
s.auth = '', API_KEY

# fetch all assets from your account
r = s.get('https://info-beamer.com/api/v1/asset/list')
assets = r.json()['assets']

# Sort all assets by filename
assets.sort(key=itemgetter('filename'))

# create a playlist based on the assets
playlist = []
for asset in assets:
    # skip any asset not matching the required filename pattern
    if not re.match('^videos/.*mp4', asset['filename']):
        continue
    
    # create a playlist item based on the assets. See
    # https://github.com/info-beamer/package-hd-player/blob/master/node.json#L80-L98
    # to see the "shape" of each item.
    playlist.append({
        'file': asset['id'],
        'duration': asset['metadata']['duration']
    })  
    
# Update the HD Player based setup with the playlist
r = s.post('https://info-beamer.com/api/v1/setup/%d' % SETUP_ID,
    data = {
        'config': json.dumps({'': {'playlist': playlist}}),
        'mode': 'update',
    }   
)   
print(r.json())

This code basically fetches all assets from your account, sorts them, selects assets you want to use based on a regex and finally updates a “HD Player” based setup with the new playlist. To run this, just set your API_KEY and the ID of the target setup.

With regards to the UI layout: No easy solution. I just modified the HD player package so the UI for the asset file should be wider, but it doesn’t have any effect. I’ll look into that in the future.

I’m mostly curious how you even make a playlist. I couldn’t find it in the help or documentation.

You mean the playlists here: https://info-beamer.com/playlists? If so, I’m trying to get rid of that mis-feature for a while now because it was never really useful and I regret ever adding that to the website.

When you “assign” such a playlist to a setup with the UI, it basically does exactly what the Python snippet above does: It just adds items to a setup.

Ahhh. That would explain why I can’t find it in the help. No matter, the python and just doing a search with intelligent filenames is mostly good enough.

I discovered I forgot to reset the timestamps so my local vlc couldn’t play the segments.

ffmpeg -i input.mp4 -c copy -map 0 -segment_time 120 -f segment -reset_timestamps 1 output%03d.mp4

Worked better

Apparently my short test video (just a trailer) was different enough that I didn’t notice the problem until working with the real videos. The videos are not synchronized. This might be because the 120second chunks are not exactly 120 seconds nor are they exactly the same size. Does the synchronization look at the total time or some other mechanism to get synchronization working? Help!

If you use multiple setups, make sure that each playlist have the exact same total duration. Due to how synchronization works, even a tiny difference greatly adds up.

Is there an easy way to figure out a total playlist size (according to info-beamer)? The videos appeared to be the same size (before ffmpeg cutting) when opened in VLC. Once I have a bunch of videos, I’m not sure how to check the total time.
When I opened the playlists, they didn’t start anywhere near each other.
I’m a little lost as to how to debug this.

You could sum up the asset['metadata']['duration'] value in the script above. If they seem to start randomly, there is probably a minor difference somewhere. Let me know if that helps. If not, I can take a look.

Heh. I’ll try that eventually. I found a set of low-bitrate renders that below the 500MB size. I also discovered one video was off by 0.1sec, which would certainly make things worse.

That difference was the big problem. I used ffmpeg to trim it to exactly the same size:
ffmpeg -i inputfile.mp4 -c copy -ss 00:00:00 -t 00:27:00 outfile.mp4
This allowed me to then split it and everything sync’d up. Thank you for all your help.

Since I expect others may have the same problems, I’ve put scripts to automate some of this and put a pull request (which I see was accepted).

Thank you very much for that!