René's URL Explorer Experiment


Title: change output resolution in stream io · python-ffmpegio/python-ffmpegio · Discussion #38 · GitHub

Open Graph Title: change output resolution in stream io · python-ffmpegio/python-ffmpegio · Discussion #38

X Title: change output resolution in stream io · python-ffmpegio/python-ffmpegio · Discussion #38

Description: change output resolution in stream io

Open Graph Description: expected result small video output resolution code input = 'http://195.196.36.242/mjpg/video.mjpg' output = 'rtsp.mp4' i = 0 with ffmpegio.open(input, 'rv') as fin, ffmpegio.open(output, 'wv', rate...

X Description: expected result small video output resolution code input = 'http://195.196.36.242/mjpg/video.mjpg' output = 'rtsp.mp4' i = 0 with ffmpegio.open(input, 'rv') as fin, ffmpegio...

Opengraph URL: https://github.com/python-ffmpegio/python-ffmpegio/discussions/38

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"change output resolution in stream io","text":"\u003cp dir=\"auto\"\u003e\u003cstrong\u003eexpected result\u003c/strong\u003e\u003cbr\u003e\nsmall video output resolution\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003ecode\u003c/strong\u003e\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"input = 'http://195.196.36.242/mjpg/video.mjpg'\noutput = 'rtsp.mp4'\ni = 0\nwith ffmpegio.open(input, 'rv') as fin, ffmpegio.open(output, 'wv', rate_in = fin.rate, shape_in = (180, 320), overwrite = True) as fout:\n    for frames in fin:\n        fout.write(frames)\n        if i == 9:\n            break\n        i += 1\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode class=\"notranslate\"\u003einput = 'http://195.196.36.242/mjpg/video.mjpg'\noutput = 'rtsp.mp4'\ni = 0\nwith ffmpegio.open(input, 'rv') as fin, ffmpegio.open(output, 'wv', rate_in = fin.rate, shape_in = (180, 320), overwrite = True) as fout:\n    for frames in fin:\n        fout.write(frames)\n        if i == 9:\n            break\n        i += 1\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eresult\u003c/strong\u003e\u003cbr\u003e\nno error occured but the result is not expected,\u003cbr\u003e\nvideo resolution is still high\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eexpected result\u003c/strong\u003e\u003cbr\u003e\nvideo output resolution is small as mention in args 180 x 320\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003ep.s.\u003c/strong\u003e\u003cbr\u003e\ntryin to use shape args on both open('rv') and open'('wv') but return an error\u003cbr\u003e\ntryin to use shape_in args on open('rv') but return an error\u003cbr\u003e\ntryin to use (1, 360, 640, 3) as value but result is not expected (video resolution is still high\u003c/p\u003e\n\u003cp dir=\"auto\"\u003ebest regards\u003c/p\u003e","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"\u003cp dir=\"auto\"\u003eThe correct approach is to make the reader to output small frames:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-python notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"with ffmpegio.open(input, 'rv', s=(180,320)) as fin, ffmpegio.open(output, 'wv', rate_in = fin.rate, overwrite = True) as fout:\n    ...\"\u003e\u003cpre class=\"notranslate\"\u003e\u003cspan class=\"pl-k\"\u003ewith\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003effmpegio\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003eopen\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003einput\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e'rv'\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003es\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003e180\u003c/span\u003e,\u003cspan class=\"pl-c1\"\u003e320\u003c/span\u003e)) \u003cspan class=\"pl-k\"\u003eas\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003efin\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003effmpegio\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003eopen\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003eoutput\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e'wv'\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003erate_in\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003efin\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003erate\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003eoverwrite\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003eTrue\u003c/span\u003e) \u003cspan class=\"pl-k\"\u003eas\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003efout\u003c/span\u003e:\n    ...\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe FFmpeg \u003ccode class=\"notranslate\"\u003es\u003c/code\u003e option (or \u003ccode class=\"notranslate\"\u003e-s\u003c/code\u003e option in cli) sets the output frame size (implicitly inserts a resize filter). If you wish to only set height or width and automatically scale the other, keeping the aspect ratio, specify the dependent dimension as \u003ccode class=\"notranslate\"\u003e-1\u003c/code\u003e or \u003ccode class=\"notranslate\"\u003e-2\u003c/code\u003e if you need to make sure even number of pixels. For example,\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-python notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"with ffmpegio.open(input, 'rv', s=(180,-1)) as fin, ffmpegio.open(output, 'wv', rate_in = fin.rate, overwrite = True) as fout:\n    ...\"\u003e\u003cpre class=\"notranslate\"\u003e\u003cspan class=\"pl-k\"\u003ewith\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003effmpegio\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003eopen\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003einput\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e'rv'\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003es\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003e180\u003c/span\u003e,\u003cspan class=\"pl-c1\"\u003e-\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e)) \u003cspan class=\"pl-k\"\u003eas\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003efin\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003effmpegio\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003eopen\u003c/span\u003e(\u003cspan class=\"pl-s1\"\u003eoutput\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e'wv'\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003erate_in\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003efin\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003erate\u003c/span\u003e, \u003cspan class=\"pl-s1\"\u003eoverwrite\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003eTrue\u003c/span\u003e) \u003cspan class=\"pl-k\"\u003eas\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003efout\u003c/span\u003e:\n    ...\u003c/pre\u003e\u003c/div\u003e","upvoteCount":1,"url":"https://github.com/python-ffmpegio/python-ffmpegio/discussions/38#discussioncomment-8780187"}}}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/Voltron::DiscussionsFragmentsController/show/:user_id/:repository/:discussion_number/discussion_layout(.:format)
route-controllervoltron_discussions_fragments
route-actiondiscussion_layout
fetch-noncev2:3af09be3-b1a5-622e-ae2b-5cd16d78a770
current-catalog-service-hash9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be
request-idE4A2:332DCA:2BF079:3D8921:6AFD7394
html-safe-nonce60c7c8215f00a0d7afafd6a23cd6d732018fade41c0dc0f9d3c985d7a70d9de3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNEEyOjMzMkRDQToyQkYwNzk6M0Q4OTIxOjZBRkQ3Mzk0IiwidmlzaXRvcl9pZCI6IjUyNDE0ODAxNDMxMDQyMDk4MTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacf3413a6644c8e6b9a3cc9bc520234ef6d93620d9f842e9715578a4d0f91a9db3
hovercard-subject-tagdiscussion:6369914
github-keyboard-shortcutsrepository,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/discussions_fragments/discussion_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/Voltron::DiscussionsFragmentsController/show/python-ffmpegio/python-ffmpegio/38/discussion_layout
twitter:imagehttps://opengraph.githubassets.com/b3476bbb5eaae785c6fceb13e3bd1f46a0a2581478f0b8080be72d9a19852013/python-ffmpegio/python-ffmpegio/discussions/38
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b3476bbb5eaae785c6fceb13e3bd1f46a0a2581478f0b8080be72d9a19852013/python-ffmpegio/python-ffmpegio/discussions/38
og:image:altexpected result small video output resolution code input = 'http://195.196.36.242/mjpg/video.mjpg' output = 'rtsp.mp4' i = 0 with ffmpegio.open(input, 'rv') as fin, ffmpegio.open(output, 'wv', rate...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonee54006cf2b96d1ac260960edd10003132911469ccd1ec99c9803119fe2a4e032
turbo-cache-controlno-preview
go-importgithub.com/python-ffmpegio/python-ffmpegio git https://github.com/python-ffmpegio/python-ffmpegio.git
octolytics-dimension-user_id98168493
octolytics-dimension-user_loginpython-ffmpegio
octolytics-dimension-repository_id355600490
octolytics-dimension-repository_nwopython-ffmpegio/python-ffmpegio
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id355600490
octolytics-dimension-repository_network_root_nwopython-ffmpegio/python-ffmpegio
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release5be0bf2b8cf26f8897d31e6bc3c232d328b12a54
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python-ffmpegio/python-ffmpegio/discussions/38#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-ffmpegio%2Fpython-ffmpegio%2Fdiscussions%2F38
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-ffmpegio%2Fpython-ffmpegio%2Fdiscussions%2F38
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fdiscussions_fragments%2Fdiscussion_layout&source=header-repo&source_repo=python-ffmpegio%2Fpython-ffmpegio
Reloadhttps://github.com/python-ffmpegio/python-ffmpegio/discussions/38
Reloadhttps://github.com/python-ffmpegio/python-ffmpegio/discussions/38
Reloadhttps://github.com/python-ffmpegio/python-ffmpegio/discussions/38
python-ffmpegiohttps://github.com/python-ffmpegio
python-ffmpegiohttps://github.com/python-ffmpegio/python-ffmpegio
Codehttps://github.com/python-ffmpegio/python-ffmpegio
Issues4 (4)https://github.com/python-ffmpegio/python-ffmpegio/issues
Pull requests1 (1)https://github.com/python-ffmpegio/python-ffmpegio/pulls
Discussionshttps://github.com/python-ffmpegio/python-ffmpegio/discussions
Actionshttps://github.com/python-ffmpegio/python-ffmpegio/actions
Projectshttps://github.com/python-ffmpegio/python-ffmpegio/projects
Wikihttps://github.com/python-ffmpegio/python-ffmpegio/wiki
Security and qualityhttps://github.com/python-ffmpegio/python-ffmpegio/security
Insightshttps://github.com/python-ffmpegio/python-ffmpegio/insights
Answered https://github.com/python-ffmpegio/python-ffmpegio/discussions/38#discussioncomment-8780187
tikuma-lsuhschttps://github.com/tikuma-lsuhsc
sugizo https://github.com/sugizo
Q&Ahttps://github.com/python-ffmpegio/python-ffmpegio/discussions/categories/q-a
change output resolution in stream io https://github.com/python-ffmpegio/python-ffmpegio/discussions/38#top
sugizo https://github.com/sugizo
Answered https://github.com/python-ffmpegio/python-ffmpegio/discussions/38#discussioncomment-8780187
tikuma-lsuhschttps://github.com/tikuma-lsuhsc
Return to tophttps://github.com/python-ffmpegio/python-ffmpegio/discussions/38#top
Please reload this pagehttps://github.com/python-ffmpegio/python-ffmpegio/discussions/38
https://github.com/python-ffmpegio/python-ffmpegio/discussions/38
sugizo https://github.com/sugizo
Mar 14, 2024 https://github.com/python-ffmpegio/python-ffmpegio/discussions/38#discussion-6369914
tikuma-lsuhsc https://github.com/tikuma-lsuhsc
Mar 14, 2024 https://github.com/python-ffmpegio/python-ffmpegio/discussions/38#discussioncomment-8780187
View full answer https://github.com/python-ffmpegio/python-ffmpegio/discussions/38#discussioncomment-8780187
Oldest https://github.com/python-ffmpegio/python-ffmpegio/discussions/38?sort=old
Newest https://github.com/python-ffmpegio/python-ffmpegio/discussions/38?sort=new
Top https://github.com/python-ffmpegio/python-ffmpegio/discussions/38?sort=top
Please reload this pagehttps://github.com/python-ffmpegio/python-ffmpegio/discussions/38
https://github.com/python-ffmpegio/python-ffmpegio/discussions/38
tikuma-lsuhsc https://github.com/tikuma-lsuhsc
Mar 14, 2024 https://github.com/python-ffmpegio/python-ffmpegio/discussions/38#discussioncomment-8780187
sugizohttps://github.com/sugizo
Sign up for freehttps://github.com/join?source=comment-repo
Sign in to commenthttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-ffmpegio%2Fpython-ffmpegio%2Fdiscussions%2F38
🙏 Q&A https://github.com/python-ffmpegio/python-ffmpegio/discussions/categories/q-a
https://github.com/sugizo
https://github.com/tikuma-lsuhsc
https://github.com/python-ffmpegio/python-ffmpegio/discussions/38
https://github.com/settings/replies?return_to=1
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.