Permalink
Browse files

rename save_audio into audio_save, save_video into video_save

  • Loading branch information...
sdpython committed Dec 30, 2017
1 parent 608d549 commit 3d8174e059a8a8d0aef14f71ddcad9576aa0baf6
@@ -214,9 +214,9 @@
"metadata": {},
"outputs": [],
"source": [
"from code_beatrix.faq.faq_video import video_extract_video, save_video\n",
"from code_beatrix.faq.faq_video import video_extract_video, video_save\n",
"vid = video_extract_video(name, '00:00:32', '00:00:45')\n",
"save_video(vid, \"mpoppins.mp4\")"
"video_save(vid, \"mpoppins.mp4\")"
]
},
{
@@ -1,4 +1,6 @@
.. _l-api-video-audio:
Vidéos et Sons
==============
@@ -12,13 +14,11 @@ Audio
.. autosignature:: code_beatrix.faq.faq_video.audio_modification
.. autosignature:: code_beatrix.faq.faq_video.save_audio
.. autosignature:: code_beatrix.faq.faq_video.audio_save
Video
+++++
.. autosignature:: code_beatrix.faq.faq_video.save_video
.. autosignature:: code_beatrix.faq.faq_video.video_extract_video
.. autosignature:: code_beatrix.faq.faq_video.video_enumerate_frames
@@ -27,6 +27,8 @@ Video
.. autosignature:: code_beatrix.faq.faq_video.video_replace_sound
.. autosignature:: code_beatrix.faq.faq_video.video_save
YouTube
+++++++
@@ -46,7 +46,7 @@
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder, ExtTestCase
from src.code_beatrix.faq.faq_video import audio_compose, save_audio
from src.code_beatrix.faq.faq_video import audio_compose, audio_save
class TestAudio(ExtTestCase):
@@ -61,7 +61,7 @@ def test_extract_audio(self):
aud2 = audio_compose(aud, aud, 1, 3)
exp = os.path.join(temp, "courte_audio.wav")
save_audio(aud2, exp)
audio_save(aud2, exp)
self.assertExists(exp)
@@ -46,7 +46,7 @@
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder, ExtTestCase
from src.code_beatrix.faq.faq_video import save_video, video_extract_video
from src.code_beatrix.faq.faq_video import video_save, video_extract_video
class TestVideo(ExtTestCase):
@@ -60,7 +60,7 @@ def test_extract_avideo(self):
vid = os.path.join(temp, '..', 'data', 'videxa.mp4')
vid2 = video_extract_video(vid, '00:00:01', '00:00:04')
exp = os.path.join(temp, "courte.mp4")
save_video(vid2, exp)
video_save(vid2, exp)
self.assertExists(exp)
@@ -46,7 +46,7 @@
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder, ExtTestCase
from src.code_beatrix.faq.faq_video import save_video, video_replace_sound, video_extract_audio
from src.code_beatrix.faq.faq_video import video_save, video_replace_sound, video_extract_audio
class TestAudioVideo(ExtTestCase):
@@ -63,7 +63,7 @@ def test_extract_audio_video(self):
t_end='00:00:05', speed=2.)
self.assertTrue(video_extract_audio(vid2) is not None)
exp = os.path.join(temp, "courte_audio.mp4")
save_video(vid2, exp, verbose=False)
video_save(vid2, exp, verbose=False)
self.assertExists(exp)
@@ -64,7 +64,7 @@ def video_extract_video(video_or_file, ta=0, tb=None):
return video.subclip(ta, tb)
def save_video(video_or_file, filename, verbose=False, **kwargs):
def video_save(video_or_file, filename, verbose=False, **kwargs):
"""
Saves as a video.
Enregistre une vidéo dans un fichier.
@@ -84,7 +84,7 @@ def save_video(video_or_file, filename, verbose=False, **kwargs):
video.write_videofile(filename, verbose=verbose, **kwargs)
def save_audio(audio_or_file, filename, verbose=False, **kwargs):
def audio_save(audio_or_file, filename, verbose=False, **kwargs):
"""
Saves as a sound.
Enregistre un son dans un fichier.

0 comments on commit 3d8174e

Please sign in to comment.