投稿時間:2022-11-14 10:10:41 RSSフィード2022-11-14 10:00 分まとめ(12件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT ITmedia 総合記事一覧 [ITmedia エグゼクティブ] 温暖化解明に挑む科学の力 定量化する手法「EA」とは https://mag.executive.itmedia.co.jp/executive/articles/2211/14/news081.html itmedia 2022-11-14 09:40:00
IT 情報システムリーダーのためのIT情報専門サイト IT Leaders TmaxSoft、メインフレームからクラウドに移行した企業にマネージド型運用保守サービスを提供 | IT Leaders https://it.impress.co.jp/articles/-/24038 TmaxSoft、メインフレームからクラウドに移行した企業にマネージド型運用保守サービスを提供ITLeaders日本ティーマックスソフトは年月日、メインフレームからクラウドへの移行を実施した企業に向けて、クラウドの運用・保守・監視サービスを開始すると発表した。 2022-11-14 09:30:00
AWS AWS Japan Blog 塩野義製薬におけるデータ駆動型の営業活動を実現するデータマネジメントプラットフォームの構築 https://aws.amazon.com/jp/blogs/news/shionogi-data-management-platform/ 営業活動 2022-11-14 00:01:01
デザイン コリス 応募者全員がもらえる🎉 ノンデザイナーズ・デザインブックの特典PDF「Figmaで実践する デザイン4つの基本原則」 https://coliss.com/articles/products/the-non-designers-work-with-figma.html 続きを読む 2022-11-14 00:36:52
js JavaScriptタグが付けられた新着投稿 - Qiita Stripeの「冪等キー」を利用して、多重決済や顧客の重複作成を予防するシステムを実装する方法 https://qiita.com/hideokamoto/items/4c32ebc29bd8d8460c65 invoice 2022-11-14 09:49:19
GCP gcpタグが付けられた新着投稿 - Qiita 全部見える!GCP ロギングで見るFirestoreのアクセス履歴 https://qiita.com/kontikun/items/d4090fbf80d7fb03b13a firest 2022-11-14 09:16:58
海外TECH DEV Community How to build an MP4 to GIF converter using Python + Shotstack API https://dev.to/shotstack/how-to-build-a-mp4-to-gif-converting-app-using-python-shotstack-api-2kg7 How to build an MP to GIF converter using Python Shotstack APIAnimated GIFs are a fun way to convert videos into a lightweight short visual media Often used for memes and humor GIFs have become a popular method of communication and cultural expression This guide will teach you to programmatically convert MP to GIF using Python and build a media conversion app The Shotstack API and SDKShotstack provides a cloud based video editing API Rendering video is resource intensive and it can take hours to edit and generate videos at scale Shotstack s infrastructure makes it possible to concurrently render multiple media files like video audio and GIFs in minutes You can sign up for a free developer account to get your API key Install and configure the Shotstack SDKIf you want to skip ahead you can find the source code for this guide in our GitHub repository Otherwise follow the steps below to install dependencies and set up your API key First of all install the Shotstack Python SDK from the command line pip install shotstack sdkYou may need to use pip depending on how your environment is configured Then set your API key as an environment variable Linux Mac export SHOTSTACK KEY your key hereor if using Windows make sure to add the SHOTSTACK KEY to the path set SHOTSTACK KEY your key hereReplace your key here with your provided sandbox API key which is free for testing and development Create a Python script to convert MP to GIFCreate a file for the script in your favorite IDE or text editor You can call it whatever you like but for this tutorial we created a file called mp to gif py Open the file and begin editing Import the required modulesLet s import the required modules for the project We need to import modules from the Shotstack SDK to edit and render our video plus a couple of built in modules import shotstack sdk as shotstackimport osimport sysfrom shotstack sdk api import edit apifrom shotstack sdk model clip import Clipfrom shotstack sdk model track import Trackfrom shotstack sdk model timeline import Timelinefrom shotstack sdk model output import Outputfrom shotstack sdk model edit import Editfrom shotstack sdk model video asset import VideoAsset Configuring the API clientNext add the following which sets up the API client with the API URL and key this should use the API key added toyour environment variables If you want you can hard code the API key here but we recommend environment variables host configuration shotstack Configuration host host configuration api key DeveloperKey os getenv SHOTSTACK KEY with shotstack ApiClient configuration as api client api instance edit api EditApi api client Setting up the video clipWe will convert the following Christian Bale American Psycho meme video hosted on Imgflip at the URL The video needs to be hosted online and accessible via a public or signed URL You can replace it with your own video URL from any online source Add the following code to create a VideoAsset using the video URL video asset VideoAsset src Next create a Clip A clip is container for different types of assets including the VideoAsset We can configure different propertieslike length duration to play for and start time when on the timeline the clip will play from For our clip we usethe video asset we just created a start of seconds and a length of seconds video clip Clip asset video asset start length Adding the video clip to the timelineThe Shotstack API follows many of the principles of desktop editing software such as a timeline and tracks Let s create a timeline which contains a track and the track will contain our video clip Tracks on the timeline allow us to layer clips on each other Below we add our video clip to the Track clips array and then add our track to the array of tracks of the Timeline track Track clips video clip timeline Timeline background tracks track Configuring the final edit and outputWe need to configure the output format and add the timeline and output to create an edit We set the output format to gif which will convert the file from the mp format to an animated gif By selecting repeat to True the gif will loop continuously We also use a very low frames per second fps value and low resolution These settings help us optimize the file size and rendering time of the gif output Output format gif fps resolution preview repeat True edit Edit timeline timeline output output Sending the edit for rendering via the APIFinally we send the edit for processing and rendering using the API The Shotstack SDK takes care of converting our objects to JSON adding our key to the request header and POSTing everything to the API try api response api instance post render edit message api response response message id api response response id print f message n print f gt gt render id id except Exception as e print f Unable to resolve API call e Final codeThe final script is below with a few additional checks and balances import shotstack sdk as shotstackimport osimport sysfrom shotstack sdk api import edit apifrom shotstack sdk model clip import Clipfrom shotstack sdk model track import Trackfrom shotstack sdk model timeline import Timelinefrom shotstack sdk model output import Outputfrom shotstack sdk model edit import Editfrom shotstack sdk model video asset import VideoAssetfrom shotstack sdk model shotstack destination import ShotstackDestinationif name main host if os getenv SHOTSTACK HOST is not None host os getenv SHOTSTACK HOST configuration shotstack Configuration host host if os getenv SHOTSTACK KEY is None sys exit API Key is required Set using export SHOTSTACK KEY your key here configuration api key DeveloperKey os getenv SHOTSTACK KEY with shotstack ApiClient configuration as api client api instance edit api EditApi api client video asset VideoAsset src video clip Clip asset video asset start length track Track clips video clip timeline Timeline background tracks track output Output format gif fps resolution preview repeat True edit Edit timeline timeline output output try api response api instance post render edit message api response response message id api response response id print f message n print f gt gt render id id except Exception as e print f Unable to resolve API call e Running the scriptUse the python command to run the script python mp to gif pyYou may need to use python instead of python depending on your configuration If the render request is successful the API will return the render id which we can use to retrieve the status of therender Checking the render status and output URLTo check the status we need another script that will call the API to render the status endpoint Create a file called status py and paste the following code import sysimport osimport shotstack sdk as shotstackfrom shotstack sdk api import edit apiif name main host configuration shotstack Configuration host host configuration api key DeveloperKey os getenv SHOTSTACK KEY with shotstack ApiClient configuration as api client api instance edit api EditApi api client api response api instance get render sys argv data False merged True status api response response status print f Status status if status done url api response response url print f gt gt Asset URL url Then run the script usingpython status py renderId Replace  renderId  with the ID returned from the mp to gif py script Re run the status py script every couple of seconds until the status is done and a URL is returned If something goes wrong the status will show as failed The final rendered gif is ready to be hosted or transferred to your application Accessing your rendered videos using the dashboardYou can view your rendered videos using the dashboard under Renders Videos are deleted after hours but are available by default in the Shotstack hosting service You can also send renderedvideos to S or Mux ConclusionThis tutorial should have given you a basic understanding of how to programmatically edit and generate videos using Python and the Shotstack video editing API As a next step you could learn how to add other assets like text and images to build a simple media application This is just an introductory tutorial to programmatically working with media but you can do so much more You can use this for many use cases like video automation video personalization developing media applications and many more You can check out our other Python tutorials and YouTube videos to learn programmatic media and build video apps faster 2022-11-14 00:12:19
海外科学 BBC News - Science & Environment COP27: Fears of compromise on key 1.5C global temperature issue https://www.bbc.co.uk/news/science-environment-63617400?at_medium=RSS&at_campaign=KARANGA egypt 2022-11-14 00:56:50
金融 ニッセイ基礎研究所 英国GDP(2022年7-9月期)-前期比マイナス成長で、消費が低迷 https://www.nli-research.co.jp/topics_detail1/id=72951?site=nli nbsp【年月期実質GDP、季節調整値】・前期比は、予想より上振れたが、前期からマイナス成長に転じた図表・前年同期比は、予想より上振れたが、前期から減速した【月次実質GDP月】・前月比は月、月、月となり、月は予想を下回りマイナス幅が大きかったnbspbloomberg集計の中央値。 2022-11-14 09:39:40
金融 日本銀行:RSS 営業毎旬報告(11月10日現在) http://www.boj.or.jp/statistics/boj/other/acmai/release/2022/ac221110.htm 月日 2022-11-14 10:00:00
マーケティング MarkeZine 電通マーケ部門の新人が必ず教わる「ヒットを生み出すリサーチ術」(2)「セールスポイント」の見つけ方 http://markezine.jp/article/detail/40382 電通マーケ部門の新人が必ず教わる「ヒットを生み出すリサーチ術」「セールスポイント」の見つけ方「実務」「実践」「再現性」の切り口から、マーケティングの次の一手を探る「MarkeZineプレミアムセミナー」。 2022-11-14 09:30:00
マーケティング MarkeZine 顧客体験とコンテンツ体験を考える5日間「Content Marketing Day 2022」開催! http://markezine.jp/article/detail/40583 contentmarketingday 2022-11-14 09:30:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)