Presentation is loading. Please wait.

Presentation is loading. Please wait.

MP 1: Audio/ Video Recorder and Player CS414: Multimedia System Instructor: Klara Nahrstedt February 7 th, 2012.

Similar presentations


Presentation on theme: "MP 1: Audio/ Video Recorder and Player CS414: Multimedia System Instructor: Klara Nahrstedt February 7 th, 2012."— Presentation transcript:

1 MP 1: Audio/ Video Recorder and Player CS414: Multimedia System Instructor: Klara Nahrstedt February 7 th, 2012

2 Learning Goals Capturing a video and audio using a webcam Storing the audio and video data in PC using compression Playing a video from the stored file with fast forward, rewind, pause and play functionalities Playing an audio from the stored file Comparing the media frames across different compression

3 Covered Aspects of Multimedia Image/Video Capture Media Server Storage Transmission Compression Processing Audio/Video Presentation Playback Audio/Video Perception/ Playback Audio Information Representation Transmission Audio Capture A/V Playback Image/Video Information Representation

4 System Architecture Image/Video Capture Compression Processing Audio Information Representation Audio Capture Image/Video Information Representation Audio/Video Perception/ Playback

5 Capture System Modules and Data Flow: Recording Filter Encoder Store Player Thread Webcam Thread Encode Store Muxer … You need to create separate threads Muxer is optional. You may need it to run the video file using standard player Frame rate, resolution type Encode …

6 System Modules and Data Flow: Playback Capture Decode Player Media File Capture Decode Demuxer … Display the video on your GUI and place the audio data to the sound card Demuxer is optional. You may need it run standard video files from Internet type Rate control Decode …

7 System Modules and Data Flow: Monitoring in Recording Capture Filter Encode Store Player Thread Monitoring Point Monitoring Component Webcam Thread Store the monitoring output to a file [Optional] You may draw chart showing [time vs. compression ratio (r)], [time vs. compression time (t)] and [time vs. frame size (s)] [bonus point] – X-axis: Time in 5 second interval – Y-axis: Average values (of r, s or t) in last 5 seconds

8 System Modules and Data Flow: Monitoring in Playback Capture Decode Player Monitoring Component Thread Media File Thread Monitoring Point Store the monitoring output to a file [Optional] You may draw plot showing [time vs. decompression time (d)] [bonus point] [Hint: Try JFreeChart library] – X-axis: Time in 5 second interval – Y-axis: Average values (of d) in last 5 seconds

9 gstreamer Architecture Goal: create a multimedia application using gstreamer gstreamer uses 3 rd party plugins for processing (over 150) gstreamer Core Framework Multimedia Application Encoder Decoder Muxer Sink source Demuxer 3 rd Party plugins

10 How does it work (1) ? You need to create element for each system modules Elements are equipped with Pads: source and sink pads Sink Source gstreamer elements The number of source and sink pad varies depending on the element type You can add/ create additional sink or source pad

11 Creating gstreamer elements Java code example to create an element –Elements element_name = ElementFactory.make (“plugin name”, “your defined name”) Java code example to set element property –element_name.set(“property”, “value”) Capture source Filter Sink Src filter Encode Sink Src encoder Muxer Sink Src muxer Store Sink sink Src Sink

12 How does it work (2) ? You need to link the elements – Linking define whom is receiving and sending data to whom – This is similar to linking the system modules Capture Filter Src Sink Src Media Source Media Filter

13 gstreamer-java pipeline Java example code for creating, and linking a pipeline –Pipeline pipe= new Pipeline(“test”); –pipe.addMany(source, filter,encoder, muxer,sink); –Element.linkMany(source, filter,encoder, muxer,sink); –pipe.play(); Capture Filter Encode Store Webcam Src Sink Src Sink Src Media Source Media Filter Media Encoder Sink Src Media Muxer Sink Media Sink

14 How to create multiple pipelining Several pipelines from the same source or towards same sink – Example: recording and playback at the same time Capture Filter Encoder Store Player Thread Webcam Thread Sink Src Sink Src Sink Src Media Source Media Filter Media Encoder Sink Src Media Muxer Sink Media Sink Src

15 How to create multiple pipelining You can create additional pads You can use tee elements Use queue elements after tee Sink Src Sink Src source encoder Sink Src muxer Sink Media Sink Sink Src filter Sink Src tee Src queue2 queue1 Sink Src Sink Src

16 How to redirect frames to application How to deliver a frame to your application Use appsink element Src Sink Src Sink Src Media Source Media Filter Media Encoder Sink Src AppSink Java example code for getting frames from AppSink –AppSink appsink = (AppSink) ElementFactory.make(“appsink”, null); –appsink.set(“emit-signal”, true); –appsink.setSync(false); Emit Signals

17 Some gstreamer plugins Video webcam source: v4l2src Audio webcam source: alsasrc Video or Audio file source: filesrc Video Encoder: ffenc_mpeg4 (mpeg4), jpegenc (mjpeg), … Video Decoder: ffdec_mpeg4 (mpeg4), jpegdec (mjpeg), … Audio Encoder: vorbisenc, alawenc, mulawenc Audio Decoder: vorbisdec, alawdec, mulawdec Muxer [optional]: avimux (avi), matroskamux(mkv), … Demuxer [optional]: avidemux (avi), Audio sink: alsasink

18 Evaluations Required Points: 100, Optional Points: 20 Points are will be considered based on live demo and interview performance

19 Environment and Equipment Choose what ever language you like, Gstreamer is compatible with most popular languages C/C++JAVA http://docs.gstreamer.com/display/G stSDK/Tutorials https://code.google.com/p/gstreame r-java/ Up-to-date detailed tutorials, step- by-step runnable sample codes  Brief introduction, few samples  Requires external GUI libraries: GTK+(used in the tutorial site), Qt (very powerful) Built-in GUI libraries Not supported by EWS (installation of external lib) Supported by EWS

20 Environment and Equipment If you choose to use EWS.. – group directories – /team/cs414/G# (# is your group number) If you choose to use your own machines.. – Windows/Mac – Android/iOS Feel free to use your own camera/mic, or you can borrow two logitech cameras (with mic embedded) from Engineering IT (Barb Leisner)


Download ppt "MP 1: Audio/ Video Recorder and Player CS414: Multimedia System Instructor: Klara Nahrstedt February 7 th, 2012."

Similar presentations


Ads by Google