Difference between revisions of "SA SYNC"

From Wiki4Intranet
Jump to: navigation, search
(start_time.py .-.)
 
(22 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
  
{{vimeoembed||800|500}}
+
{{vimeoembed|48092917|800|500}}
  
 
== SA: продвинутая синхронизация .-. ==
 
== SA: продвинутая синхронизация .-. ==
Line 21: Line 21:
 
== Исходники .-. ==
 
== Исходники .-. ==
  
{{vimeoembed|49178506|320|200}}
+
{{SideBar40|Создаем тестовый проект
{{vimeoembed|49178503|320|200}}
+
{{vimeoembed|49178504|320|200}}
+
 
+
* Создаем тестовый проект
+
 
;sa-test4sync-cam.avi: cam1
 
;sa-test4sync-cam.avi: cam1
 
;sa-test4sync-keyboard.avi: cam2
 
;sa-test4sync-keyboard.avi: cam2
 
;sa-test4sync-screencast.avi: screen1
 
;sa-test4sync-screencast.avi: screen1
 +
}}
  
 +
{{vimeoembed|49178506|300|200}}
 +
{{vimeoembed|49178503|320|120}}
 +
{{vimeoembed|49178504|320|200}}
  
 
== Потоки .-. ==
 
== Потоки .-. ==
  
 +
<slides split="----">
 
[[File:Потоки в SA. Синхронизация по звуку.svg|center|800px]]
 
[[File:Потоки в SA. Синхронизация по звуку.svg|center|800px]]
  
 +
----
 +
 +
[[File:SA_синхронизация_по_звуку.png|center|800px]]
 +
 +
----
 +
 +
[[File:Потоки в SA. Синхронизация по звуку.svg|center|800px]]
 +
</slides>
  
 
== start_time.py .-. ==
 
== start_time.py .-. ==
Line 59: Line 68:
 
</code-python>
 
</code-python>
  
== План .-. ==
+
== cam2/… .-. ==
  
 
<graph>
 
<graph>
Line 67: Line 76:
 
     rankdir=LR;
 
     rankdir=LR;
 
                        
 
                        
"../sources/cam1/source.py.avs" [style=filled fillcolor=lightgrey]
+
"source.py.avs" [style=filled fillcolor=lightgrey]
"../sources/cam1/video.avs" -> "../sources/cam1/source.py.avs" [label="includes" style=dashed color=lightblue ]
+
"sa-test4sync-keyboard.avi" [style=filled fillcolor=yellow]
"2012-08-08-test.uncut.mkv" [style=filled fillcolor=lightgrey]
+
"source.py.avs" -> "sa-test4sync-keyboard.avi" [label="includes" style=dashed color=lightblue ]
"2012-08-08-test.uncut.mkv" -> "2012-08-08-test.uncut" [label="parent" style=solid color=darkblue ]
+
"source.py.avs" [style=filled fillcolor=lightgrey]
"../sources/screen1/video.avs$vbitrate=800.avi" [style=filled fillcolor=lightgrey]
+
"source.py.avs" -> "source.py" [label="parent" style=solid color=darkblue ]
"../sources/screen1/video.avs$vbitrate=800.avi" -> "../sources/screen1/video.avs" [label="parent" style=solid color=darkblue ]
+
"source.py.avs" [style=filled fillcolor=lightgrey]
"../sources/cam1/video.avs$vbitrate=700.avi" [style=filled fillcolor=lightgrey]
+
"audio.avs" -> "source.py.avs" [label="includes" style=dashed color=lightblue ]
"../sources/cam1/video.avs$vbitrate=700.avi" -> "../sources/cam1/video.avs" [label="parent" style=solid color=darkblue ]
+
"sa-test4sync-keyboard.avi.meta" [style=filled fillcolor=lightgrey]
"../sources/cam1/video.avs" -> "../sources/cam1/videofilters.avs" [label="includes" style=dashed color=lightblue ]
+
"sa-test4sync-keyboard.avi" [style=filled fillcolor=yellow]
"../sources/cam1/source.py.avs" [style=filled fillcolor=lightgrey]
+
"sa-test4sync-keyboard.avi.meta" -> "sa-test4sync-keyboard.avi" [label="parent" style=solid color=darkblue ]
"../sources/cam1/sa-sample-camera.avi" [style=filled fillcolor=yellow]
+
"start_time.py.avs" [style=filled fillcolor=lightgrey]
"../sources/cam1/source.py.avs" -> "../sources/cam1/sa-sample-camera.avi" [label="includes" style=dashed color=lightblue ]
+
"audio.avs" -> "start_time.py.avs" [label="includes" style=dashed color=lightblue ]
"../sources/screen1/common.avs" -> "../lib/lib.avs" [label="includes" style=dashed color=lightblue ]
+
"audio.avs$mode=trailer,ss=300,len=300.wav" [style=filled fillcolor=lightgrey]
"../lib/lib.avs" -> "../lib/debugmode.avs" [label="includes" style=dashed color=lightblue ]
+
"audio.avs$mode=trailer,ss=300,len=300.wav" -> "audio.avs" [label="parent" style=solid color=darkblue ]
"../sources/screen1/start_time.py.avs" [style=filled fillcolor=lightgrey]
+
"../../lib/lib.avs" -> "../../lib/debugmode.avs" [label="includes" style=dashed color=lightblue ]
"../sources/screen1/start_time.py.avs" -> "../sources/screen1/start_time.py" [label="parent" style=solid color=darkblue ]
+
"sa-test4sync-keyboard.avi.meta" [style=filled fillcolor=lightgrey]
"../sources/screen1/source.py.avs" [style=filled fillcolor=lightgrey]
+
"source.py" -> "sa-test4sync-keyboard.avi.meta" [label="includes" style=dashed color=lightblue ]
"../sources/screen1/source.py.avs" -> "../sources/screen1/common.avs" [label="includes" style=dashed color=lightblue ]
+
"../../lib/lib.avs" -> "../../lib/cachemode.avs" [label="includes" style=dashed color=lightblue ]
"../sources/cam1/start_time.py.avs" [style=filled fillcolor=lightgrey]
+
"audio.avs" -> "common.avs" [label="includes" style=dashed color=lightblue ]
"../sources/cam1/start_time.py.avs" -> "../sources/cam1/start_time.py" [label="parent" style=solid color=darkblue ]
+
"common.avs" -> "../../lib/lib.avs" [label="includes" style=dashed color=lightblue ]
"../sources/cam1/video.avs" -> "../sources/cam1/common.avs" [label="includes" style=dashed color=lightblue ]
+
"start_time.py.avs" [style=filled fillcolor=lightgrey]
"../sources/cam1/start_time.py.avs" [style=filled fillcolor=lightgrey]
+
"start_time.py.avs" -> "start_time.py" [label="parent" style=solid color=darkblue ]
"../sources/cam1/video.avs" -> "../sources/cam1/start_time.py.avs" [label="includes" style=dashed color=lightblue ]
+
"source.py.avs" [style=filled fillcolor=lightgrey]
"../sources/screen1/source.py.avs" [style=filled fillcolor=lightgrey]
+
"source.py.avs" -> "common.avs" [label="includes" style=dashed color=lightblue ]
"../sources/screen1/video.avs" -> "../sources/screen1/source.py.avs" [label="includes" style=dashed color=lightblue ]
+
"../sources/cam1/source.py.avs" [style=filled fillcolor=lightgrey]
+
"../sources/cam1/source.py.avs" -> "../sources/cam1/source.py" [label="parent" style=solid color=darkblue ]
+
"../lib/lib.avs" -> "../lib/cachemode.avs" [label="includes" style=dashed color=lightblue ]
+
"../sources/cam1/sa-sample-camera.avi.meta" [style=filled fillcolor=lightgrey]
+
"../sources/cam1/sa-sample-camera.avi" [style=filled fillcolor=yellow]
+
"../sources/cam1/sa-sample-camera.avi.meta" -> "../sources/cam1/sa-sample-camera.avi" [label="parent" style=solid color=darkblue ]
+
"../sources/cam1/source.py.avs" [style=filled fillcolor=lightgrey]
+
"../sources/cam1/source.py.avs" -> "../sources/cam1/common.avs" [label="includes" style=dashed color=lightblue ]
+
"../sources/screen1/start_time.py.avs" [style=filled fillcolor=lightgrey]
+
"../sources/screen1/video.avs" -> "../sources/screen1/start_time.py.avs" [label="includes" style=dashed color=lightblue ]
+
"../sources/screen1/video.avs" -> "../sources/screen1/common.avs" [label="includes" style=dashed color=lightblue ]
+
"../sources/cam1/common.avs" -> "../lib/lib.avs" [label="includes" style=dashed color=lightblue ]
+
"../sources/cam1/sa-sample-camera.avi.meta" [style=filled fillcolor=lightgrey]
+
"../sources/cam1/source.py" -> "../sources/cam1/sa-sample-camera.avi.meta" [label="includes" style=dashed color=lightblue ]
+
"../sources/screen1/video.avs$vbitrate=800.avi" [style=filled fillcolor=lightgrey]
+
"2012-08-08-test.uncut" -> "../sources/screen1/video.avs$vbitrate=800.avi" [label="includes" style=dashed color=lightblue ]
+
"../sources/screen1/sa-sample-screencast.avi.meta" [style=filled fillcolor=lightgrey]
+
"../sources/screen1/sa-sample-screencast.avi" [style=filled fillcolor=yellow]
+
"../sources/screen1/sa-sample-screencast.avi.meta" -> "../sources/screen1/sa-sample-screencast.avi" [label="parent" style=solid color=darkblue ]
+
"../sources/screen1/sa-sample-screencast.avi.meta" [style=filled fillcolor=lightgrey]
+
"../sources/screen1/source.py" -> "../sources/screen1/sa-sample-screencast.avi.meta" [label="includes" style=dashed color=lightblue ]
+
"../sources/screen1/source.py.avs" [style=filled fillcolor=lightgrey]
+
"../sources/screen1/source.py.avs" -> "../sources/screen1/source.py" [label="parent" style=solid color=darkblue ]
+
"../sources/screen1/source.py.avs" [style=filled fillcolor=lightgrey]
+
"../sources/screen1/sa-sample-screencast.avi" [style=filled fillcolor=yellow]
+
"../sources/screen1/source.py.avs" -> "../sources/screen1/sa-sample-screencast.avi" [label="includes" style=dashed color=lightblue ]
+
"../sources/cam1/video.avs$vbitrate=700.avi" [style=filled fillcolor=lightgrey]
+
"2012-08-08-test.uncut" -> "../sources/cam1/video.avs$vbitrate=700.avi" [label="includes" style=dashed color=lightblue ]
+
 
}
 
}
 
</graph>
 
</graph>
  
== Синхронизация через просмотр ==
 
=== sources/cam1 .-. ===
 
Подгоним скринкаст под камеру!
 
  
Просмотрим файл с камерой:
+
=== cam2/audio.avs .-. ===
sa view sa-sample-camera.avi
+
 
   
+
<code-perl>
* Найдите какое-нибудь {{!|событие на экране}}
+
#Audio AVS-script, for opening with WAVSource function.
* Листание:
+
#Time-adjusted according to start-time.py
;Грубое: {{!|SHIFT←→}}, PgUp/PgDown, таймлайн.
+
 
;Точное: ←→
+
import("common.avs")
* {{!|CTRL-G}}: «Go-To Frame»
+
audio = AVISource("source.py.avs").KillVideo()
* {{!|CTRL-A/CTRL-C}} → {{!|время в клипборд}}
+
 
 +
#Uncomment following lines, if you want to use external audio file.
 +
import("start_time.py.avs")
 +
#audio  = WavSource("source.avs.wav")
 +
audio  = audio.TrimAudioMS(TRIM_START_MS)
 +
 
 +
audio
 +
</code-perl>
 +
 
 +
=== screen1/audio.avs .-. ===
 +
 
 +
<code-perl>
 +
#Audio AVS-script, for opening with WAVSource function.
 +
#Time-adjusted according to timediff.py
 +
 
 +
import("common.avs")
 +
import("start_time.py.avs")
 +
 
 +
#[Un]comment following lines, if you want/not want to use internal audio channel.
 +
audio  = AVISource("source.py.avs").KillVideo()
 +
 
 +
#[Un]comment following lines, if you want/not want to use external audio file.
 +
#audio  = WavSource("audio.wav")
 +
 
 +
#[Un]comment following lines, if you want/not want to use screen2log datas
 +
#import("screen2log_audio.avs")
 +
#audio  = screen2log_audio()
  
=== sources/screen1 .-. ===
 
  
;start_time.py: вписываем время из клипборда
+
audio = audio.TrimAudioMS(TRIM_START_MS)
  their_time_ms = ut.time2ms('0:00')
+
audio
 +
</code-perl>
  
Просмотрим скринкаст, время того же события в клипборд
 
sa v sa-sample-screencast.avi
 
  
;start_time.py: вписываем время
+
== Попробуйте синхронизовать! .-. ==
  my_time_ms = ut.time2ms('0:00')
+
  
== SA BUILD .-. ==
+
Правильные ответы (мои, смотреть файлы <tt>start_time.py.avs</tt>):
 +
;cam1: 0
 +
;cam2: 19680
 +
;screen1: 12456
  
В папке {{!|scenes}}, запустить
+
Синхронизация:
 +
* камера/screencast: {{!|±секунда}} — ОК
 +
* жесты/речь: {{!|±800мс}} — ОК.
 +
* губы/речь: {{@|±150мс}} — ОК (лучше {{@|±50мс}}).
 +
* сложение двух звуковых потоков — {{@|±25мс}}
  
sa b 2012-08-08-test.uncut.mkv
+
== Задания .-. ==
 +
;Бонус задание: синхронизируйте
 +
* относительно сam2
 +
* относительно screen1
  
 +
* Проверьте синхронизацию с разной глубиной <tt>--start</tt>
  
* Заняться своими делами.
+
* Соберите матрешку
  
Когда закончит, проверить, что <tt>2012-08-08-test.uncut.mkv</tt> — играется, и каналы {{!|синхронны}}.
+
== Должно получится … .-. ==
  
См. http://wiki.4intra.net/Matroska4seminars-stas-fomin
+
Устройства ввода, эмоции, направление взгляда
 +
<slides split="----">
 +
[[File:SeminarAssembler для UX sessions.png|center]]
 +
----
 +
[[File:SeminarAssembler для UX sessions-2.png|center]]
 +
----
 +
[[File:SeminarAssembler для UX sessions-3.png|center]]
 +
</slides>
  
 
== ВСЕ! .-. ==
 
== ВСЕ! .-. ==
Line 165: Line 183:
 
Этого достаточно:
 
Этого достаточно:
 
* Монтировать 95% внутрикомпанейских видео.
 
* Монтировать 95% внутрикомпанейских видео.
 +
** Не приходя в сознание!
 
* MKV-публикуется на файл-сервере.
 
* MKV-публикуется на файл-сервере.
 
* Ссылки на отрывки с вики-системы.
 
* Ссылки на отрывки с вики-системы.

Latest revision as of 19:21, 13 September 2012

Title

«SA SYNC»
Author
Stas Fomin
Subfooter

Stas Fomin, 19:21, 13 September 2012


SA: продвинутая синхронизация .-.

Задание «SA INIT» уже выполнено? Если нетSA INIT


Берем

  • запись с двух камер
  • скринкаст

Синхронизируем

  • по звуку
  • событию (на глаз) + по звуку

Делаем «Матрешку»

Исходники .-.

Создаем тестовый проект

sa-test4sync-cam.avi
cam1
sa-test4sync-keyboard.avi
cam2
sa-test4sync-screencast.avi
screen1

Потоки .-.

Потоки в SA. Синхронизация по звуку.svg
SA синхронизация по звуку.png
Потоки в SA. Синхронизация по звуку.svg

start_time.py .-.

REFERENCE_STREAM={}
 
#Uncomment this (and modify appropriately) if you want to time linking to other stream
#execfile(ut.get_script_dir() + '/../cam1/start_time.py', globals(), REFERENCE_STREAM)
 
diff_ms = 0
if 'START' in REFERENCE_STREAM:
   diff_ms = REFERENCE_STREAM['START']   
 
# Linking by some visible event
their_time_ms = ut.time2ms('1:23')         # Time of the event on reference stream
my_time_ms = ut.time2ms('53:45')            # Time of the event on visible stream
 
diff_ms += int(my_time_ms - their_time_ms)
diff_ms += 1234
 
START = diff_ms
AVS = "global TRIM_START_MS  = %(diff_ms)s " % vars()

cam2/… .-.

[svg]


cam2/audio.avs .-.

#Audio AVS-script, for opening with WAVSource function.
#Time-adjusted according to start-time.py
 
import("common.avs")
audio  = AVISource("source.py.avs").KillVideo()
 
#Uncomment following lines, if you want to use external audio file.
import("start_time.py.avs")
#audio  = WavSource("source.avs.wav")
audio  = audio.TrimAudioMS(TRIM_START_MS)
 
audio

screen1/audio.avs .-.

#Audio AVS-script, for opening with WAVSource function.
#Time-adjusted according to timediff.py
 
import("common.avs")
import("start_time.py.avs")
 
#[Un]comment following lines, if you want/not want to use internal audio channel.
audio  = AVISource("source.py.avs").KillVideo()
 
#[Un]comment following lines, if you want/not want to use external audio file.
#audio  = WavSource("audio.wav")
 
#[Un]comment following lines, if you want/not want to use screen2log datas
#import("screen2log_audio.avs")
#audio  = screen2log_audio()
 
 
audio  = audio.TrimAudioMS(TRIM_START_MS)
audio


Попробуйте синхронизовать! .-.

Правильные ответы (мои, смотреть файлы start_time.py.avs):

cam1
0
cam2
19680
screen1
12456

Синхронизация:

  • камера/screencast: ±секунда — ОК
  • жесты/речь: ±800мс — ОК.
  • губы/речь: ±150мс — ОК (лучше ±50мс).
  • сложение двух звуковых потоков — ±25мс

Задания .-.

Бонус задание
синхронизируйте
  • относительно сam2
  • относительно screen1
  • Проверьте синхронизацию с разной глубиной --start
  • Соберите матрешку

Должно получится … .-.

Устройства ввода, эмоции, направление взгляда

SeminarAssembler для UX sessions.png
SeminarAssembler для UX sessions-2.png
SeminarAssembler для UX sessions-3.png

ВСЕ! .-.

Этого достаточно:

  • Монтировать 95% внутрикомпанейских видео.
    • Не приходя в сознание!
  • MKV-публикуется на файл-сервере.
  • Ссылки на отрывки с вики-системы.