{"action":"created","issue":{"url":"https://api.github.com/repos/bytedeco/javacv/issues/1232","repository_url":"https://api.github.com/repos/bytedeco/javacv","labels_url":"https://api.github.com/repos/bytedeco/javacv/issues/1232/labels{/name}","comments_url":"https://api.github.com/repos/bytedeco/javacv/issues/1232/comments","events_url":"https://api.github.com/repos/bytedeco/javacv/issues/1232/events","html_url":"https://github.com/bytedeco/javacv/issues/1232","id":456992942,"node_id":"MDU6SXNzdWU0NTY5OTI5NDI=","number":1232,"title":"Can't use FFmpegFrameGrabber with video stream","user":{"login":"b005t3r","id":757150,"node_id":"MDQ6VXNlcjc1NzE1MA==","avatar_url":"https://avatars3.githubusercontent.com/u/757150?v=4","gravatar_id":"","url":"https://api.github.com/users/b005t3r","html_url":"https://github.com/b005t3r","followers_url":"https://api.github.com/users/b005t3r/followers","following_url":"https://api.github.com/users/b005t3r/following{/other_user}","gists_url":"https://api.github.com/users/b005t3r/gists{/gist_id}","starred_url":"https://api.github.com/users/b005t3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/b005t3r/subscriptions","organizations_url":"https://api.github.com/users/b005t3r/orgs","repos_url":"https://api.github.com/users/b005t3r/repos","events_url":"https://api.github.com/users/b005t3r/events{/privacy}","received_events_url":"https://api.github.com/users/b005t3r/received_events","type":"User","site_admin":false},"labels":[{"id":93998519,"node_id":"MDU6TGFiZWw5Mzk5ODUxOQ==","url":"https://api.github.com/repos/bytedeco/javacv/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2019-06-17T15:14:53Z","updated_at":"2019-06-18T07:58:52Z","closed_at":"2019-06-17T23:33:55Z","author_association":"NONE","body":"I'm streaming locally, like so:\r\n\r\n`ffmpeg -stream_loop -1 -i file.mp4 -vcodec copy -acodec copy -f mpegts tcp://127.0.0.1:9090?listen`\r\n\r\nAnd the grabber is configured like so:\r\n\r\n```java\r\n            grabber = new FFmpegFrameGrabber(\"tcp://127.0.0.1:9090\");\r\n            grabber.setVideoOption(\"threads\", \"0\"); // use optimal number of threads for the selected codec\r\n            grabber.setImageWidth(width);\r\n            grabber.setImageHeight(height);\r\n            grabber.setPixelFormat(PIXEL_FORMAT);\r\n            grabber.setImageScalingFlags(SWS_BICUBIC);\r\n            grabber.setFormat(\"mpegts\");\r\n``` \r\n\r\nIt works with a file (without `grabber.setFormat(\"mpegts\");`), but when I try to use it with a stream, I get this:\r\n\r\n`avformat_open_input() error -61: Could not open input \"tcp://127.0.0.1:9090\". (Has setFormat() been called?)`"},"comment":{"url":"https://api.github.com/repos/bytedeco/javacv/issues/comments/502992701","html_url":"https://github.com/bytedeco/javacv/issues/1232#issuecomment-502992701","issue_url":"https://api.github.com/repos/bytedeco/javacv/issues/1232","id":502992701,"node_id":"MDEyOklzc3VlQ29tbWVudDUwMjk5MjcwMQ==","user":{"login":"b005t3r","id":757150,"node_id":"MDQ6VXNlcjc1NzE1MA==","avatar_url":"https://avatars3.githubusercontent.com/u/757150?v=4","gravatar_id":"","url":"https://api.github.com/users/b005t3r","html_url":"https://github.com/b005t3r","followers_url":"https://api.github.com/users/b005t3r/followers","following_url":"https://api.github.com/users/b005t3r/following{/other_user}","gists_url":"https://api.github.com/users/b005t3r/gists{/gist_id}","starred_url":"https://api.github.com/users/b005t3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/b005t3r/subscriptions","organizations_url":"https://api.github.com/users/b005t3r/orgs","repos_url":"https://api.github.com/users/b005t3r/repos","events_url":"https://api.github.com/users/b005t3r/events{/privacy}","received_events_url":"https://api.github.com/users/b005t3r/received_events","type":"User","site_admin":false},"created_at":"2019-06-18T07:58:52Z","updated_at":"2019-06-18T07:58:52Z","author_association":"NONE","body":"OK, I think I found the problem on my side - before calling `start()` on grabber, I call this:\r\n\r\n```java\r\n        formatCtx = avformat_alloc_context();\r\n        avformat_open_input(formatCtx, path, null, null);\r\n        avformat_find_stream_info(formatCtx, (AVDictionary) null);\r\n```\r\n\r\nto get the stream format. It works fine with files, but I'll have to figure out something different for streams."}}
{"actor":{"display_login":"b005t3r"}}