request Please !
-
Hello , first of all i wanna thank you very much for this good plugin ,
and i really need your help with original file name ,after the FFMPEG encode finished i got 3 files
test.mp4 ( original )
test-360.mp4
test-custom.mp4what i need is adding 720 to the original file name like test.mp4 to something like test-720.mp4
is it possible ? if yes can you please tell me what i change ?
-
This topic was modified 8 years, 8 months ago by
momkin.
-
This topic was modified 8 years, 8 months ago by
-
I think this would be more complicated than it sounds. Unfortunately a lot of the fundamental processes of the plugin rely on the naming structure rather than metadata because when I started writing this plugin in 2010 I didn’t use the database to keep track of the additional encoded files. So changing the name of the original file to test-720.mp4 will send the plugin off looking for test-720-360.mp4 and test-720-custom.mp4. Are you using the plugin for playback on the front end or just for encoding videos?
Hi Kyle Gilman
thanks for your time and you reply i think you didn’t understand me
I’m only using the plugin for encoding the videos i don’t use it for playback or anything elsemy problem is I’m using nginx hls streaming so the files must ends with word like this
big_buck_bunny-720.mp4 (original)
big_buck_bunny-360.mp4
big_buck_bunny-custom.mp4now lets me make it more clear for you , the only thing i need to touch is the original file name i want to add a word before .mp4 extension like this
before
big_buck_bunny.mp4after
big_buck_bunny-720.mp4i don’t want to touch the 360 and custom files 🙂
i have noticed that when the original file encoding it added -fullres to the new file but after the encoding process finished the name changes back to the original file name which i don’t want to
can i change something to let him keep -fullres.mp4 even after the encoding finished ??
That’s why I asked if you were using the plugin for playback on the frontend. It’s a much simpler issue now that I know you’re not. I know you don’t want to touch the 360 and custom files, but my plugin’s video player would have been confused if you changed the name of the original file.
Will the original video file always be 720?
Hi
yes it must always added -720 to the original file name and keep it, so the nginx hls streaming can recognize the biterates automatically because it needs to be like thishttp://wordpress.to/hls/big_buck_bunny,-custom,-360,-720,.mp4.urlset/master.m3u8
-
This reply was modified 8 years, 7 months ago by
momkin.
Right, but will you ever be in a situation where your original video file is 1080 or 360 or 2160 or something other than 720?
Hi
the name doesn’t really matter it can be anything i just want to add in order for nginx to recognize the biterates by namesif the original name doesn’t have ending like -720 it won’t be loaded it will only load the -360 + -custom version
so that’s why i need the original file name to have unique word at the end like -720 or -1080 or anything
I think this will accomplish what you need. I’m not sure of the consequences for other functions in the plugin. On line 7837 in video-embed-thumbnail-generator.php, find this code
$new_filename = str_replace("-fullres", "", $encoded_filename);What that does is replace “-fullres” with nothing. If you just want to keep the “-fullres” in the file name, change it to
$new_filename = $encoded_filename;Or if you want to change it to “-720” or any other arbitrary text
$new_filename = str_replace("-fullres", "-720", $encoded_filename);-
This reply was modified 8 years, 7 months ago by
Kyle Gilman.
Hi
i think it didn’t works
after the encoding completed the file restored the original file namebig_buck_bunny.mp4
Oh, I see. That part of the code only applies when you’re changing formats (from webm to mp4 for example).
Try this instead. Line 7854
$new_filename = $original_filename;Change to
$new_filename = $encoded_filename;And change the next line
$new_url = $video_encode_queue[$video_key]['movieurl'];to
$new_url = str_replace('.mp4', '-fullres.mp4', $video_encode_queue[$video_key]['movieurl']);Very good , it worked now
thank you very much 🙂just one last question
is there an easy way to make the encoding priority like this
first : -360
second : -custom
finally : -fullresbecause right now it starts with -fullres
thanks again !
I think if you rearrange the sections of the $video_formats array that should sort things out.
Right before line 521
if ( !$return_replace && $options['replace_format'] != 'fullres' ) { unset($video_formats[$options['replace_format']]); }Add this
$new_video_format_keys_order = array( '1080', '720', 'mobile', 'custom_h264', 'webm', 'vp9', 'ogg', 'fullres' ); foreach ($new_video_format_keys_order as $key) { $new_video_formats[$key] = $video_formats[$key]; } $video_formats = $new_video_formats;-
This reply was modified 8 years, 7 months ago by
Kyle Gilman.
What do you mean by rearrange ?
i did what you asked me to do and i got this error at the top
Warning: array_key_exists() expects parameter 2 to be array, null given in /home/user/public_html/wp-content/plugins/video-embed-thumbnail-generator/video-embed-thumbnail-generator.php on line 1149
By the way after i encoded 3 more videos , the -fullres files just got disappeared
only -360 and -custom are exists 🙁
Hi
can you please fix this issue with rearrangeWarning: array_key_exists() expects parameter 2 to be array, null given in /home/user/public_html/wp-content/plugins/video-embed-thumbnail-generator/video-embed-thumbnail-generator.php on line 1149 ??
Yes, please be patient. I wrote those free customizations for you without testing them and I need to find some spare time to test and debug them.
-
This reply was modified 8 years, 7 months ago by
The topic ‘request Please !’ is closed to new replies.