Foliovision › Forums › FV Player › How to … › Batch video and splash image url replacement
-
-
Hello Bruno,
do you use the [fvplayer src="..."] shortcodes most of the time, or do you post the videos with editor? In that case they are stored in database and you can see all of them in wp-admin -> FV Player.
In the first case you can run search and replace using a plugin like Search Regex on post content.
In case of database you can just run search and replace on the wp_fv_player_videos database table, on the src, src1, src2 and splash columns. When we designed the database structure we were trying to keep it simple to let experienced users manipulate data with ease – in contrary to the WordPress Custom Post Types where and non-standard fields are just postmeta.
Please let us know if this did help, or if you need any further help.
Thanks,
MartinHi Martin,
Not sure what you call database. See screenshot.
Not sure i understood what you mean either. If it’s what you call database, (see screenshot) are you telling me that i have to replace urls in each player one by one ? Because that’s what i’m doing already. I was looking for a way to batch replace those urls with new url in a specific folder.
For example let’s say that video link in player is https://bunnycdn/the%sun%is%shining.mp4. It would be automatically replaced by url with the same filename https://digitalocean/bucket/the-sun-is-shing.mp4 in selected folder. As i wrote earlier i have thousands of videos, and replacing them one by one will take months. Furthermore let’s imagine that something crashes on hosting cloud, or company shuts down for any reason, my videos would not play for months ? I’m very satisfied with FV Player but if i have to replace urls 1 by 1 that’s a very big problem.
Media Cloud plugin allows to do this but images and videos are replaced everywhere on website except in FV players.Thanks
Regards
Hello Bruno,
wp-admin -> FV Player lists the players stored in database, but the actual database is the data storage which feeds all the information into your WordPress website.
Using a database tool like phpMyAdmin you can run relatively simple commands like this to replace all the source video paths in one easy step:
UPDATE wp_fv_player_videos SET src = REPLACE( src, 'https://bunnycdn-domain.com/', 'https://digitalocean-spaces-domain.com/bucket/' );
It’s easy to run, but it’s also easy to make a mistake, so I wonder if we could provide an easy to use function like this directly in FV Player together with some instructions to backup your website database before running such global search and replace.
Perhaps it could let you enter the source and target URL and show the preview of the changes by trying to load a single video from that new location to let you check if it plays. It would take a couple of days to get it done but it could be a nice tool for all the users.
Thanks,
MartinHello Martin,
i think you guys should provide an easy tool, could be a paid addon, that allows to batch replace urls, a tool that scans selected new cloud bucket and replaces all urls in FV database that contain the same words.
Example :
https://bunnycdn-domain.com/bucket/the%sun%is%shining.mp4
is automatically replaced by
by https://digitalocean-spaces-domain.com/bucket/the-sun-is-shining.mp4
because it recognized the words “the”+”sun”+”is”+”shining”
After 3 years of hard and fastidious repetitive work i’m starting to make a little money with my website, and i can’t afford having to start from scratch if something happens. And i’m sure i’m not the only one.
If you need a beta tester i can help you.
Thanks again Martin
Hello Bruno,
it seems to me we could build this using the wizard technology from FV Player Coconut. That way we could guide you through the process and avoid mistakes.
The first wizard step would only contain a description of what is going to happen. The seconds step would let you enter the URL part to replace – like https://bunnycdn-domain.com/bucket/
Then the third step would list the matching players making it easy for you to check what is going to change. There you could enter the new URL – to replace with: https://digitalocean-spaces-domain.com/bucket/
In fourth step you could check that same list of affected players in preview mode – already using that new URL and allowing you to test that it all appears properly.
Fifth step would only be a warning for you to backup the database or create site snapshot.
Sixth step would let you confirm the replacement.
Thanks,
MartinHello Bruno,
please reinstall FV Player from this ZIP file: https://github.com/foliovision/fv-wordpress-flowplayer/archive/3535016984-migration-wizard.zip
Then you will be able to click the button at wp-admin -> Settings -> FV Player Pro -> Tools -> Migration Wizard, at the top of the screen.
Once you run that you will be prompted for the part of URL to replace (https://bunnycdn-domain.com/bucket/) and the URL to replace with (https://digitalocean-spaces-domain.com/bucket/). It will provide a visual way of checking if the URLs are all right.
If this works fine for you we will make this tool part of the next release.
Thanks,
MartinHi Martin,
Someone has coded a plugin to allow me to show vast ads conditionally. (See attached file)
If i update FV Player, will it break the plugin ?
Thanks
Regards
Hello Bruno,
that is the FV Player VAST plugin, which is different from FV Player. So the FV Player upgrade won’t cause any change there.
I see that the filter for the global configuration parameters of FV Player VAST could be useful, so I added a new “fv_vast_conf” filter for the upcomming release. You can get it right now if you reinstall the FV Player VAST plugin. Then you would only have to rename that fv_flowplayer_vast_args_pre filter hook name in your custom plugin.
Thanks,
MartinHello Martin,
i get this error message when trying to update FV Player
Fatal error: Cannot redeclare fv_http_build_url() (previously declared in /var/www/html/website/wp-content/plugins/fv-wordpress-flowplayer/includes/extra-functions.php:62) in /var/www/html/website/wp-content/plugins/fv-wordpress-flowplayer-3535016984-migration-wizard/includes/extra-functions.php on line 62
Thanks
Hello Bruno,
when reinstalling the plugin please first deactivate and delete the current FV Player plugin you are using. WordPress will warn you that you might loose settings and data, but it’s not the case with our plugin, no settings now videos will be lost. Or you can just replace the plugin files via FTP.
That will avoid the error.
Thanks,
MartinHello Martin,
I tried to deactivate, delete and reinstall FV Player, but was unable to activate new version (see attached file)
I had to re-install a fresh version.Thanks
Regards
Hello Bruno,
please download a fresh copy of https://github.com/foliovision/fv-wordpress-flowplayer/archive/3535016984-migration-wizard.zip and it will work. There was a plugin conflict with FV Player Coconut.
Thanks,
MartinHello Martin,
sorry for my late reply but i had to re-organized my videos in order to fit your tool.
So i’ve tested it with a small folder containing 4 videos, and it works just great so far. When i will finish organizing my files i will test a larger folder.Thank you Martin for listening to customers. This tool might change my life lol. I’ll let you know if there’s a bug or if i have suggestions for improvements in future updates.
“Do you mean you moved some of them into a sub-folder to ensure the tool will only affect some of your videos?”
Exactly.
It might be nice maybe to add a check box on each line (with all boxes checked by default) for user to be able to choose which videos he wants to migrate. But that creates another problem: you can’t know afterwards which videos have been migrated and which ones haven’t. That’s why i had to re-organize files, which is not simple because on cloud or cdn storage moving file to another folder may break the link. It would be nice if the wizard knew which file of a folder have been migrated.
Thanks
Hello Bruno,
I like the checkbox idea, however how does it help if the wizard knows which files were migrated? If you would only choose to replace the URL of 50 out of 100 videos, then you could run the second time and select any of the remaining 50 videos on the old host. Even if it doesn’t remember anything about the past URL replacing.
Thanks,
MartinHello Martin,
I have the following error message with all migrated file from a folder.
Admin: Video Issues
Analysis of https://s3.wasabisys.com/engo3/JUILLET 2020/Sexy%20busty%20lactating%20colombian.mp4
Mime Type: binary/octet-stream
Format: isom
Duration: 00:30:02.01
Bitrate: 1725 kb/s
Video:
Stream #0:0(und): Video: h264 (High), yuv420p, 1280×720 [SAR 1:1 DAR 16:9], 1399 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
handler_name : Core Media Video
handler_name : Core Media Video
Audio:
Stream #0:1(und): Audio: aac (LC), 48000 Hz, stereo, fltp, 320 kb/s (default)
handler_name : Core Media Audio
Video meta data: moov-atom not found at the start of the file. Please move the meta data to the start of video, otherwise it might have a slow start up time when using Flash. Best if you make sure it’s truly an MP4 file and not ISOM.Bad mime type: Video served with a bad mime type binary/octet-stream! Some web browsers may experience playback issues in HTML5 mode (Internet Explorer 9 – 10). (show fix)
Enter your comment
Any idea how i can fix this ?
Thanks
Hello Bruno,
since that object storage on Wasabi is S3-compatible it really should have a way of setting the mime type properly for the videos. We have an article on that topic here: https://foliovision.com/player/video-hosting/secure-amazon-s3-guide/fix-amazon-mime-type
But as the notice says it’s only relevant in IE9 and 10. So perhaps we should no longer treat that as an error. I set it that way now, it will only show an orange warning.
Thanks,
MartinHello Bruno,
the Migration Wizard only helps you update the FV Player database tables, it doesn’t move any files. I added that to the wizard introduction page for the next FV Player release:
This wizard will help you change the domain where your videos are hosted if you are switching CDNs. First you enter the source URL to replace and then the destination URL. Then you see what video URLs you get.
Please note that:
* the wizard does not actually move any files
* it only updates the FV Player database tables, [fvplayer src="..."] shortcodes are not affectedThanks,
MartinHello,
i think you did not understand my question. It works well from a CDN to another CDN. But does it work from server storage to CDN ? For instance is it possible to replace this url
https://website.com/wp-content/uploads/2021/02/the-sun-is-shining.mp4
by that url
https://website.b-cdn.net/videos/the%sun%is%shining%.mp4
?
Thanks
Regards
Hello Bruno,
FV Player Migration Wizard only lets you do simple replacements. In your example you would have to replace:
1) First https://website.com/wp-content/uploads/2021/02/ with https://website.b-cdn.net/videos/ – this would have to be done for every month separately, it would be easier if you could keep that structure on the CDN too
2) The the “-” symbols with “%” – but perhaps our forums did change your URLs, although I do not see why – did you wanted to write %20 by chance? But this would replace any “-” symbol out there, in all the video paths. So it could break the videos which you didn’t move. Is this change necessary?
Thanks,
Martin