title: H264 ip camera via gstreamer
body: <p>I've got web camera (China) which can play MJPEG and h.264. I want to save the stream with gstreamer, but if I can do it with MJPEG, I can't do it with h264. I know, that camera gives h264 stream. Programms from developer shows it and if I save video with such programs I see that it is h264.<br></p>
  
  <pre><code>General
  Complete name : C:\RecordFiles\20140319\IPCAM1\20140319_232127_141.avi
  Format : AVI
  Format/Info : Audio Video Interleave
  File size : 4.11 MiB
  Duration : 7s 280ms
  Overall bit rate : 4 740 Kbps
  
  
  Video ID : 0
  Format : AVC
  Format/Info : Advanced Video Codec
  Format profile : Baseline@L3.1
  Format settings, CABAC : No
  Format settings, ReFrames : 1 frame
  Codec ID : h264
  Duration : 7s 280ms
  Bit rate : 4 733 Kbps
  Width : 1 280 pixels
  Height : 720 pixels
  Display aspect ratio : 16:9
  Frame rate : 25.000 fps
  Color space : YUV
  Chroma subsampling : 4:2:0
  Bit depth : 8 bits
  Scan type : Progressive
  Bits/(Pixel*Frame) : 0.205
  Stream size : 4.11 MiB (100%)
  
  
  Audio ID : 1
  Format : PCM
  Format settings, Endianness : Little
  Format settings, Sign : Signed
  Codec ID : 1
  Duration : 7s 280ms
  Bit rate mode : Constant
  Bit rate : 128 Kbps
  Channel count : 1 channel
  Sampling rate : 8 000 Hz
  Bit depth : 16 bits
  Stream size : 114 KiB (3%)
  Alignment : Aligned on interleaves
  </code></pre>
  
  <p>So I give all data, if somebody can help to tune gstreamer, I will be glad.<br>
  <strong>This works</strong><br></p>
  
  <pre><code>gst-launch souphttpsrc location="http://shonlinecam1.dyndns.org:81/videostream.cgi?loginuse=user&amp;loginpas=123" \
      ! jpegparse ! jpegdec \
      ! x264enc bitrate=512 key-int-max=45 speed-preset=superfast threads=1 \
      ! video/x-h264,stream-format=avc,alignment=au,profile=constrained-baseline \
      ! h264parse ! fakesink
  </code></pre>
  
  <p><strong>This doesn't work</strong><br></p>
  
  <pre><code>gst-launch souphttpsrc \
        is-live=true \
        location="http://shonlinecam1.dyndns.org:81/livestream.cgi?user=user&amp;pwd=123&amp;streamid=0" \
      ! h264parse ! decodebin2 ! fakesink
  </code></pre>
  
  <p>All links are real, please help.</p>