Skip to content

Commit bccf389

Browse files
committed
Updating depracated video loading
1 parent 00ca842 commit bccf389

3 files changed

+7
-6
lines changed

SlidingWindow3-AudioApplications.ipynb

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
"from persim import plot_diagrams\n",
2626
"import scipy.io.wavfile\n",
2727
"\n",
28+
"from IPython.display import clear_output\n",
29+
"\n",
2830
"def getSlidingWindow(x, dim, Tau, dT):\n",
2931
" \"\"\"\n",
3032
" Return a sliding window of a time series,\n",
@@ -135,7 +137,7 @@
135137
"G0 = 1433 #Second fundamental frequency\n",
136138
"\n",
137139
"###TODO: Modify this variable (time in seconds)\n",
138-
"time = 0\n",
140+
"time = 0.91\n",
139141
"\n",
140142
"#Step 1: Extract an audio snippet starting at the chosen time\n",
141143
"SigLen = 512 #The number of samples to take after the start time\n",

SlidingWindow4-Video.ipynb

+1-2
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@
136136
"metadata": {},
137137
"outputs": [],
138138
"source": [
139-
"imageio.plugins.ffmpeg.download()\n",
140139
"#Load in video and do PCA to compress dimension\n",
141140
"(X, FrameDims) = loadImageIOVideo(\"jumpingjacks.ogg\")\n",
142141
"X = getPCAVideo(X)"
@@ -484,7 +483,7 @@
484483
"name": "python",
485484
"nbconvert_exporter": "python",
486485
"pygments_lexer": "ipython3",
487-
"version": "3.7.1"
486+
"version": "3.7.6"
488487
}
489488
},
490489
"nbformat": 4,

VideoTools.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#Need these for saving 3D video
1919

20-
AVCONV_BIN = 'avconv'
20+
AVCONV_BIN = 'ffmpeg'
2121
TEMP_STR = "pymeshtempprefix"
2222

2323
#############################################################
@@ -55,7 +55,7 @@ def loadVideo(path):
5555
print("ERROR: Video path not found: %s"%path)
5656
return None
5757
videoReader = imageio.get_reader(path, 'ffmpeg')
58-
NFrames = videoReader.get_length()
58+
NFrames = videoReader.count_frames()
5959
F0 = videoReader.get_data(0)
6060
IDims = F0.shape
6161
I = np.zeros((NFrames, F0.size))
@@ -74,7 +74,7 @@ def loadImageIOVideo(path):
7474
return None
7575
import imageio
7676
videoReader = imageio.get_reader(path, 'ffmpeg')
77-
NFrames = videoReader.get_length()
77+
NFrames = videoReader.count_frames()
7878
F0 = videoReader.get_data(0)
7979
IDims = F0.shape
8080
I = np.zeros((NFrames, F0.size))

0 commit comments

Comments
 (0)