[libav-tools] avconv with RTSP and h264_mp4toannexb

Eberhard, Holger Holger.Eberhard at ime-actia.de
Mon Jan 7 10:30:06 CET 2013


Hi all,
I try to get a live view of an IP camera  on an embedded platform.
For this purpose I want to use avconv to receive via RTSP.
Receiving the stream an write to a temp mp4- file works fine.
avconv -i rtsp://root:conf@10.31.0.13:554/axis-media/media.amp -an -f mp4 -vcodec copy -y  /var/tmp/iptest.mp4

But I want to extract h264 frames to feed a video decoder on the fly.
In avconv.c/write_frame() - I want to transfer h264 frames via shared memory to my decoder.

If I use the following command line, I get "h264_mp4toannexb failed for stream 0, codec copy: Invalid argument"
avconv -i rtsp://root:conf@10.31.0.13:554/axis-media/media.amp -an -vcodec copy -bsf h264_mp4toannexb -y -t 120 /var/tmp/iptest.h264 &

avconv version 0.8.3, Copyright (c) 2000-2012 the Libav developers
  built on Jan  4 2013 13:43:11 with gcc 4.3.3
PHY: 0:02 - Link is Up - 100/Full
Jan  4 16:55:26 192 user.info kernel: PHY: 0:02 - Link is Up - 100/Full
[rtsp @ 0xd74a80] Estimating duration from bitrate, this may be inaccurate
Input #0, rtsp, from 'rtsp://root:conf@10.31.0.13:554/axis-media/media.amp':
  Metadata:
    title           : Media Presentation
  Duration: N/A, start: 0.039989, bitrate: N/A
    Stream #0.0: Video: h264 (Baseline), yuvj420p, 800x600 [PAR 1:1 DAR 4:3], 25 tbr, 90k tbn, 180k tbc
Output #0, h264, to '/var/tmp/iptest.h264':
  Metadata:
    title           : Media Presentation
    encoder         : Lavf53.21.0
    Stream #0.0: Video: libx264, yuvj420p, 800x600 [PAR 1:1 DAR 4:3], q=2-31, 90k tbn, 90k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press ctrl-c to stop encoding
h264_mp4toannexb failed for stream 0, codec copy: Invalid argument

Here is my configuration
./configure --cross-prefix=${CROSS} --enable-cross-compile --target-os=linux --arch=arm --cpu=cortex-a8 --disable-doc --disable-debug --disable-avserver --disable-altivec --disable-sse
--disable-armv6 --disable-armv6t2 --disable-mmx --disable-mmx2 --disable-neon --disable-amd3dnow --enable-gpl --enable-version3 --extra-cflags=-I$(pwd)/x264/include --extra-ldflags=-L$(pwd)/x264/lib --enable-libx264


How can I apply a bitstream filter to get h264 frames ?

Best regards
Holger

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libav.org/pipermail/libav-tools/attachments/20130107/a6a5780a/attachment.html>


More information about the libav-tools mailing list