{"id":22338,"date":"2021-04-26T18:45:42","date_gmt":"2021-04-26T18:45:42","guid":{"rendered":"http:\/\/compressing_resizing_and_optimizing_videos_in_laravel"},"modified":"2025-02-09T04:18:50","modified_gmt":"2025-02-09T12:18:50","slug":"compressing_resizing_and_optimizing_videos_in_laravel","status":"publish","type":"post","link":"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel","title":{"rendered":"Compressing, Resizing, and Optimizing Videos in Laravel"},"content":{"rendered":"<div class=\"wp-block-cloudinary-markdown \"><p>Videos are large media files\u2014in most cases, at least four times larger than images\u2014and are often created for ads, marketing campaigns, and instructional content to convey as much information as possible in a short time. Ensuring that <a href=\"https:\/\/cloudinary.com\/video_api\">videos<\/a> do not buffer all the time and that the user\u2019s data is protected from rapid consumption due to heavy page weight must be the modus operandi for all website builders and e-business owners.<\/p>\n<p>This is part of a series of articles about <a href=\"https:\/\/cloudinary.com\/guides\/web-performance\/video-optimization-why-you-need-it-and-5-critical-best-practices\">video optimization<\/a>.<\/p>\n<h2>Definition of Video Compression<\/h2>\n<p>Video compression is a method to reduce the data used to encode digital video content. This results in smaller storage requirements and lower transmission bandwidth requirements. It\u2019s essential to differentiate between video compression and <a href=\"https:\/\/cloudinary.com\/guides\/web-performance\/video-encoding-how-it-works-formats-best-practices\">video encoding<\/a>. While video compression can reduce the file size, it might impact the video quality. On the other hand, video encoding compresses video files without compromising quality.<\/p>\n<p>This article shows you how to optimize videos in Laravel.<\/p>\n<h2>Set Up a Laravel Project<\/h2>\n<p><strong>1.<\/strong> Install <a href=\"https:\/\/getcomposer.org\/\">Composer<\/a> and <a href=\"https:\/\/www.php.net\/manual\/en\/install.php\">PHP<\/a> on your development or production machine and then run this command:<\/p>\n<pre class=\"js-syntax-highlighted\"><span><code class=\"hljs shcb-wrap-lines\">composer create-project --prefer-dist laravel\/laravel video-optimization\n<\/code><\/span><\/pre>\n<p>Additionally, for advanced video compression techniques using Laravel, it\u2019s beneficial to install FFmpeg in your composer. FFmpeg is a widely recognized tool for processing multimedia data, enhancing the video compression and optimization processes.<\/p>\n<p><strong>2.<\/strong> Go to the <code>video-optimization<\/code> directory and rename the <code>env.example<\/code> file to <code>.env<\/code>.<\/p>\n<p><strong>3.<\/strong> Run the project with the command <code>php artisan serve<\/code>.<\/p>\n<p>Your Laravel project is now up and running.<\/p>\n<h2>Set Up Cloudinary\u2019s Laravel SDK<\/h2>\n<p>With Cloudinary, you can efficiently optimize media assets\u2014regardless of programming language. One reason is that, by default, Cloudinary automatically performs certain optimization steps on all transformed images. Plus, its integrated, fast-delivery capability through content delivery networks (CDNs) ensures that your images are seamlessly displayed on your viewers\u2019 devices.<\/p>\n<p>To enable video uploads and optimization with Cloudinary:<\/p>\n<ol>\n<li>\n<p><a href=\"https:\/\/cloudinary.com\/users\/register_free\">Sign up<\/a> for a free Cloudinary account, log in, and note your cloud name and API keys from the dashboard.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/image\/upload\/w_700,c_fill,f_auto,q_auto,dpr_2.0\/Web_Assets\/blog\/media_library.png\" alt=\"media library\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"1400\" height=\"899\"\/><\/p>\n<\/li>\n<li>\n<p>Install <a href=\"https:\/\/github.com\/cloudinary-labs\/cloudinary-laravel#installation\">Cloudinary\u2019s Laravel SDK<\/a>:<\/p>\n<\/li>\n<\/ol>\n<pre class=\"js-syntax-highlighted\"><code>composer require cloudinary-labs\/cloudinary-laravel\n<\/code><\/pre>\n<p><strong>Important:<\/strong> Be sure to follow the steps in the #Installation section. Publish the configuration file and add your Cloudinary credentials to the <code>.env<\/code> file of your app.<\/p>\n<h2>Set Up the Mechanics for Video Uploads<\/h2>\n<p><strong>1.<\/strong> Create a video-upload controller (<code>VideoUpload Controller<\/code>) in your project:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css shcb-wrap-lines\"><span class=\"hljs-selector-tag\">php<\/span> <span class=\"hljs-selector-tag\">artisan<\/span> <span class=\"hljs-selector-tag\">make<\/span><span class=\"hljs-selector-pseudo\">:controller<\/span> <span class=\"hljs-selector-tag\">VideoUploadController<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p><strong>2.<\/strong> Open the <code>VideoUploadController.php<\/code> file and add a method for displaying the upload form:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\"><span class=\"php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n<span class=\"hljs-keyword\">namespace<\/span> <span class=\"hljs-title\">App<\/span>\\<span class=\"hljs-title\">Http<\/span>\\<span class=\"hljs-title\">Controllers<\/span>;\n\n<span class=\"hljs-keyword\">use<\/span> <span class=\"hljs-title\">Illuminate<\/span>\\<span class=\"hljs-title\">Http<\/span>\\<span class=\"hljs-title\">Request<\/span>;\n\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">VideoUploadController<\/span> <span class=\"hljs-keyword\">extends<\/span> <span class=\"hljs-title\">Controller<\/span>\n<\/span>{\n    <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">showUploadForm<\/span><span class=\"hljs-params\">()<\/span>\n    <\/span>{\n        <span class=\"hljs-keyword\">return<\/span> view(<span class=\"hljs-string\">'upload'<\/span>);\n    }\n}\n<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p><strong>3.<\/strong> Create an <code>upload.blade.php<\/code> file in the <code>resources\/views<\/code> directory and populate the file with the code below:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\"><span class=\"hljs-meta\">&lt;!DOCTYPE <span class=\"hljs-meta-keyword\">html<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">html<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">head<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">meta<\/span> <span class=\"hljs-attr\">charset<\/span>=<span class=\"hljs-string\">\"utf-8\"<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">meta<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\">\"viewport\"<\/span> <span class=\"hljs-attr\">content<\/span>=<span class=\"hljs-string\">\"width=device-width, initial-scale=1\"<\/span>&gt;<\/span>\n\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">title<\/span>&gt;<\/span>Laravel Video Upload<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">title<\/span>&gt;<\/span>\n\n        <span class=\"hljs-comment\">&lt;!-- Fonts --&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">link<\/span> <span class=\"hljs-attr\">href<\/span>=<span class=\"hljs-string\">\"https:\/\/fonts.googleapis.com\/css?family=Nunito:200,600\"<\/span> <span class=\"hljs-attr\">rel<\/span>=<span class=\"hljs-string\">\"stylesheet\"<\/span>&gt;<\/span>\n\n        <span class=\"hljs-comment\">&lt;!-- Styles --&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">style<\/span>&gt;<\/span><span class=\"css\">\n            <span class=\"hljs-selector-tag\">html<\/span>, <span class=\"hljs-selector-tag\">body<\/span> {\n                <span class=\"hljs-attribute\">background-color<\/span>: <span class=\"hljs-number\">#fff<\/span>;\n                <span class=\"hljs-attribute\">color<\/span>: <span class=\"hljs-number\">#636b6f<\/span>;\n                <span class=\"hljs-attribute\">font-family<\/span>: <span class=\"hljs-string\">'Nunito'<\/span>, sans-serif;\n                <span class=\"hljs-attribute\">font-weight<\/span>: <span class=\"hljs-number\">200<\/span>;\n                <span class=\"hljs-attribute\">height<\/span>: <span class=\"hljs-number\">100vh<\/span>;\n                <span class=\"hljs-attribute\">margin<\/span>: <span class=\"hljs-number\">0<\/span>;\n            }\n\n            <span class=\"hljs-selector-class\">.full-height<\/span> {\n                <span class=\"hljs-attribute\">height<\/span>: <span class=\"hljs-number\">100vh<\/span>;\n            }\n\n            <span class=\"hljs-selector-class\">.flex-center<\/span> {\n                <span class=\"hljs-attribute\">align-items<\/span>: center;\n                <span class=\"hljs-attribute\">display<\/span>: flex;\n                <span class=\"hljs-attribute\">justify-content<\/span>: center;\n            }\n\n            <span class=\"hljs-selector-class\">.position-ref<\/span> {\n                <span class=\"hljs-attribute\">position<\/span>: relative;\n            }\n\n            <span class=\"hljs-selector-class\">.top-right<\/span> {\n                <span class=\"hljs-attribute\">position<\/span>: absolute;\n                <span class=\"hljs-attribute\">right<\/span>: <span class=\"hljs-number\">10px<\/span>;\n                <span class=\"hljs-attribute\">top<\/span>: <span class=\"hljs-number\">18px<\/span>;\n            }\n\n            <span class=\"hljs-selector-class\">.content<\/span> {\n                <span class=\"hljs-attribute\">text-align<\/span>: center;\n            }\n\n            <span class=\"hljs-selector-class\">.title<\/span> {\n                <span class=\"hljs-attribute\">font-size<\/span>: <span class=\"hljs-number\">84px<\/span>;\n            }\n\n            <span class=\"hljs-selector-class\">.links<\/span> &gt; <span class=\"hljs-selector-tag\">a<\/span> {\n                <span class=\"hljs-attribute\">color<\/span>: <span class=\"hljs-number\">#636b6f<\/span>;\n                <span class=\"hljs-attribute\">padding<\/span>: <span class=\"hljs-number\">0<\/span> <span class=\"hljs-number\">25px<\/span>;\n                <span class=\"hljs-attribute\">font-size<\/span>: <span class=\"hljs-number\">13px<\/span>;\n                <span class=\"hljs-attribute\">font-weight<\/span>: <span class=\"hljs-number\">600<\/span>;\n                <span class=\"hljs-attribute\">letter-spacing<\/span>: .<span class=\"hljs-number\">1rem<\/span>;\n                <span class=\"hljs-attribute\">text-decoration<\/span>: none;\n                <span class=\"hljs-attribute\">text-transform<\/span>: uppercase;\n            }\n\n            <span class=\"hljs-selector-class\">.m-b-md<\/span> {\n                <span class=\"hljs-attribute\">margin-bottom<\/span>: <span class=\"hljs-number\">30px<\/span>;\n            }\n        <\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">style<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">head<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">body<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"flex-center position-ref full-height\"<\/span>&gt;<\/span>\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"content\"<\/span>&gt;<\/span>\n                <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"title m-b-md\"<\/span>&gt;<\/span>\n                    Laravel File Upload\n                <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n                @if ($message = Session::get('success'))\n                    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"alert alert-success alert-block\"<\/span>&gt;<\/span>\n                        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">button<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"button\"<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"close\"<\/span> <span class=\"hljs-attr\">data-dismiss<\/span>=<span class=\"hljs-string\">\"alert\"<\/span>&gt;<\/span>\u00d7<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">button<\/span>&gt;<\/span>\n                            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">strong<\/span>&gt;<\/span>{{ $message }}<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">strong<\/span>&gt;<\/span>\n                    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n                @endif\n\n                <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"links\"<\/span>&gt;<\/span>\n                     <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">form<\/span> <span class=\"hljs-attr\">action<\/span>=<span class=\"hljs-string\">\"\/upload\"<\/span> <span class=\"hljs-attr\">method<\/span>=<span class=\"hljs-string\">\"POST\"<\/span> <span class=\"hljs-attr\">enctype<\/span>=<span class=\"hljs-string\">\"multipart\/form-data\"<\/span>&gt;<\/span>\n                        @csrf\n                        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"row\"<\/span>&gt;<\/span>\n\n                            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"col-md-6\"<\/span>&gt;<\/span>\n                                <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"file\"<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\">\"video\"<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"form-control\"<\/span>&gt;<\/span>\n                            <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n                            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"col-md-6\"<\/span>&gt;<\/span>\n                                <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">button<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"submit\"<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"btn btn-success\"<\/span>&gt;<\/span>Upload a Video<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">button<\/span>&gt;<\/span>\n                            <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n                        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n                    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">form<\/span>&gt;<\/span>\n                <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n            <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">body<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">html<\/span>&gt;<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>On a successful upload, the code above displays the form along with a confirmation message. Concurrently, the code posts the form data to an <code>\/upload<\/code> route in the <code>routes\/web.php<\/code> file.<\/p>\n<div class='c-callout  c-callout--inline-title c-callout--note'><strong class='c-callout__title'>Note:<\/strong> <p>You\u2019ll see the related code later in this post.<\/p><\/div>\n<p><strong>4.<\/strong> Go to the <code>routes\/web.php<\/code> directory and add two routes: one to display the form and the other to process the file upload:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\">Route::get(<span class=\"hljs-string\">'\/upload'<\/span>, <span class=\"hljs-string\">'VideoUploadController@showUploadForm'<\/span>);\nRoute::post(<span class=\"hljs-string\">'\/upload'<\/span>, <span class=\"hljs-string\">'VideoUploadController@storeUploads'<\/span>);\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Now reload the app and go to the <code>\/upload<\/code> route. This page is then displayed:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/image\/upload\/w_700,c_fill,f_auto,q_auto,dpr_2.0\/Web_Assets\/blog\/laravel_file_upload.png\" alt=\"Laravel File upload\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"1400\" height=\"890\"\/><\/p>\n<h2>Compress and Resize Videos on Upload<\/h2>\n<p>Create an  <code>upload<\/code> method in the <code>VideoUploadController.php<\/code> file to ensure that compression and resizing of user-uploaded images occur by default <strong>on upload<\/strong>.<\/p>\n<p>The code below resizes a video to 350 pixels in width and 200 pixels in height:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\"><span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">upload<\/span><span class=\"hljs-params\">(Request $request)<\/span>\n<\/span>{\n\t $resizedVideo = cloudinary()-&gt;uploadVideo($request-&gt;file(<span class=\"hljs-string\">'video'<\/span>)-&gt;getRealPath(), &#91;\n            <span class=\"hljs-string\">'folder'<\/span> =&gt; <span class=\"hljs-string\">'uploads'<\/span>,\n            <span class=\"hljs-string\">'transformation'<\/span> =&gt; &#91;\n                      <span class=\"hljs-string\">'width'<\/span> =&gt; <span class=\"hljs-number\">350<\/span>,\n                      <span class=\"hljs-string\">'height'<\/span> =&gt; <span class=\"hljs-number\">200<\/span>\n             ]\n])-&gt;getSecurePath();\n\n\tdd($resizedVideo);\n} \n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<h2>Optimize Videos on Upload<\/h2>\n<p>To consistently deliver the highest-quality videos with the smallest file sizes, follow the steps below.<\/p>\n<h3>Quality<\/h3>\n<p>Compress and optimize the quality of a video file with the code below:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\"><span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">upload<\/span><span class=\"hljs-params\">(Request $request)<\/span>\n<\/span>{\n\t $compressedVideo = cloudinary()-&gt;upload($request-&gt;file(<span class=\"hljs-string\">'video'<\/span>)-&gt;getRealPath(), &#91;\n            <span class=\"hljs-string\">'folder'<\/span> =&gt; <span class=\"hljs-string\">'uploads'<\/span>,\n            <span class=\"hljs-string\">'transformation'<\/span> =&gt; &#91;\n                      <span class=\"hljs-string\">'quality'<\/span> =&gt; auto,\n     \t\t ]\n])-&gt;getSecurePath();\ndd($resizedVideo);\n} \n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Setting the <code>auto<\/code> value for the <code>quality<\/code> attributes automatically compresses and optimizes the video, balancing its visual quality. You can specify any of the <code>auto<\/code> options below:<\/p>\n<ul>\n<li>\n<code>q_auto<\/code>: The optimal balance between the file size and visual quality. By default, this algorithm is the same as <code>q_auto:good<\/code>.<\/li>\n<li>\n<code>q_auto:best<\/code>: A less aggressive algorithm that generates bigger files with potentially higher visual quality.<\/li>\n<li>\n<code>q_auto:good<\/code>: An algorithm that ensures a relatively small file size with good visual quality.<\/li>\n<li>\n<code>q_auto:eco<\/code>: A more aggressive algorithm, which results in smaller files of slightly lower visual quality. Examples of the target audience are popular sites and social networks with heavy traffic.<\/li>\n<li>\n<code>q_auto:low<\/code>: The most aggressive algorithm, which results in the smallest files of low visual quality. Examples of the target audience are sites with thumbnail previews that link to higher-quality videos.<\/li>\n<\/ul>\n<p>As an illustration, here\u2019s the original, uncompressed video with a size of 8.3 MB:<\/p>\n<p><video\n      controls\n      muted\n      preload=\"none\"\n      class=\"c-transformed-asset c-transformed-asset--video\"\n      poster=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/video\/upload\/Web_Assets\/blog\/concatenatewithleaves.jpg\"\n      \n    >\n      <source src=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/video\/upload\/vc_h265\/Web_Assets\/blog\/concatenatewithleaves.mp4\" type=\"video\/mp4; codecs=hevc\">\n<source src=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/video\/upload\/vc_vp9\/Web_Assets\/blog\/concatenatewithleaves.webm\" type=\"video\/webm; codecs=vp9\">\n<source src=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/video\/upload\/vc_auto\/Web_Assets\/blog\/concatenatewithleaves.mp4\" type=\"video\/mp4\">\n<source src=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/video\/upload\/vc_auto\/Web_Assets\/blog\/concatenatewithleaves.webm\" type=\"video\/webm\">\n    <\/video><\/p>\n<p>Here\u2019s the compressed version with a size of 5.9 MB:<\/p>\n<video controls=\"controls\" muted poster=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/video\/upload\/w_700,c_fill,f_auto,q_auto,dpr_2.0\/Web_Assets\/blog\/concatenatewithleaves.jpg\" src=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/video\/upload\/q_auto\/Web_Assets\/blog\/concatenatewithleaves.mp4\">\n<\/video>\n<p>Visually, there\u2019s almost no difference between the two videos even though the second one is only slightly more than half the size of the first one.<\/p>\n<h3>Format<\/h3>\n<p>Compress and optimize the video file by selecting the best video format for delivery on the client:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\"><span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">upload<\/span><span class=\"hljs-params\">(Request $request)<\/span>\n<\/span>{\n\t $compressedVideo = cloudinary()-&gt;upload($request-&gt;file(<span class=\"hljs-string\">'video'<\/span>)-&gt;getRealPath(), &#91;\n            <span class=\"hljs-string\">'folder'<\/span> =&gt; <span class=\"hljs-string\">'uploads'<\/span>,\n            <span class=\"hljs-string\">'transformation'<\/span> =&gt; &#91;\n                      <span class=\"hljs-string\">'fetch_format'<\/span> =&gt; auto,\n     \t\t ]\n])-&gt;getSecurePath();\n\ndd($resizedVideo);\n} \n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Setting <code>fetch_format<\/code> to <code>auto<\/code> instructs Cloudinary to deliver the best format that saves bandwidth and to optimize delivery time by selecting the appropriate format and codec based on the browser or client that requests the video. For instance, Chrome would attempt to deliver a VP9-encoded WebM file; Safari, an HEVC-encoded MP4 file. Other browsers would attempt to deliver an H.264-encoded MP4 file, especially if they don\u2019t support the first two types of video encoding that work on Chrome and Safari.<\/p>\n<h2>Optimize Videos on Streaming<\/h2>\n<p>You can continuously optimize video quality during streaming with the adaptive bitrate (ABR) delivery technique, which adjusts the quality of a video stream in real time according to the detected bandwidth and CPU capacity. That way, videos can start faster with fewer buffering interruptions and with the highest quality for the current device and network connection, resulting in an optimal user experience.<\/p>\n<p>Furthermore, Cloudinary can automatically generate and deliver all those files from a single original video, transcoded to either or both of these two protocols:<\/p>\n<ul>\n<li>HTTP Live Streaming (HLS)<\/li>\n<li>Dynamic Adaptive Streaming over HTTP (MPEG-DASH)<\/li>\n<\/ul>\n<p>For details on how to optimize videos with the ABR technique, see the <a href=\"https:\/\/cloudinary.com\/documentation\/adaptive_bitrate_streaming\"><em>Cloudinary Adaptive Streaming Guide<\/em><\/a>.<\/p>\n<h2>Understanding Video Compression Formats<\/h2>\n<p>Apart from the methods of compressing videos, it\u2019s pivotal to understand the various video compression formats available. Some of the common formats include Advanced Video Coding (MPEG-4 AVC), <a href=\"https:\/\/cloudinary.com\/glossary\/divx-file\">DivX<\/a>, MP4, AVI, and WMV. Each format has its unique advantages, depending on the use case and the type of media player or device being used for playback.<\/p>\n<p>Related content: Read our guide to <a href=\"https:\/\/cloudinary.com\/guides\/video-formats\/h-264-video-encoding-how-it-works-benefits-and-9-best-practices\">h264 video encoding<\/a>.<\/p>\n<h2>Leverage More Cloudinary Capabilities<\/h2>\n<p>Cloudinary helps you administer the entire spectrum of your media\u2019s lifecycle, end to end, from upload and transformation to optimization and delivery. Do <a href=\"https:\/\/www.cloudinary.com\">check it out<\/a>.<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":41,"featured_media":22339,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_cloudinary_featured_overwrite":false,"footnotes":""},"categories":[1],"tags":[25,263,303,305],"class_list":["post-22338","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-asset-management","tag-sdk","tag-video","tag-video-api"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.6 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Compressing, Resizing, and Optimizing Videos in Laravel<\/title>\n<meta name=\"description\" content=\"Enhance performance with Laravel and Cloudinary by compressing, resizing, and optimizing your site&#039;s videos on upload without losing their visual appeal.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Compressing, Resizing, and Optimizing Videos in Laravel\" \/>\n<meta property=\"og:description\" content=\"Enhance performance with Laravel and Cloudinary by compressing, resizing, and optimizing your site&#039;s videos on upload without losing their visual appeal.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel\" \/>\n<meta property=\"og:site_name\" content=\"Cloudinary Blog\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-26T18:45:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-09T12:18:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1649719155\/Web_Assets\/blog\/video-in-laravel_2233990daa\/video-in-laravel_2233990daa-png?_i=AA\" \/>\n\t<meta property=\"og:image:width\" content=\"1540\" \/>\n\t<meta property=\"og:image:height\" content=\"847\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"NewsArticle\",\"@id\":\"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel#article\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel\"},\"author\":{\"name\":\"\",\"@id\":\"\"},\"headline\":\"Compressing, Resizing, and Optimizing Videos in Laravel\",\"datePublished\":\"2021-04-26T18:45:42+00:00\",\"dateModified\":\"2025-02-09T12:18:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel\"},\"wordCount\":7,\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649719155\/Web_Assets\/blog\/video-in-laravel_2233990daa\/video-in-laravel_2233990daa.png?_i=AA\",\"keywords\":[\"Asset Management\",\"SDK\",\"Video\",\"Video API\"],\"inLanguage\":\"en-US\",\"copyrightYear\":\"2021\",\"copyrightHolder\":{\"@id\":\"https:\/\/cloudinary.com\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel\",\"url\":\"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel\",\"name\":\"Compressing, Resizing, and Optimizing Videos in Laravel\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649719155\/Web_Assets\/blog\/video-in-laravel_2233990daa\/video-in-laravel_2233990daa.png?_i=AA\",\"datePublished\":\"2021-04-26T18:45:42+00:00\",\"dateModified\":\"2025-02-09T12:18:50+00:00\",\"description\":\"Enhance performance with Laravel and Cloudinary by compressing, resizing, and optimizing your site's videos on upload without losing their visual appeal.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel#primaryimage\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649719155\/Web_Assets\/blog\/video-in-laravel_2233990daa\/video-in-laravel_2233990daa.png?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649719155\/Web_Assets\/blog\/video-in-laravel_2233990daa\/video-in-laravel_2233990daa.png?_i=AA\",\"width\":1540,\"height\":847},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudinary.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Compressing, Resizing, and Optimizing Videos in Laravel\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"name\":\"Cloudinary Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudinary.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\",\"name\":\"Cloudinary Blog\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"width\":312,\"height\":60,\"caption\":\"Cloudinary Blog\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Compressing, Resizing, and Optimizing Videos in Laravel","description":"Enhance performance with Laravel and Cloudinary by compressing, resizing, and optimizing your site's videos on upload without losing their visual appeal.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel","og_locale":"en_US","og_type":"article","og_title":"Compressing, Resizing, and Optimizing Videos in Laravel","og_description":"Enhance performance with Laravel and Cloudinary by compressing, resizing, and optimizing your site's videos on upload without losing their visual appeal.","og_url":"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel","og_site_name":"Cloudinary Blog","article_published_time":"2021-04-26T18:45:42+00:00","article_modified_time":"2025-02-09T12:18:50+00:00","og_image":[{"width":1540,"height":847,"url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1649719155\/Web_Assets\/blog\/video-in-laravel_2233990daa\/video-in-laravel_2233990daa-png?_i=AA","type":"image\/png"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel#article","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel"},"author":{"name":"","@id":""},"headline":"Compressing, Resizing, and Optimizing Videos in Laravel","datePublished":"2021-04-26T18:45:42+00:00","dateModified":"2025-02-09T12:18:50+00:00","mainEntityOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel"},"wordCount":7,"publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649719155\/Web_Assets\/blog\/video-in-laravel_2233990daa\/video-in-laravel_2233990daa.png?_i=AA","keywords":["Asset Management","SDK","Video","Video API"],"inLanguage":"en-US","copyrightYear":"2021","copyrightHolder":{"@id":"https:\/\/cloudinary.com\/#organization"}},{"@type":"WebPage","@id":"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel","url":"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel","name":"Compressing, Resizing, and Optimizing Videos in Laravel","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel#primaryimage"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649719155\/Web_Assets\/blog\/video-in-laravel_2233990daa\/video-in-laravel_2233990daa.png?_i=AA","datePublished":"2021-04-26T18:45:42+00:00","dateModified":"2025-02-09T12:18:50+00:00","description":"Enhance performance with Laravel and Cloudinary by compressing, resizing, and optimizing your site's videos on upload without losing their visual appeal.","breadcrumb":{"@id":"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel#primaryimage","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649719155\/Web_Assets\/blog\/video-in-laravel_2233990daa\/video-in-laravel_2233990daa.png?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649719155\/Web_Assets\/blog\/video-in-laravel_2233990daa\/video-in-laravel_2233990daa.png?_i=AA","width":1540,"height":847},{"@type":"BreadcrumbList","@id":"https:\/\/cloudinary.com\/blog\/compressing_resizing_and_optimizing_videos_in_laravel#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudinary.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Compressing, Resizing, and Optimizing Videos in Laravel"}]},{"@type":"WebSite","@id":"https:\/\/cloudinary.com\/blog\/#website","url":"https:\/\/cloudinary.com\/blog\/","name":"Cloudinary Blog","description":"","publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudinary.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/cloudinary.com\/blog\/#organization","name":"Cloudinary Blog","url":"https:\/\/cloudinary.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","width":312,"height":60,"caption":"Cloudinary Blog"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":""}]}},"jetpack_featured_media_url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649719155\/Web_Assets\/blog\/video-in-laravel_2233990daa\/video-in-laravel_2233990daa.png?_i=AA","_links":{"self":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/22338","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/comments?post=22338"}],"version-history":[{"count":14,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/22338\/revisions"}],"predecessor-version":[{"id":36764,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/22338\/revisions\/36764"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media\/22339"}],"wp:attachment":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media?parent=22338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/categories?post=22338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/tags?post=22338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}