
Recherche avancée
Médias (91)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
-
Les Miserables
4 juin 2012, par
Mis à jour : Février 2013
Langue : English
Type : Texte
-
Ne pas afficher certaines informations : page d’accueil
23 novembre 2011, par
Mis à jour : Novembre 2011
Langue : français
Type : Image
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Richard Stallman et la révolution du logiciel libre - Une biographie autorisée (version epub)
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (47)
-
Taille des images et des logos définissables
9 février 2011, parDans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...) -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
Sur d’autres sites (6905)
-
ffmpeg : cannot copy data stream
I've got the mp4 video file captured by DJI drone. The file contains the video stream and two data streams of unknown format. I would like to convert the video from h.264 to h.265 and also save the both data streams. Unfortunately, I cannot force ffmpeg to copy the data streams from input to the output.


Here is the mp4 file :


ffprobe DJI_0019.MP4


[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5631004c2730] stream 0, timescale not set
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'DJI_0019.MP4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 creation_time : replaced_timestamp
 encoder : DJIMavic3
 Duration: 00:01:05.66, start: 0.000000, bitrate: 128915 kb/s
 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 3840x2160, 127648 kb/s, 29.41 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
 Metadata:
 creation_time : replaced_timestamp
 handler_name : VideoHandler
 vendor_id : [0][0][0][0]
 Stream #0:1(und): Data: none (djmd / 0x646D6A64), 13 kb/s
 Metadata:
 creation_time : replaced_timestamp
 handler_name : DJI meta
 Stream #0:2(und): Data: none (dbgi / 0x69676264), 1190 kb/s
 Metadata:
 creation_time : replaced_timestamp
 handler_name : DJI dbgi
 Stream #0:3: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 960x540 [SAR 1:1 DAR 16:9], 90k tbr, 90k tbn, 90k tbc (attached pic)
Unsupported codec with id 0 for input stream 1
Unsupported codec with id 0 for input stream 2



I tried the command below :


ffmpeg -i DJI_0019.MP4 -map 0 -c:v libx265 -crf 25 -c:d copy -copy_unknown DJI_0019.v2.MP4


The command fails with the following error. The output file is empty.


[mp4 @ 0x556d0180ced0] Could not find tag for codec none in stream #1, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 --



Note that for "-c:d" option I tried different suggested values, none of them succeeded :


copy
none
bin
bin_data
data
null
file



In the meantime an attempt to save the data streams to separate files succeeds for the both of them with the commands :


ffmpeg -i DJI_0019.MP4 -map 0:d:0 -c copy -copy_unknown -f data DJI_0019.data0.bin


ffmpeg -i DJI_0019.MP4 -map 0:d:1 -c copy -copy_unknown -f data DJI_0019.data1.bin


How to force ffmpeg to copy the data streams from input to output ?


This is the ffmpeg's info :


ffmpeg version 4.4.3 Copyright (c) 2000-2022 the FFmpeg developers
 built with gcc 11.3.0 (Gentoo 11.3.0 p5)
 configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 
--docdir=/usr/share/doc/ffmpeg-4.4.3/html --mandir=/usr/share/man --enable-shared 
--cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar 
--nm=x86_64-pc-linux-gnu-nm --strip=x86_64-pc-linux-gnu-strip 
--ranlib=x86_64-pc-linux-gnu-ranlib --pkg-config=x86_64-pc-linux-gnu-pkg-config 
--optflags='-O2 -pipe -march=native' --disable-static --enable-avfilter --enable-avresample 
--disable-stripping --disable-optimizations --disable-libcelt --disable-indev=oss 
--disable-indev=jack --disable-indev=sndio --disable-outdev=oss --disable-outdev=sndio 
--enable-nonfree --enable-bzlib --disable-runtime-cpudetect --disable-debug --disable-gcrypt 
--enable-gnutls --disable-gmp --enable-gpl --disable-hardcoded-tables --enable-iconv 
--disable-libxml2 --disable-lzma --enable-network --disable-opencl --disable-openssl 
--enable-postproc --disable-libsmbclient --enable-ffplay --enable-sdl2 --disable-vaapi 
--disable-vdpau --disable-vulkan --enable-xlib --enable-libxcb --enable-libxcb-shm 
--enable-libxcb-xfixes --enable-zlib --enable-libcdio --disable-libiec61883 
--disable-libdc1394 --enable-libcaca --disable-openal --disable-opengl --enable-libv4l2 
--disable-libpulse --disable-libdrm --disable-libjack --disable-libopencore-amrwb 
--disable-libopencore-amrnb --disable-libcodec2 --enable-libdav1d --enable-libfdk-aac 
--disable-libopenjpeg --disable-libbluray --disable-libgme --disable-libgsm 
--disable-libaribb24 --disable-mmal --disable-libmodplug --disable-libopus 
--disable-libilbc --disable-librtmp --disable-libssh --disable-libspeex --disable-libsrt 
--disable-librsvg --disable-ffnvcodec --disable-libvorbis --disable-libvpx --disable-libzvbi 
--disable-appkit --disable-libbs2b --disable-chromaprint --disable-cuda-llvm 
--disable-libflite --disable-frei0r --disable-libvmaf --disable-libfribidi 
--disable-fontconfig --disable-ladspa --enable-libass --disable-libtesseract 
--disable-lv2 --disable-libfreetype --disable-libvidstab --disable-librubberband 
--disable-libzmq --disable-libzimg --disable-libsoxr --enable-pthreads --disable-amf 
--disable-libvo-amrwbenc --disable-libkvazaar --disable-libaom --enable-libmp3lame 
--disable-libopenh264 --disable-librav1e --disable-libsnappy --disable-libsvtav1 
--disable-libtheora --disable-libtwolame --disable-libwebp --enable-libx264 --enable-libx265 
--enable-libxvid --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-neon 
--disable-vfp --disable-vfpv3 --disable-armv8 --disable-mipsdsp --disable-mipsdspr2 
--disable-mipsfpu --disable-altivec --disable-vsx --disable-power8 --disable-amd3dnow 
--disable-amd3dnowext --disable-aesni --disable-avx --disable-avx2 --disable-fma3 
--disable-fma4 --disable-sse3 --disable-ssse3 --disable-sse4 --disable-sse42 --disable-xop 
--cpu=host --disable-doc --disable-htmlpages --enable-manpages
 libavutil 56. 70.100 / 56. 70.100
 libavcodec 58.134.100 / 58.134.100
 libavformat 58. 76.100 / 58. 76.100
 libavdevice 58. 13.100 / 58. 13.100
 libavfilter 7.110.100 / 7.110.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 9.100 / 5. 9.100
 libswresample 3. 9.100 / 3. 9.100
 libpostproc 55. 9.100 / 55. 9.100



-
RTP packets detected as UDP
28 février 2017, par user3172852Here is what I am trying to do :
WebRTC endpoint > RTP Endpoint > ffmpeg > RTMP server.
This is what my SDP file looks like.
var cm_offer = "v=0\n" +
"o=- 3641290734 3641290734 IN IP4 127.0.0.1\n" +
"s=nginx\n" +
"c=IN IP4 127.0.0.1\n" +
"t=0 0\n" +
"m=audio 60820 RTP/AVP 0\n" +
"a=rtpmap:0 PCMU/8000\n" +
"a=recvonly\n" +
"m=video 59618 RTP/AVP 101\n" +
"a=rtpmap:101 H264/90000\n" +
"a=recvonly\n";What’s happening is that wireshark can detect the incoming packets at port 59618, but not as RTP packets but UDP packets. I am trying to capture the packets using ffmpeg with the following command :
ubuntu@ip-132-31-40-100:~$ ffmpeg -i udp://127.0.0.1:59618 -vcodec copy stream.mp4
ffmpeg version git-2017-01-22-f1214ad Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab --enable-libwavpack --enable-nvenc
libavutil 55. 44.100 / 55. 44.100
libavcodec 57. 75.100 / 57. 75.100
libavformat 57. 63.100 / 57. 63.100
libavdevice 57. 2.100 / 57. 2.100
libavfilter 6. 69.100 / 6. 69.100
libavresample 3. 2. 0 / 3. 2. 0
libswscale 4. 3.101 / 4. 3.101
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.100All I get is a blinking cursor and The stream.mp4 file is not written to disk after I exit (ctrl+c).
So can you help me figure out :
- why wireshark cannot detect the packets as RTP (I suspect it has something to do with SDP)
- How to handle SDP answer when the RTP endpoint is pushing to ffmpeg which doesn’t send an answer back.
Here is the entire code (hello world tutorial modified)
/*
* (C) Copyright 2014-2015 Kurento (http://kurento.org/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function getopts(args, opts)
{
var result = opts.default || {};
args.replace(
new RegExp("([^?=&]+)(=([^&]*))?", "g"),
function($0, $1, $2, $3) { result[$1] = decodeURI($3); });
return result;
};
var args = getopts(location.search,
{
default:
{
ws_uri: 'wss://' + location.hostname + ':8433/kurento',
ice_servers: undefined
}
});
function setIceCandidateCallbacks(webRtcPeer, webRtcEp, onerror)
{
webRtcPeer.on('icecandidate', function(candidate) {
console.log("Local candidate:",candidate);
candidate = kurentoClient.getComplexType('IceCandidate')(candidate);
webRtcEp.addIceCandidate(candidate, onerror)
});
webRtcEp.on('OnIceCandidate', function(event) {
var candidate = event.candidate;
console.log("Remote candidate:",candidate);
webRtcPeer.addIceCandidate(candidate, onerror);
});
}
function setIceCandidateCallbacks2(webRtcPeer, rtpEp, onerror)
{
webRtcPeer.on('icecandidate', function(candidate) {
console.log("Localr candidate:",candidate);
candidate = kurentoClient.getComplexType('IceCandidate')(candidate);
rtpEp.addIceCandidate(candidate, onerror)
});
}
window.addEventListener('load', function()
{
console = new Console();
var webRtcPeer;
var pipeline;
var webRtcEpt;
var videoInput = document.getElementById('videoInput');
var videoOutput = document.getElementById('videoOutput');
var startButton = document.getElementById("start");
var stopButton = document.getElementById("stop");
startButton.addEventListener("click", function()
{
showSpinner(videoInput, videoOutput);
var options = {
localVideo: videoInput,
remoteVideo: videoOutput
};
if (args.ice_servers) {
console.log("Use ICE servers: " + args.ice_servers);
options.configuration = {
iceServers : JSON.parse(args.ice_servers)
};
} else {
console.log("Use freeice")
}
webRtcPeer = kurentoUtils.WebRtcPeer.WebRtcPeerSendrecv(options, function(error)
{
if(error) return onError(error)
this.generateOffer(onOffer)
});
function onOffer(error, sdpOffer)
{
if(error) return onError(error)
kurentoClient(args.ws_uri, function(error, client)
{
if(error) return onError(error);
client.create("MediaPipeline", function(error, _pipeline)
{
if(error) return onError(error);
pipeline = _pipeline;
pipeline.create("WebRtcEndpoint", function(error, webRtc){
if(error) return onError(error);
webRtcEpt = webRtc;
setIceCandidateCallbacks(webRtcPeer, webRtc, onError)
webRtc.processOffer(sdpOffer, function(error, sdpAnswer){
if(error) return onError(error);
webRtcPeer.processAnswer(sdpAnswer, onError);
});
webRtc.gatherCandidates(onError);
webRtc.connect(webRtc, function(error){
if(error) return onError(error);
console.log("Loopback established");
});
});
pipeline.create("RtpEndpoint", function(error, rtp){
if(error) return onError(error);
//setIceCandidateCallbacks2(webRtcPeer, rtp, onError)
var cm_offer = "v=0\n" +
"o=- 3641290734 3641290734 IN IP4 127.0.0.1\n" +
"s=nginx\n" +
"c=IN IP4 127.0.0.1\n" +
"t=0 0\n" +
"m=audio 60820 RTP/AVP 0\n" +
"a=rtpmap:0 PCMU/8000\n" +
"a=recvonly\n" +
"m=video 59618 RTP/AVP 101\n" +
"a=rtpmap:101 H264/90000\n" +
"a=recvonly\n";
rtp.processOffer(cm_offer, function(error, cm_sdpAnswer){
if(error) return onError(error);
//webRtcPeer.processAnswer(cm_sdpAnswer, onError);
});
//rtp.gatherCandidates(onError);
webRtcEpt.connect(rtp, function(error){
if(error) return onError(error);
console.log("RTP endpoint connected to webRTC");
});
});
});
});
}
});
stopButton.addEventListener("click", stop);
function stop() {
if (webRtcPeer) {
webRtcPeer.dispose();
webRtcPeer = null;
}
if(pipeline){
pipeline.release();
pipeline = null;
}
hideSpinner(videoInput, videoOutput);
}
function onError(error) {
if(error)
{
console.error(error);
stop();
}
}
})
function showSpinner() {
for (var i = 0; i < arguments.length; i++) {
arguments[i].poster = 'img/transparent-1px.png';
arguments[i].style.background = "center transparent url('img/spinner.gif') no-repeat";
}
}
function hideSpinner() {
for (var i = 0; i < arguments.length; i++) {
arguments[i].src = '';
arguments[i].poster = 'img/webrtc.png';
arguments[i].style.background = '';
}
}
/**
* Lightbox utility (to display media pipeline image in a modal dialog)
*/
$(document).delegate('*[data-toggle="lightbox"]', 'click', function(event) {
event.preventDefault();
$(this).ekkoLightbox();
}); -
RTP packets detected as UDP
8 juillet 2024, par fritzHere is what I am trying to do :



WebRTC endpoint > RTP Endpoint > ffmpeg > RTMP server.




This is what my SDP file looks like.



var cm_offer = "v=0\n" +
 "o=- 3641290734 3641290734 IN IP4 127.0.0.1\n" +
 "s=nginx\n" +
 "c=IN IP4 127.0.0.1\n" +
 "t=0 0\n" +
 "m=audio 60820 RTP/AVP 0\n" +
 "a=rtpmap:0 PCMU/8000\n" +
 "a=recvonly\n" +
 "m=video 59618 RTP/AVP 101\n" +
 "a=rtpmap:101 H264/90000\n" +
 "a=recvonly\n";




What's happening is that wireshark can detect the incoming packets at port 59618, but not as RTP packets but UDP packets. I am trying to capture the packets using ffmpeg with the following command :



ubuntu@ip-132-31-40-100:~$ ffmpeg -i udp://127.0.0.1:59618 -vcodec copy stream.mp4
ffmpeg version git-2017-01-22-f1214ad Copyright (c) 2000-2017 the FFmpeg developers
 built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
 configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab --enable-libwavpack --enable-nvenc
 libavutil 55. 44.100 / 55. 44.100
 libavcodec 57. 75.100 / 57. 75.100
 libavformat 57. 63.100 / 57. 63.100
 libavdevice 57. 2.100 / 57. 2.100
 libavfilter 6. 69.100 / 6. 69.100
 libavresample 3. 2. 0 / 3. 2. 0
 libswscale 4. 3.101 / 4. 3.101
 libswresample 2. 4.100 / 2. 4.100
 libpostproc 54. 2.100 / 54. 2.100 




All I get is a blinking cursor and The stream.mp4 file is not written to disk after I exit (ctrl+c).



So can you help me figure out :



- 

- why wireshark cannot detect the packets as RTP (I suspect it has something to do with SDP)
- How to handle SDP answer when the RTP endpoint is pushing to ffmpeg which doesn't send an answer back.







Here is the entire code (hello world tutorial modified)



/*
 * (C) Copyright 2014-2015 Kurento (http://kurento.org/)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

 function getopts(args, opts)
 {
 var result = opts.default || {};
 args.replace(
 new RegExp("([^?=&]+)(=([^&]*))?", "g"),
 function($0, $1, $2, $3) { result[$1] = decodeURI($3); });

 return result;
 };

 var args = getopts(location.search,
 {
 default:
 {
 ws_uri: 'wss://' + location.hostname + ':8433/kurento',
 ice_servers: undefined
 }
 });

 function setIceCandidateCallbacks(webRtcPeer, webRtcEp, onerror)
 {
 webRtcPeer.on('icecandidate', function(candidate) {
 console.log("Local candidate:",candidate);

 candidate = kurentoClient.getComplexType('IceCandidate')(candidate);

 webRtcEp.addIceCandidate(candidate, onerror)
 });

 webRtcEp.on('OnIceCandidate', function(event) {
 var candidate = event.candidate;

 console.log("Remote candidate:",candidate);

 webRtcPeer.addIceCandidate(candidate, onerror);
 });
 }


 function setIceCandidateCallbacks2(webRtcPeer, rtpEp, onerror)
 {
 webRtcPeer.on('icecandidate', function(candidate) {
 console.log("Localr candidate:",candidate);

 candidate = kurentoClient.getComplexType('IceCandidate')(candidate);

 rtpEp.addIceCandidate(candidate, onerror)
 });
 }


 window.addEventListener('load', function()
 {
 console = new Console();

 var webRtcPeer;
 var pipeline;
 var webRtcEpt;

 var videoInput = document.getElementById('videoInput');
 var videoOutput = document.getElementById('videoOutput');

 var startButton = document.getElementById("start");
 var stopButton = document.getElementById("stop");

 startButton.addEventListener("click", function()
 {
 showSpinner(videoInput, videoOutput);

 var options = {
 localVideo: videoInput,
 remoteVideo: videoOutput
 };


 if (args.ice_servers) {
 console.log("Use ICE servers: " + args.ice_servers);
 options.configuration = {
 iceServers : JSON.parse(args.ice_servers)
 };
 } else {
 console.log("Use freeice")
 }

 webRtcPeer = kurentoUtils.WebRtcPeer.WebRtcPeerSendrecv(options, function(error)
 {
 if(error) return onError(error)

 this.generateOffer(onOffer)
 });

 function onOffer(error, sdpOffer)
 {
 if(error) return onError(error)

 kurentoClient(args.ws_uri, function(error, client)
 {
 if(error) return onError(error);

 client.create("MediaPipeline", function(error, _pipeline)
 {
 if(error) return onError(error);

 pipeline = _pipeline;

 pipeline.create("WebRtcEndpoint", function(error, webRtc){
 if(error) return onError(error);

 webRtcEpt = webRtc;

 setIceCandidateCallbacks(webRtcPeer, webRtc, onError)

 webRtc.processOffer(sdpOffer, function(error, sdpAnswer){
 if(error) return onError(error);

 webRtcPeer.processAnswer(sdpAnswer, onError);
 });
 webRtc.gatherCandidates(onError);

 webRtc.connect(webRtc, function(error){
 if(error) return onError(error);

 console.log("Loopback established");
 });
 });



 pipeline.create("RtpEndpoint", function(error, rtp){
 if(error) return onError(error);

 //setIceCandidateCallbacks2(webRtcPeer, rtp, onError)


 var cm_offer = "v=0\n" +
 "o=- 3641290734 3641290734 IN IP4 127.0.0.1\n" +
 "s=nginx\n" +
 "c=IN IP4 127.0.0.1\n" +
 "t=0 0\n" +
 "m=audio 60820 RTP/AVP 0\n" +
 "a=rtpmap:0 PCMU/8000\n" +
 "a=recvonly\n" +
 "m=video 59618 RTP/AVP 101\n" +
 "a=rtpmap:101 H264/90000\n" +
 "a=recvonly\n";



 rtp.processOffer(cm_offer, function(error, cm_sdpAnswer){
 if(error) return onError(error);

 //webRtcPeer.processAnswer(cm_sdpAnswer, onError);
 });
 //rtp.gatherCandidates(onError);

 webRtcEpt.connect(rtp, function(error){
 if(error) return onError(error);

 console.log("RTP endpoint connected to webRTC");
 });
 });









 });
 });
 }
 });
 stopButton.addEventListener("click", stop);


 function stop() {
 if (webRtcPeer) {
 webRtcPeer.dispose();
 webRtcPeer = null;
 }

 if(pipeline){
 pipeline.release();
 pipeline = null;
 }

 hideSpinner(videoInput, videoOutput);
 }

 function onError(error) {
 if(error)
 {
 console.error(error);
 stop();
 }
 }
 })


 function showSpinner() {
 for (var i = 0; i < arguments.length; i++) {
 arguments[i].poster = 'img/transparent-1px.png';
 arguments[i].style.background = "center transparent url('img/spinner.gif') no-repeat";
 }
 }

 function hideSpinner() {
 for (var i = 0; i < arguments.length; i++) {
 arguments[i].src = '';
 arguments[i].poster = 'img/webrtc.png';
 arguments[i].style.background = '';
 }
 }

 /**
 * Lightbox utility (to display media pipeline image in a modal dialog)
 */
 $(document).delegate('*[data-toggle="lightbox"]', 'click', function(event) {
 event.preventDefault();
 $(this).ekkoLightbox();
 });