質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Jupyter

Jupyter (旧IPython notebook)は、Notebook形式でドキュメント作成し、プログラムの記述・実行、その実行結果を記録するツールです。メモの作成や保存、共有、確認などもブラウザ上で行うことができます。

FFmpeg

FFmpegは、動画と音声を交換できるフリーソフトウェアです。UNIX系OSから派生した、MS-DOSから操作するコマンドラインツールです。libavcodecやlibavformat、libswscale、libavfilterなどを含みます。ライセンスは、コンパイルの際のオプションによりLGPLもしくはGPLに決定されます。対応コーデックや使用できるオプションが多く、幅広く利用されています。

Q&A

解決済

1回答

5837閲覧

Jupyterでffmpegを使いたい

villas

総合スコア14

Jupyter

Jupyter (旧IPython notebook)は、Notebook形式でドキュメント作成し、プログラムの記述・実行、その実行結果を記録するツールです。メモの作成や保存、共有、確認などもブラウザ上で行うことができます。

FFmpeg

FFmpegは、動画と音声を交換できるフリーソフトウェアです。UNIX系OSから派生した、MS-DOSから操作するコマンドラインツールです。libavcodecやlibavformat、libswscale、libavfilterなどを含みます。ライセンスは、コンパイルの際のオプションによりLGPLもしくはGPLに決定されます。対応コーデックや使用できるオプションが多く、幅広く利用されています。

0グッド

0クリップ

投稿2021/02/27 15:16

編集2021/02/27 15:19

###実現したいこと・実行したこと
JyputerLabでbar_chart_raceを行いたいと思い以下のようなコード実行しました。
コードは以下の通りです、

import pandas as pd import bar_chart_race as bcr df = pd.read_csv('tennis.csv') bcr.bar_chart_race(df)

tennis.csvの中身は以下のようになります

week_title player_slug ranking_points 0 2000/1/31 andre agassi 5045 1 2000/1/31 gustavo kuerten 2169 2 2000/1/31 magnus norman 2083 3 2000/1/31 marcelo rios 1846 4 2000/1/31 nicolas kiefer 2325

###エラー
実行したら次のようなエラーが発生しました。

C:\Users\user\anaconda3\lib\site-packages\bar_chart_race\_make_chart.py:286: UserWarning: FixedFormatter should only be used together with FixedLocator ax.set_yticklabels(self.df_values.columns) C:\Users\user\anaconda3\lib\site-packages\bar_chart_race\_make_chart.py:287: UserWarning: FixedFormatter should only be used together with FixedLocator ax.set_xticklabels([max_val] * len(ax.get_xticks())) --------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) ~\anaconda3\lib\site-packages\bar_chart_race\_make_chart.py in make_animation(self) 427 if self.html: --> 428 ret_val = anim.to_html5_video() 429 try: ~\anaconda3\lib\site-packages\matplotlib\animation.py in to_html5_video(self, embed_limit) 1315 # appropriate size for the tag -> 1316 Writer = writers[mpl.rcParams['animation.writer']] 1317 writer = Writer(codec='h264', ~\anaconda3\lib\site-packages\matplotlib\animation.py in __getitem__(self, name) 165 return self._registered[name] --> 166 raise RuntimeError(f"Requested MovieWriter ({name}) not available") 167 RuntimeError: Requested MovieWriter (ffmpeg) not available During handling of the above exception, another exception occurred: Exception Traceback (most recent call last) <ipython-input-4-bdeaf7844271> in <module> ----> 1 bcr.bar_chart_race(df) ~\anaconda3\lib\site-packages\bar_chart_race\_make_chart.py in bar_chart_race(df, filename, orientation, sort, n_bars, fixed_order, fixed_max, steps_per_period, period_length, interpolate_period, label_bars, bar_size, period_label, period_fmt, period_summary_func, perpendicular_bar_func, figsize, cmap, title, title_size, bar_label_size, tick_label_size, shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors) 781 figsize, cmap, title, title_size, bar_label_size, tick_label_size, 782 shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors) --> 783 return bcr.make_animation() 784 785 def load_dataset(name='covid19'): ~\anaconda3\lib\site-packages\bar_chart_race\_make_chart.py in make_animation(self) 444 else: 445 message = str(e) --> 446 raise Exception(message) 447 finally: 448 plt.rcParams = self.orig_rcParams Exception: You do not have ffmpeg installed on your machine. Download ffmpeg from here: https://www.ffmpeg.org/download.html. Matplotlib's original error message below: Requested MovieWriter (ffmpeg) not available

###試したこと
https://www.gyan.dev/ffmpeg/builds/
からreleaseにあるhttps://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full.7zを
ダウンロードし、解凍したものをProgram Filesに置きました。その後、システム環境変数の
PathにC:\Program Files\ffmpeg-4.3.2-2021-02-20-full_build\binを通したのですが上記のエラーが変わらず発生します。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

jbpb0

2021/02/27 23:13

コマンドプロンプトで下記を実行したら、大丈夫ですか? ffmpeg -version 上記が大丈夫なら、Jupyterで下記を実行してみてください !ffmpeg -version
ppaul

2021/02/27 23:51

pip install ffmpeg-python でffmpeg-pythonはインストールしてありますか?
villas

2021/02/28 00:36

jbpb0様 どちらも実行してみましたが大丈夫でした。 ppaul様 インストールしてみましたが変わらずエラーが起きました。
guest

回答1

0

ベストアンサー

Anacondaを利用されているようですので、condaコマンドでffmpegをインストールしてください。
Anacondaリポジトリから配布されています。
イメージ説明

ただし、あなたのtennis.csvでは動画の作成に失敗します。
以下のような行列の時系列データーを作ってください。

<見本>
イメージ説明

投稿2021/02/28 00:39

編集2021/02/28 00:44
technocore

総合スコア7225

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

villas

2021/02/28 08:09 編集

tennis.csvではなく上に書かれたようなデータ形式のファイルで実行したら成功しました。 ありがとうございました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問