Really? I’m using FFMpeg through a Symfony Process and it is working great. It took a good bit of configuring but it worked. My only issue with Vimeo is that I’m not sure how much customization I can really do.
Well, currently I'm having users upload their video files directly to my server so that I can perform FFMpeg transformations on the videos. Is this a bad idea? Should I just upload directly to S3 and then have FFMpeg download them back for each transformation?
I've got to get some (potentially) very large files uploaded to my S3 bucket on a Laravel Job I am building out. I am getting the dreaded "Allowed memory size of ### bytes exhausted" error, and I have no interest in increasing the memory limit in php.ini (simply because I don't know how large some of these files will go, and at some point I need to quit running away from these large files by increasing memory_limit to ridiculous levels).
The question is: Does Laravel make chunking this thing easy? Is there a function I am not seeing that I can use?
I know the answer is probably no, but Laravel makes SO many things easy for me, I figured I might ask to see if I was missing something in my Google's.
If this does not exist in Laravel, what should I do? I know that I need to take the file into memory a chunk at a time, but I have no idea where to start on that.
I think you are on the right track, but I'll have to keep working on this one. I've got a lot going on in my model that needs to be wrangled haha
hunterhawley started a new conversation Access Relationship From Inside A Where Clause (or However I'm Supposed To Do This)
Hey y'all! Quick question this morning. I've got two tables: 'stats' and 'stat_metas'. 'stat_metas' holds all the 'meta' information about a stat, like its name, description, that stuff. 'stats' holds actual instances of stats, referenced back to stat_meta (each stat has one stat_meta, each stat_meta has many stats).
I have another model though called Game, where I am working with these two tables. (Game has many stats, you get the picture)
From Game, I am using this to pull the number of times a stat with the stat_meta id of 3 comes up:
$twosMade = $this->hasMany('App\Models\Stat', 'game_id')->where('stat', '3')->count();
Note: 'stat' (as in where('stat', '3')) is the column name in the 'stats' table that references the id on the stat_metas table)
However, instead of using the id from stat_meta, I would like to use the name of the stat. I want to do something like this, however this is obviously wrong:
$twosMade = $this->hasMany('App\Models\Stat', 'game_id')->where('stat->stat_meta->stat_name', '3')->count();
Does anyone have an idea of how this should be approached? I wish I had a visual or something to show, when explaining these Eloquent relationships and whatnot I get pretty confused at times.
@JOHNBRAUN - This actually helps a lot. There is a lot to unpack here, so it'll probably take me a bit before I get it running, but I'll post an update on here with any further questions! Thanks a lot John! Nice website too!
I am building a Laravel application where people upload videos of basketball games, and then stats are recorded. So, in the db, I've got a 'stat_metas' table where I store all the different types of basketball statistics (assists, 2 pointers made, etc). I also have a 'stats' table where I keep every recorded stat. Each record holds which "stat_meta" it was, which player did it, which game it happened in, etc.
Now, I am trying to display all of this data in a table, on both a per-game and per-team (teams have multiple games, so a per-team table would be all of the per-game data, aggregated) basis.
I also have some stats (like free throw percentage) that I had to calculate. I put each of those formulas in separate partial views and @included them (I now fear that was a bad idea, but you tell me).
Now, all of this 'worked' for both the calculated and added up stats, but then came time for me to add a totals row at the bottom of this table, and things got REAL messy, REAL quick, in part because I used the partial views I think.
Does anyone have any idea how I can make this work? Should I try using helper functions for each calculated stat?
@JOHNBRAUN - Hey John,
This is super helpful. Now the only questions I have are
How do I get $videos ready to send over to the job? Right now (I'm currently just processing this in the controller and now I am converting it) I can do $request->file('video_file'); and then just loop through each file with a foreach. I can't pass $request though, because I get an error that says "serialization of 'closure' is not allowed laravel job"
So, I could put something in the DB that says "in progress" while the video processing is happening, and then change it to "processed" once it is done? Basically what do you call to make something happen upon successful processing?
Thank you so much!
Hey there! I have been Googling around, and was surprised that I couldn't find the answer to this anywhere. I have a form that has a few text/integer fields, and one multi-select file field for videos. Currently, I've got code that will upload everything, put the text fields in the DB, then use FFMPEG to compress and combine every video into one concatenated larger video.
All of this works, my problem is that for any video larger than a minute or two, the FFMPEG process takes FOREVER. So, I've been watching the Laracasts about Queuing. I haven't found anything about how to pass $request data, and when I tried, I was told that serialization was not allowed for that. At this point, I just need to know how to pass my video objects to a job where they can be processed, so that the user doesn't have to sit there and wait. Any thoughts?
Another note on this, I used the $loop variable to assist in this, but I actually had to build an array of all my records first, then loop through again so that the one that came after whichever one I was on was already loaded.
@TRAY2 - Ohhhhhhhhh, wow. That is incredible actually. Thank you so much, this will help me in many more ways than just with this.
hunterhawley started a new conversation Order Records By Field, Get Record Before Or After Any Given
Hey y'all, I've got a model called 'Substitution", and it has a field called 'video_timestamp' which is an integer. I'm ordering them by this field, and cycling through them in a foreach in one of my views, but I would like to be able to get a field from a record that is one record after whichever one I am at in the foreach. For instance:
Record 1: 'video_timestamp' = 100, 'other_field' = 'hello'; Record 2: 'video_timestamp' = 230, 'other_field' = 'there'; Record 3: 'video_timestamp' = 600, 'other_field' = 'world';
So lets say in the foreach statement, I am currently at Record 2. I want to be able to access the 'hello' from Record 1. However, it isn't a given that the ID for Record 1 will be one fewer than Record 2's. So, I am trying to move around only in the orderBy('video_timestamp') list that I created in my controller. How might I go about doing this?
hunterhawley left a reply on How To Edit Invitation Table Upon User Registration?
Also, I can include any code that will help answer the question, but I think that because this has to do with performing an action as the user registers, my code will be useless to you to answer. I may be wrong though.
hunterhawley started a new conversation How To Edit Invitation Table Upon User Registration?
I have followed this tutorial (https://laraveldaily.com/laravel-auth-make-registration-invitation-only/) to create an invitation-only registration system on my application. I have been making my own modifications (for instance, I made it so that I could pre-fill as many or few of the fields as I liked when making the invitation), but I have a working system. There is however one major problem: the tutorial tells you to put a 'registered_at' field in the invitations table, but then never tells you how to fill it once the user registers. I only bring up the tutorial because it gives you an idea of what I based my system off of, I realize that you all can't provide support on someone else's article haha.
So basically, I have an invitations table. The only way a user can get to the register view is with a token that is found in that table. I could probably very easily pass that token to the register view if needed. Is there a way to edit the particular invitation's 'registered_at' field once the user uses it to register?