{"action":"created","issue":{"url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/3404","labels_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/3404/labels{/name}","comments_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/3404/comments","events_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/3404/events","html_url":"https://github.com/openframeworks/openFrameworks/issues/3404","id":48162980,"number":3404,"title":"ofVideoPlayer linux / Error on buffer size for some videos when setting OF_PIXELS_NATIVE","user":{"login":"PetrosKataras","id":1078053,"avatar_url":"https://avatars.githubusercontent.com/u/1078053?v=3","gravatar_id":"","url":"https://api.github.com/users/PetrosKataras","html_url":"https://github.com/PetrosKataras","followers_url":"https://api.github.com/users/PetrosKataras/followers","following_url":"https://api.github.com/users/PetrosKataras/following{/other_user}","gists_url":"https://api.github.com/users/PetrosKataras/gists{/gist_id}","starred_url":"https://api.github.com/users/PetrosKataras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PetrosKataras/subscriptions","organizations_url":"https://api.github.com/users/PetrosKataras/orgs","repos_url":"https://api.github.com/users/PetrosKataras/repos","events_url":"https://api.github.com/users/PetrosKataras/events{/privacy}","received_events_url":"https://api.github.com/users/PetrosKataras/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/openframeworks/openFrameworks/labels/bug","name":"bug","color":"b31d1d"},{"url":"https://api.github.com/repos/openframeworks/openFrameworks/labels/core","name":"core","color":"db6a1f"},{"url":"https://api.github.com/repos/openframeworks/openFrameworks/labels/linux","name":"linux","color":"27607f"},{"url":"https://api.github.com/repos/openframeworks/openFrameworks/labels/section-video","name":"section-video","color":"DDDDDD"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/openframeworks/openFrameworks/milestones/12","html_url":"https://github.com/openframeworks/openFrameworks/milestones/0.10.0","labels_url":"https://api.github.com/repos/openframeworks/openFrameworks/milestones/12/labels","id":264335,"number":12,"title":"0.10.0","description":"","creator":{"login":"bilderbuchi","id":327442,"avatar_url":"https://avatars.githubusercontent.com/u/327442?v=3","gravatar_id":"","url":"https://api.github.com/users/bilderbuchi","html_url":"https://github.com/bilderbuchi","followers_url":"https://api.github.com/users/bilderbuchi/followers","following_url":"https://api.github.com/users/bilderbuchi/following{/other_user}","gists_url":"https://api.github.com/users/bilderbuchi/gists{/gist_id}","starred_url":"https://api.github.com/users/bilderbuchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bilderbuchi/subscriptions","organizations_url":"https://api.github.com/users/bilderbuchi/orgs","repos_url":"https://api.github.com/users/bilderbuchi/repos","events_url":"https://api.github.com/users/bilderbuchi/events{/privacy}","received_events_url":"https://api.github.com/users/bilderbuchi/received_events","type":"User","site_admin":false},"open_issues":30,"closed_issues":10,"state":"open","created_at":"2013-02-11T12:18:09Z","updated_at":"2015-10-22T06:30:22Z","due_on":null,"closed_at":null},"comments":11,"created_at":"2014-11-08T11:10:22Z","updated_at":"2015-10-22T12:19:39Z","closed_at":"2015-10-22T06:30:22Z","body":"Hi,\r\n\r\nI am with latest master under xubuntu 14.04.\r\n\r\nIf I set the player to use the default pixel format I get this error with a video captured from a GoPro camera :\r\n\r\n[notice ] ofGstVideoPlayer: allocating with 860x646 I420\r\n[ error ] ofGstVideoUtils: buffer_cb(): error on new buffer, buffer size: 834632!= init size: 833340\r\n[ error ] ofGstUtils: gstHandleMessage(): embedded video playback halted for plugin, module qtdemux0  reported: GStreamer encountered a general stream error.\r\n[warning] ofGstUtils: didn't received EOS in 5s, closing pipeline anyway\r\n[ error ] ofGstVideoUtils: buffer_cb(): error on new buffer, buffer size: 834632!= init size: 833340\r\n[ error ] ofGstUtils: gstHandleMessage(): embedded video playback halted for plugin, module qtdemux1  reported: GStreamer encountered a general stream error.\r\n\r\nThis error does not appear if don't set the pixels to the default format and everything renders fine.\r\n\r\nIt also does not appear for the fingers.mov for example, even if I set the default format.\r\n\r\nIn addition it seems to me that this error is actually misleading, since if I force the player to render on the default format I will get a result that seems to me correct i.e the movie seems to render properly on the default colorspace .\r\n\r\nEDIT: Not sure about the above comment anymore since I just tried the programmable renderer to see if the colorspace conversion would work properly but it doesn't.. The video is being rendered like this:\r\n\r\n![testvideo](https://cloud.githubusercontent.com/assets/1078053/4964010/b12ca042-6742-11e4-9684-a8396f77125e.png)\r\n\r\nI am using the legacy gl renderer and not the programmable one . \r\n\r\nHere are some info of the video file that might be helpful:\r\n\r\nGeneral\r\nComplete name                            : test.mp4\r\nFormat                                   : MPEG-4\r\nFormat profile                           : Base Media / Version 2\r\nCodec ID                                 : mp42\r\nFile size                                : 265 MiB\r\nDuration                                 : 1mn 13s\r\nOverall bit rate                         : 30.1 Mbps\r\nEncoded date                             : UTC 2014-10-09 10:19:24\r\nTagged date                              : UTC 2014-10-09 10:19:28\r\n©TIM                                     : 00;00;00;00\r\n©TSC                                     : 2997\r\n©TSZ                                     : 50\r\n\r\nVideo\r\nID                                       : 1\r\nFormat                                   : AVC\r\nFormat/Info                              : Advanced Video Codec\r\nFormat profile                           : High@L5.1\r\nFormat settings, CABAC                   : Yes\r\nFormat settings, ReFrames                : 3 frames\r\nFormat settings, GOP                     : M=3, N=33\r\nCodec ID                                 : avc1\r\nCodec ID/Info                            : Advanced Video Coding\r\nDuration                                 : 1mn 13s\r\nSource duration                          : 1mn 13s\r\nBit rate                                 : 30.1 Mbps\r\nWidth                                    : 860 pixels\r\nHeight                                   : 646 pixels\r\nDisplay aspect ratio                     : 4:3\r\nFrame rate mode                          : Variable\r\nFrame rate                               : 59.940 fps\r\nMinimum frame rate                       : 59.940 fps\r\nMaximum frame rate                       : 60.000 fps\r\nStandard                                 : NTSC\r\nColor space                              : YUV\r\nChroma subsampling                       : 4:2:0\r\nBit depth                                : 8 bits\r\nScan type                                : Progressive\r\nBits/(Pixel*Frame)                       : 0.904\r\nStream size                              : 264 MiB (100%)\r\nSource stream size                       : 264 MiB (100%)\r\nLanguage                                 : English\r\nEncoded date                             : UTC 2014-10-09 10:19:24\r\nTagged date                              : UTC 2014-10-09 10:19:24\r\nColor primaries                          : BT.709\r\nTransfer characteristics                 : BT.709\r\nMatrix coefficients                      : BT.709\r\nmdhd_Duration                            : 73724\r\n"},"comment":{"url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/comments/150203453","html_url":"https://github.com/openframeworks/openFrameworks/issues/3404#issuecomment-150203453","issue_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/3404","id":150203453,"user":{"login":"aspeteRakete","id":1003846,"avatar_url":"https://avatars.githubusercontent.com/u/1003846?v=3","gravatar_id":"","url":"https://api.github.com/users/aspeteRakete","html_url":"https://github.com/aspeteRakete","followers_url":"https://api.github.com/users/aspeteRakete/followers","following_url":"https://api.github.com/users/aspeteRakete/following{/other_user}","gists_url":"https://api.github.com/users/aspeteRakete/gists{/gist_id}","starred_url":"https://api.github.com/users/aspeteRakete/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspeteRakete/subscriptions","organizations_url":"https://api.github.com/users/aspeteRakete/orgs","repos_url":"https://api.github.com/users/aspeteRakete/repos","events_url":"https://api.github.com/users/aspeteRakete/events{/privacy}","received_events_url":"https://api.github.com/users/aspeteRakete/received_events","type":"User","site_admin":false},"created_at":"2015-10-22T12:19:39Z","updated_at":"2015-10-22T12:19:39Z","body":"Wait a minute, wait a minute, wait a minute. This isn't done yet. I got another test video with 900x300. Which tells me:\r\n```\r\n[verbose] ofGstVideoUtils::process_sample: --------------------\r\n[verbose] ofGstVideoUtils::process_sample: GstVideoInfo: \r\n[verbose] ofGstVideoUtils::process_sample: gstmapinfo.size: 405600\r\n[verbose] ofGstVideoUtils::process_sample: gstmapinfo.maxsize: 405615\r\n[verbose] ofGstVideoUtils::process_sample: stride[0]: 900\r\n[verbose] ofGstVideoUtils::process_sample: stride[1]: 452\r\n[verbose] ofGstVideoUtils::process_sample: stride[2]: 452\r\n[verbose] ofGstVideoUtils::process_sample: width: 900\r\n[verbose] ofGstVideoUtils::process_sample: height: 300\r\n[verbose] ofGstVideoUtils::process_sample: offset[0]: 0\r\n[verbose] ofGstVideoUtils::process_sample: offset[1]: 270000\r\n[verbose] ofGstVideoUtils::process_sample: offset[2]: 337800\r\n[verbose] ofGstVideoUtils::process_sample: --------------------\r\n[verbose] ofGstVideoUtils::process_sample: ofPixels: \r\n[verbose] ofGstVideoUtils::process_sample: pixels.getTotalBytes(): 405000\r\n[verbose] ofGstVideoUtils::process_sample: pixels.width(): 900\r\n[verbose] ofGstVideoUtils::process_sample: pixels.height(): 300\r\n```\r\nSo here stride[0] is as you would expect, but the strides of U anv V are padded.\r\nTo get this going I needed to:\r\n1. uncomment [this](https://github.com/openframeworks/openFrameworks/blob/master/libs/openFrameworks/video/ofGstUtils.cpp#L1293) line\r\n\r\n[This](https://github.com/openframeworks/openFrameworks/blob/master/libs/openFrameworks/video/ofGstUtils.cpp#L1291) is not applicable for i420 anymore:\r\n```\r\nif(stride == (pixels.getWidth() * pixels.getBytesPerPixel())) {\r\n```\r\nAnyway to come by I would add another format check and only do that if the format != i420. Other suggestions?"}}