{"action":"created","issue":{"url":"https://api.github.com/repos/PHP-FFMpeg/PHP-FFMpeg/issues/129","labels_url":"https://api.github.com/repos/PHP-FFMpeg/PHP-FFMpeg/issues/129/labels{/name}","comments_url":"https://api.github.com/repos/PHP-FFMpeg/PHP-FFMpeg/issues/129/comments","events_url":"https://api.github.com/repos/PHP-FFMpeg/PHP-FFMpeg/issues/129/events","html_url":"https://github.com/PHP-FFMpeg/PHP-FFMpeg/issues/129","id":43629652,"number":129,"title":"Frame and display aspect ratio","user":{"login":"bbaronSVK","id":2004936,"avatar_url":"https://avatars.githubusercontent.com/u/2004936?v=3","gravatar_id":"","url":"https://api.github.com/users/bbaronSVK","html_url":"https://github.com/bbaronSVK","followers_url":"https://api.github.com/users/bbaronSVK/followers","following_url":"https://api.github.com/users/bbaronSVK/following{/other_user}","gists_url":"https://api.github.com/users/bbaronSVK/gists{/gist_id}","starred_url":"https://api.github.com/users/bbaronSVK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbaronSVK/subscriptions","organizations_url":"https://api.github.com/users/bbaronSVK/orgs","repos_url":"https://api.github.com/users/bbaronSVK/repos","events_url":"https://api.github.com/users/bbaronSVK/events{/privacy}","received_events_url":"https://api.github.com/users/bbaronSVK/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-09-23T13:34:51Z","updated_at":"2015-11-25T08:57:10Z","closed_at":null,"body":"When you want to save Frame from video, where is SAR different from DAR output image is with wrong dimension.\r\n```\r\nInput #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/www/Storage/Upload/00003.mp4':\r\n  Metadata:\r\n    major_brand     : isom\r\n    minor_version   : 512\r\n    compatible_brands: isomiso2avc1mp41\r\n    encoder         : Lavf55.19.102\r\n  Duration: 00:01:32.92, start: 0.000000, bitrate: 3191 kb/s\r\n    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 45:34 DAR 40:17], 1067 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc\r\n    Metadata:\r\n      handler_name    : VideoHandler\r\n    Stream #0:1(und): Audio: dts (DTS-HD MA) (mp4a / 0x6134706D), 48000 Hz, 5.1(side), fltp, 1536 kb/s\r\n    Metadata:\r\n      handler_name    : SoundHandler\r\n```\r\nOutput dimension is 640x360 but not 847x360 as video.\r\nThis help me.\r\n```\r\nIndex: Frame.php\r\n===================================================================\r\n--- Frame.php\t(revision 94)\r\n+++ Frame.php\t(working copy)\r\n@@ -91,19 +91,21 @@\r\n          * might be optimized with http://ffmpeg.org/trac/ffmpeg/wiki/Seeking%20with%20FFmpeg\r\n          * @see http://ffmpeg.org/ffmpeg.html#Main-options\r\n          */\r\n-        if (!$accurate) {\r\n-            $commands = array(\r\n+\t\t$oDim = $this->getVideo()->getStreams()->videos()->first()->getDimensions();\r\n+\t\t$sRes = $oDim->getWidth() . 'x' . $oDim->getHeight();\r\n+\t\tif (!$accurate) {\r\n+\t\t\t$commands = array(\r\n                 '-y', '-ss', (string) $this->timecode,\r\n                 '-i', $this->pathfile,\r\n                 '-vframes', '1',\r\n-                '-f', 'image2'\r\n-            );\r\n+                '-f', 'image2', '-s', $sRes\r\n+\t\t\t);\r\n         } else {\r\n             $commands = array(\r\n                 '-y', '-i', $this->pathfile,\r\n                 '-vframes', '1', '-ss', (string) $this->timecode,\r\n-                '-f', 'image2'\r\n-            );\r\n+                '-f', 'image2', '-s', $sRes\r\n+\t\t\t);\r\n         }\r\n \r\n         foreach ($this->filters as $filter) {\r\n```"},"comment":{"url":"https://api.github.com/repos/PHP-FFMpeg/PHP-FFMpeg/issues/comments/159538551","html_url":"https://github.com/PHP-FFMpeg/PHP-FFMpeg/issues/129#issuecomment-159538551","issue_url":"https://api.github.com/repos/PHP-FFMpeg/PHP-FFMpeg/issues/129","id":159538551,"user":{"login":"smilemd","id":6599359,"avatar_url":"https://avatars.githubusercontent.com/u/6599359?v=3","gravatar_id":"","url":"https://api.github.com/users/smilemd","html_url":"https://github.com/smilemd","followers_url":"https://api.github.com/users/smilemd/followers","following_url":"https://api.github.com/users/smilemd/following{/other_user}","gists_url":"https://api.github.com/users/smilemd/gists{/gist_id}","starred_url":"https://api.github.com/users/smilemd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smilemd/subscriptions","organizations_url":"https://api.github.com/users/smilemd/orgs","repos_url":"https://api.github.com/users/smilemd/repos","events_url":"https://api.github.com/users/smilemd/events{/privacy}","received_events_url":"https://api.github.com/users/smilemd/received_events","type":"User","site_admin":false},"created_at":"2015-11-25T08:57:10Z","updated_at":"2015-11-25T08:57:10Z","body":"there is a DisplayRatioFixerFilter wich should solve your problem without editing original code.\r\n\r\njust use:\r\n\r\n$video->frame(\\FFMpeg\\Coordinate\\TimeCode::fromSeconds(5)->filters()->fixDisplayRatio();"}}