Recherche avancée

Médias (91)

Autres articles (42)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

  • Configuration spécifique d’Apache

    4 février 2011, par

    Modules spécifiques
    Pour la configuration d’Apache, il est conseillé d’activer certains modules non spécifiques à MediaSPIP, mais permettant d’améliorer les performances : mod_deflate et mod_headers pour compresser automatiquement via Apache les pages. Cf ce tutoriel ; mode_expires pour gérer correctement l’expiration des hits. Cf ce tutoriel ;
    Il est également conseillé d’ajouter la prise en charge par apache du mime-type pour les fichiers WebM comme indiqué dans ce tutoriel.
    Création d’un (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

Sur d’autres sites (3427)

  • FFMPEG TimeCode synchronization

    14 juin 2017, par Spadieri

    I have a problem with the length of a TS video file.

    Use Hauppauge QuadTV HD video capture card,

    ffprobe TS file

    {

    [STREAM]
    index=0
    codec_name=mpeg2video
    codec_long_name=MPEG-2 video
    profile=Main
    codec_type=video
    codec_time_base=1/25
    codec_tag_string=[2][0][0][0]
    codec_tag=0x0002
    width=720
    height=576
    coded_width=0
    coded_height=0
    has_b_frames=1
    sample_aspect_ratio=64:45
    display_aspect_ratio=16:9
    pix_fmt=yuv420p
    level=8
    color_range=tv
    color_space=unknown
    color_transfer=unknown
    color_primaries=unknown
    chroma_location=left
    field_order=tt
    timecode=N/A
    refs=1
    id=0x201
    r_frame_rate=25/1
    avg_frame_rate=25/1
    time_base=1/90000
    start_pts=4090681690
    start_time=45452.018778
    duration_ts=323618400
    duration=3595.760000
    bit_rate=N/A
    max_bit_rate=N/A
    bits_per_raw_sample=N/A
    nb_frames=N/A
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=0
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    [/STREAM]
    [STREAM]
    index=1
    codec_name=mp2
    codec_long_name=MP2 (MPEG audio layer 2)
    profile=unknown
    codec_type=audio
    codec_time_base=1/48000
    codec_tag_string=[4][0][0][0]
    codec_tag=0x0004
    sample_fmt=s16p
    sample_rate=48000
    channels=2
    channel_layout=stereo
    bits_per_sample=0
    id=0x28b
    r_frame_rate=0/0
    avg_frame_rate=0/0
    time_base=1/90000
    start_pts=4090672903
    start_time=45451.921144
    duration_ts=323585280
    duration=3595.392000
    bit_rate=192000
    max_bit_rate=N/A
    bits_per_raw_sample=N/A
    nb_frames=N/A
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=0
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    TAG:language=ita
    [/STREAM]
    [STREAM]
    index=2
    codec_name=dvb_teletext
    codec_long_name=DVB teletext
    profile=unknown
    codec_type=subtitle
    codec_tag_string=[6][0][0][0]
    codec_tag=0x0006
    width=N/A
    height=N/A
    id=0x241
    r_frame_rate=0/0
    avg_frame_rate=0/0
    time_base=1/90000
    start_pts=4090655137
    start_time=45451.723744
    duration_ts=323611200
    duration=3595.680000
    bit_rate=N/A
    max_bit_rate=N/A
    bits_per_raw_sample=N/A
    nb_frames=N/A
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=0
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    TAG:language=ita
    [/STREAM]
    [STREAM]
    index=3
    codec_name=mp2
    codec_long_name=MP2 (MPEG audio layer 2)
    profile=unknown
    codec_type=audio
    codec_time_base=1/48000
    codec_tag_string=[4][0][0][0]
    codec_tag=0x0004
    sample_fmt=s16p
    sample_rate=48000
    channels=1
    channel_layout=mono
    bits_per_sample=0
    id=0x2b7
    r_frame_rate=0/0
    avg_frame_rate=0/0
    time_base=1/90000
    start_pts=4090668157
    start_time=45451.868411
    duration_ts=323589600
    duration=3595.440000
    bit_rate=64000
    max_bit_rate=N/A
    bits_per_raw_sample=N/A
    nb_frames=N/A
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=0
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    TAG:language=Oth
    [/STREAM]
    [STREAM]
    index=4
    codec_name=mp2
    codec_long_name=MP2 (MPEG audio layer 2)
    profile=unknown
    codec_type=audio
    codec_time_base=1/48000
    codec_tag_string=[4][0][0][0]
    codec_tag=0x0004
    sample_fmt=s16p
    sample_rate=48000
    channels=2
    channel_layout=stereo
    bits_per_sample=0
    id=0x2b8
    r_frame_rate=0/0
    avg_frame_rate=0/0
    time_base=1/90000
    start_pts=4090663971
    start_time=45451.821900
    duration_ts=323585280
    duration=3595.392000
    bit_rate=192000
    max_bit_rate=N/A
    bits_per_raw_sample=N/A
    nb_frames=N/A
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=0
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    TAG:language=eng
    [/STREAM]
    [STREAM]
    index=5
    codec_name=unknown
    codec_long_name=unknown
    profile=unknown
    codec_type=unknown
    codec_tag_string=[5][0][0][0]
    codec_tag=0x0005
    id=0x7d2
    r_frame_rate=0/0
    avg_frame_rate=0/0
    time_base=1/90000
    start_pts=4090655137
    start_time=45451.723744
    duration_ts=323644953
    duration=3596.055033
    bit_rate=N/A
    max_bit_rate=N/A
    bits_per_raw_sample=N/A
    nb_frames=N/A
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=0
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    [/STREAM]
    [STREAM]
    index=6
    codec_name=unknown
    codec_long_name=unknown
    profile=unknown
    codec_type=unknown
    codec_tag_string=[11][0][0][0]
    codec_tag=0x000b
    id=0xbb9
    r_frame_rate=0/0
    avg_frame_rate=0/0
    time_base=1/90000
    start_pts=4090655137
    start_time=45451.723744
    duration_ts=323644953
    duration=3596.055033
    bit_rate=N/A
    max_bit_rate=N/A
    bits_per_raw_sample=N/A
    nb_frames=N/A
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=0
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    [/STREAM]

    }

    steps :

    1°- demux con ProjectX
    output :
    video.m2v (25 fps)
    audio.mp2

    ffmprobe video.m2v
    {


    [STREAM]
       index=0
       codec_name=mpeg2video
       codec_long_name=MPEG-2 video
       profile=Main
       codec_type=video
       codec_time_base=1/25
       codec_tag_string=[0][0][0][0]
       codec_tag=0x0000
       width=720
       height=576
       coded_width=0
       coded_height=0
       has_b_frames=1
       sample_aspect_ratio=64:45
       display_aspect_ratio=16:9
       pix_fmt=yuv420p
       level=8
       color_range=tv
       color_space=unknown
       color_transfer=unknown
       color_primaries=unknown
       chroma_location=left
       field_order=progressive
       timecode=N/A
       refs=1
       id=0x1e0
       r_frame_rate=25/1
       avg_frame_rate=25/1
       time_base=1/90000
       start_pts=48600
       start_time=0.540000
       duration_ts=322970400
       duration=3588.560000
       bit_rate=N/A
       max_bit_rate=N/A
       bits_per_raw_sample=N/A
       nb_frames=N/A
       nb_read_frames=N/A
       nb_read_packets=N/A
       DISPOSITION:default=0
       DISPOSITION:dub=0
       DISPOSITION:original=0
       DISPOSITION:comment=0
       DISPOSITION:lyrics=0
       DISPOSITION:karaoke=0
       DISPOSITION:forced=0
       DISPOSITION:hearing_impaired=0
       DISPOSITION:visual_impaired=0
       DISPOSITION:clean_effects=0
       DISPOSITION:attached_pic=0
       DISPOSITION:timed_thumbnails=0
       [/STREAM]

    }

    2° - Burn TimeCode with ffmpeg

    CL : "ffmpeg -i video.m2v -c:v mpeg2video -vf "drawtext=fontfile=courier.ttf: timecode='00\:00\:00\:00': r=25: x=10: y=10: fontcolor=white: box=1: fontsize=50: boxcolor=0x00000099" output.mpeg"

    ffmpeg output:
    {


    ffmpeg version N-85604-g207e6de Copyright (c) 2000-2017 the FFmpeg developers
       built with gcc 6.3.0 (GCC)
       configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
       libavutil      55. 61.100 / 55. 61.100
       libavcodec     57. 93.100 / 57. 93.100
       libavformat    57. 72.101 / 57. 72.101
       libavdevice    57.  7.100 / 57.  7.100
       libavfilter     6. 86.100 /  6. 86.100
       libswscale      4.  7.101 /  4.  7.101
       libswresample   2.  8.100 /  2.  8.100
       libpostproc    54.  6.100 / 54.  6.100
       Input #0, mpegvideo, from 'R2_TG2_20170607_13001.m2v':
       Duration: N/A, bitrate: N/A
       Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 1200k tbn, 50 tbc
       Stream mapping:
       Stream #0:0 -> #0:0 (mpeg2video (native) -> mpeg2video (native))
       Press [q] to stop, [?] for help
       [mpeg @ 00000000025eb760] VBV buffer size not set, using default size of 130KB
       If you want the mpeg file to be compliant to some specification
       Like DVD, VCD or others, make sure you set the correct buffer size
       Output #0, mpeg, to 'output.mpeg':
       Metadata:
       encoder         : Lavf57.72.101
       Stream #0:0: Video: mpeg2video (Main), yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 90k tbn, 25 tbc
       Metadata:
         encoder         : Lavc57.93.100 mpeg2video
       Side data:
         cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
       [mpeg2video @ 0000000002625020] ac-tex damaged at 1 3027.24 bitrate= 879.1kbits/s speed=  39x
       [mpeg2video @ 0000000002625020] Warning MVs not available
       [mpeg2video @ 0000000002625020] concealing 45 DC, 45 AC, 45 MV errors in I frame
       [mpeg2video @ 0000000002625020] Warning MVs not available56 bitrate= 846.8kbits/s speed=39.1x
       [mpeg2video @ 0000000002625020] concealing 1 DC, 1 AC, 1 MV errors in B frame
       frame=89714 fps=974 q=31.0 Lsize=  332412kB time=00:59:48.52 bitrate= 758.8kbits/s speed=  39x
       video:329859kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.774119%

    }

    As seen from the screenshots there are 14 frames of difference, and later rise to 35

    Can frames be damaged and ffmpeg skip them ?

    The video for the first 13 minutes is perfectly synchronized

    OriginalFrame Time

    OutputFrame Time

    3° - remux [output.mmpeg] with original audio [audio.mp2]

    CL: "ffmpeg -i output.mpeg -i originalAudio.mp2 -c:a copy -c:v copy finalOutput.mpeg"

    ffmpeg output:
    {


    ffmpeg version N-85604-g207e6de Copyright (c) 2000-2017 the FFmpeg developers
       built with gcc 6.3.0 (GCC)
       configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
       libavutil      55. 61.100 / 55. 61.100
       libavcodec     57. 93.100 / 57. 93.100
       libavformat    57. 72.101 / 57. 72.101
       libavdevice    57.  7.100 / 57.  7.100
       libavfilter     6. 86.100 /  6. 86.100
       libswscale      4.  7.101 /  4.  7.101
       libswresample   2.  8.100 /  2.  8.100
       libpostproc    54.  6.100 / 54.  6.100
       Input #0, mpeg, from 'output.mpeg':
       Duration: 00:59:48.56, start: 0.540000, bitrate: 758 kb/s
       Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, progressive), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
       [mp3 @ 0000000002894980] Estimating duration from bitrate, this may be inaccurate
       Input #1, mp3, from 'R2_TG2_20170607_13001.mp2':
       Duration: 00:59:48.55, start: 0.000000, bitrate: 192 kb/s
       Stream #1:0: Audio: mp2, 48000 Hz, stereo, s16p, 192 kb/s
       [mpeg @ 000000000289a880] VBV buffer size not set, using default size of 130KB
       If you want the mpeg file to be compliant to some specification
       Like DVD, VCD or others, make sure you set the correct buffer size
       Output #0, mpeg, to 'finalOutput.mpeg':
       Metadata:
       encoder         : Lavf57.72.101
       Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, progressive), 720x576 [SAR 64:45 DAR 16:9], q=2-31, 25 fps, 25 tbr, 90k tbn, 25 tbc
       Stream #0:1: Audio: mp2, 48000 Hz, stereo, s16p, 192 kb/s
       Stream mapping:
       Stream #0:0 -> #0:0 (copy)
       Stream #1:0 -> #0:1 (copy)
       Press [q] to stop, [?] for help
       [mpeg @ 000000000289a880] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
       frame=89714 fps=26872 q=-1.0 Lsize=  417232kB time=00:59:48.52 bitrate= 952.5kbits/s speed=1.07e+003x
       video:329859kB audio:84107kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.789151%

    }

    FinalOutput.mpeg has the same frames as output.mpeg
    I have several TransportStreams to process and everyone has a frame difference

    someone can help me to solve the problem ?

    I need FinalOutput.mpeg to be aligned frame by frame with the original and necessarily the video must impress the timecode.

    a possible solution would also be a replace "damaged" frame but I can not find out how to replace the skipped frames

    EDIT :

    i’ve tried to work from OriginalVideo.ts and extracted video with -map directly with FFMPEG but the result is the same

    CL : ffmpeg -i OriginalVideo.ts -map 0:0 -c:v copy output.h264

       ffmpeg version N-85604-g207e6de Copyright (c) 2000-2017 the FFmpeg developers
    built with gcc 6.3.0 (GCC)
    configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
    libavutil      55. 61.100 / 55. 61.100
    libavcodec     57. 93.100 / 57. 93.100
    libavformat    57. 72.101 / 57. 72.101
    libavdevice    57.  7.100 / 57.  7.100
    libavfilter     6. 86.100 /  6. 86.100
    libswscale      4.  7.101 /  4.  7.101
    libswresample   2.  8.100 /  2.  8.100
    libpostproc    54.  6.100 / 54.  6.100
    [mpeg2video @ 0000000000dd4c20] Invalid frame dimensions 0x0.
    Last message repeated 5 times
    [mp2 @ 0000000000dd7e00] Header missing
    [mp2 @ 0000000000dd8f20] Header missing
    [mpeg2video @ 0000000000dd4c20] Invalid frame dimensions 0x0.
    [mp2 @ 0000000000dd5b60] Header missing
    [mpegts @ 0000000000dd25a0] PES packet size mismatch
    Last message repeated 1 times
    [mpegts @ 0000000000dd25a0] Could not find codec parameters for stream 5 (Unknown: none ([5][0][0][0] / 0x0005)): unknown codec
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    [mpegts @ 0000000000dd25a0] Could not find codec parameters for stream 6 (Unknown: none ([11][0][0][0] / 0x000B)): unknown codec
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    Input #0, mpegts, from 'R2_TG2_20170607_13001.ts':
    Duration: 00:59:56.06, start: 45451.723744, bitrate: 5901 kb/s
    Program 3402
    Stream #0:0[0x201]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x28b](ita): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #0:2[0x241](ita): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Stream #0:3[0x2b7](Oth): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, mono, s16p, 64 kb/s
    Stream #0:4[0x2b8](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #0:5[0x7d2]: Unknown: none ([5][0][0][0] / 0x0005)
    Stream #0:6[0xbb9]: Unknown: none ([11][0][0][0] / 0x000B)
    Output #0, h264, to 'output.h264':
    Metadata:
    encoder         : Lavf57.72.101
    Stream #0:0: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], q=2-31, 25 fps, 25 tbr, 25 tbn, 25 tbc
    Stream mapping:
    Stream #0:0 -> #0:0 (copy)
    Press [q] to stop, [?] for help
    frame=89746 fps=6083 q=-1.0 Lsize= 2131869kB time=00:59:55.64 bitrate=4857.1kbits/s speed= 244x
    video:2131869kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%

    if i try to extract video in mpeg format FFMPEG retrive me following errors :

    ffmpeg version N-85604-g207e6de Copyright (c) 2000-2017 the FFmpeg developers
         built with gcc 6.3.0 (GCC)
         configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
         libavutil      55. 61.100 / 55. 61.100
         libavcodec     57. 93.100 / 57. 93.100
         libavformat    57. 72.101 / 57. 72.101
         libavdevice    57.  7.100 / 57.  7.100
         libavfilter     6. 86.100 /  6. 86.100
         libswscale      4.  7.101 /  4.  7.101
         libswresample   2.  8.100 /  2.  8.100
         libpostproc    54.  6.100 / 54.  6.100
       [mpeg2video @ 0000000002824c20] Invalid frame dimensions 0x0.
           Last message repeated 5 times
       [mp2 @ 0000000002827e00] Header missing
       [mp2 @ 0000000002828f20] Header missing
       [mpeg2video @ 0000000002824c20] Invalid frame dimensions 0x0.
       [mp2 @ 0000000002825b60] Header missing
       [mpegts @ 00000000028225a0] PES packet size mismatch
           Last message repeated 1 times
       [mpegts @ 00000000028225a0] Could not find codec parameters for stream 5 (Unknown: none ([5][0][0][0] / 0x0005)): unknown codec
       Consider increasing the value for the 'analyzeduration' and 'probesize' options
       [mpegts @ 00000000028225a0] Could not find codec parameters for stream 6 (Unknown: none ([11][0][0][0] / 0x000B)): unknown codec
       Consider increasing the value for the 'analyzeduration' and 'probesize' options
       Input #0, mpegts, from 'R2_TG2_20170607_13001.ts':
         Duration: 00:59:56.06, start: 45451.723744, bitrate: 5901 kb/s
         Program 3402
           Stream #0:0[0x201]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
           Stream #0:1[0x28b](ita): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 192 kb/s
           Stream #0:2[0x241](ita): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
           Stream #0:3[0x2b7](Oth): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, mono, s16p, 64 kb/s
           Stream #0:4[0x2b8](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 192 kb/s
           Stream #0:5[0x7d2]: Unknown: none ([5][0][0][0] / 0x0005)
           Stream #0:6[0xbb9]: Unknown: none ([11][0][0][0] / 0x000B)
       File 'output.mpeg' already exists. Overwrite ? [y/N] y
       [mpeg @ 000000000072bc80] VBV buffer size not set, using default size of 130KB
       If you want the mpeg file to be compliant to some specification
       Like DVD, VCD or others, make sure you set the correct buffer size
       Output #0, mpeg, to 'output.mpeg':
         Metadata:
           encoder         : Lavf57.72.101
           Stream #0:0: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], q=2-31, 25 fps, 25 tbr, 90k tbn, 25 tbc
       Stream mapping:
         Stream #0:0 -> #0:0 (copy)
       Press [q] to stop, [?] for help
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=1218 size=11754=4752.0kbits/s speed= 229x
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=3247 size=11754
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=5288 size=11754
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=7329 size=11754
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=9370 size=11754
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=11411 size=11754
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=1862 size=17826
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=3891 size=17826
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=5932 size=17826
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=7973 size=17826
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=10014 size=17826
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=12055 size=17826
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=14096 size=17826
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=16137 size=17826
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=875 size=88109e=4684.9kbits/s speed= 239x
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=2904 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=4945 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=6986 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=9027 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=11068 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=13109 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=15150 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=17191 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=19232 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=21273 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=23314 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=25355 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=27396 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=29437 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=31478 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=33519 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=35560 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=37601 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=39642 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=41683 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=43724 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=45765 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=47806 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=49847 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=51888 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=53929 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=55970 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=58011 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=60052 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=62093 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=64134 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=66175 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=68216 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=70257 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=72298 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=74339 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=76380 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=78421 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=80462 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=82503 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=84544 size=88109
       [mpeg @ 000000000072bc80] buffer underflow st=0 bufi=86585 size=88109
       frame=89746 fps=5348 q=-1.0 Lsize= 2140734kB time=00:59:55.60 bitrate=4877.3kbits/s speed= 214x
       video:2131869kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.415814%
  • Running ffmpeg command on Android results in "Unable to find a suitable output format for ' -map 0:v:0 -map 1:a:0'"

    5 juin 2017, par Akash Dubey

    I am using this command for replacing audio of video and genrate new video having new audio. Here file1 is my video.mp4, file2 is my audio.mp3 and output would be the output.mp4 :

    complexCommand = new String[]{"-y", "-i", file1.toString(), "-i", file2.toString(), "-c", "copy", " -map 0:v:0 -map 1:a:0", rootPath + "/output.mp4"};

    Below is My code :

       private void changeAudioofVideo(String selectedUri, String videoPath) {

       String[] complexCommand;


       File f = new File("/storage/emulated/0");
       if (!f.getParentFile().exists())
           f.getParentFile().mkdirs();
       if (!f.exists())
           try {
               f.createNewFile();
           } catch (IOException e) {
               e.printStackTrace();
           }

       file1 = new File(videoPath);
       if (file1.exists()) {
           Log.d("yes", "File 1 exists");
       } else {
           Log.d("no", "File 1 not exists");
       }

       file2 = new File(selectedUri);
       if (file2.exists()) {
           Log.d("yes", "File 1 exists");
       } else {
           Log.d("no", "File 1 not exists");
       }

       String rootPath = f.getPath();

       complexCommand = new String[]{"-y", "-i", file1.toString(), "-i", file2.toString(), "-c", "copy", " -map 0:v:0 -map 1:a:0", rootPath + "/output.mp4"};

       FFmpeg ffmpeg = FFmpeg.getInstance(this);

       try {
           //Load the binary
           ffmpeg.loadBinary(new LoadBinaryResponseHandler() {

               @Override
               public void onStart() {
               }

               @Override
               public void onFailure() {
               }

               @Override
               public void onSuccess() {
               }

               @Override
               public void onFinish() {
               }
           });
       } catch (FFmpegNotSupportedException e) {
           // Handle if FFmpeg is not supported by device
           Toast.makeText(getApplicationContext(), "Not Supported by Device", Toast.LENGTH_LONG).show();
       }

       try {

           final String finalRootPath = rootPath;
           ffmpeg.execute(complexCommand, new FFmpegExecuteResponseHandler() {
               @Override
               public void onSuccess(String message) {
                   Log.d("Success", message);

                   Toast.makeText(getApplicationContext(), "Successful" + finalRootPath.toString(), Toast.LENGTH_LONG).show();
                   Uri path = Uri.parse(finalRootPath + "/output.mp4");
                   playVideo(path.toString());

               }

               @Override
               public void onProgress(String message) {
                   Log.d("progress", message);
                   pd.show();
               }

               @Override
               public void onFailure(String message) {
                   Log.d("failure", message);
                   pd.dismiss();

               }

               @Override
               public void onStart() {
                   Log.d("Start", "merge started");
               }

               @Override
               public void onFinish() {
                   Log.d("finish", "merge finish");
                   pd.dismiss();
               }
           });
       } catch (FFmpegCommandAlreadyRunningException e) {
           e.printStackTrace();
       }


      }

    Below is my output :

      05-26 18:39:35.533 29188-29188/com.example.codal.videotm D/failure: ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
                                                                     built with gcc 4.8 (GCC)
                                                                     configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-and    roid/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
                                                                     libavutil      55. 17.103 / 55. 17.103
                                                                     libavcodec     57. 24.102 / 57. 24.102
                                                                     libavformat    57. 25.100 / 57. 25.100
                                                                     libavdevice    57.  0.101 / 57.  0.101
                                                                     libavfilter     6. 31.100 /  6. 31.100
                                                                     libswscale      4.  0.100 /  4.  0.100
                                                                     libswresample   2.  0.101 /  2.  0.101
                                                                     libpostproc    54.  0.100 / 54.  0.100
                                                                   Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/videokit/out2.mp4':
                                                                     Metadata:
                                                                       major_brand     : isom
                                                                       minor_version   : 512
                                                                       compatible_brands: isomiso2mp41
                                                                       encoder         : Lavf56.23.100
                                                                       comment         : Courtesy of National Geographic.  Used by Permission.
                                                                     Duration: 00:00:04.20, start: 0.046440, bitrate: 577 kb/s
                                                                       Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 160x120 [SAR 9:16 DAR 3:4], 521 kb/s, 30 fps, 30 tbr, 15360 tbn, 30 tbc (default)
                                                                       Metadata:
                                                                         handler_name    : VideoHandler
                                                                       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 22050 Hz, stereo, fltp, 50 kb/s (default)
                                                                       Metadata:
                                                                         handler_name    : SoundHandler
                                                                   [mp3 @ 0xb86ade60] Skipping 0 bytes of junk at 132692.
                                                                   [mjpeg @ 0xb86c9980] Changing bps to 8
                                                                   [mp3 @ 0xb86ade60] Estimating duration from bitrate, this may be inaccurate
                                                                   Input #1, mp3, from '/storage/emulated/0/Download/01 Kaari Kaari - Dobaara.mp3':
                                                                     Metadata:
                                                                       album           : Dobaara (SongsMp3.Co)
                                                                       artist          : Arko , Asees Kaur
                                                                       album_artist    : Arko & Asees Kaur
                                                                       composer        : Arko
                                                                       performer       : SongsMp3.Co
                                                                       copyright       : SongsMp3.Co
                                                                       disc            : 1/1
                                                                       encoded_by      : iTunes 12.6.0.100
                                                                       genre           : Bollywood
                                                                       TEXT            : SongsMp3.Co
                                                                       TPE4            : SongsMp3.Co
                                                                       TRSN            : SongsMp3.Co
                                                                       TOPE            : SongsMp3.Co
                                                                       TOLY            : SongsMp3.Co
                                                                       publisher       : SongsMp3.Co
                                                                       title           : Kaari Kaari (SongsMp3.Co)
                                                                       track           : 1/1
                                                                       date            : 2017
                                                                     Duration: 00:03:46.72, start: 0.000000, bitrate: 324 kb/s
                                                                       Stream #1:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s
                                                                       Stream #1:1: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 600x600 [SAR 96:96 DAR 1:1], 90k tbr, 90k tbn, 90k tbc
                                                                       Metadata:
                                                                         comment         : Cover (front)
                                                                   [NULL @ 0xb86cab70] Unable to find a suitable output format for ' -map 0:v:0 -map 1:a:0'
                                                                    -map 0:v:0 -map 1:a:0: Invalid argument
    05-26 18:39:35.543 29188-29188/com.example.codal.videotm D/ViewRootImpl: #3 mView = null
    05-26 18:39:35.543 29188-29188/com.example.codal.videotm D/finish: merge finish
  • RTP packets detected as UDP

    8 juillet 2024, par fritz

    Here 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 :

    



      

    1. why wireshark cannot detect the packets as RTP (I suspect it has something to do with SDP)
    2. 


    3. How to handle SDP answer when the RTP endpoint is pushing to ffmpeg which doesn't send an answer back.
    4. 


    



    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();
    });