[FFmpeg-trac] #2453(undetermined:new): Applying h264_mp4toannexb on RTSP stream produces: "Failed to open bitstream filter...: Invalid Argument"
FFmpeg
trac at avcodec.org
Tue Apr 9 19:15:20 CEST 2013
#2453: Applying h264_mp4toannexb on RTSP stream produces: "Failed to open
bitstream filter...: Invalid Argument"
-------------------------------------+-------------------------------------
Reporter: vihai | Type: defect
Status: new | Priority: normal
Component: | Version: git-
undetermined | master
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Hello,
I'm taking the RTSP stream from an AXIS camera and saving it to a MPEG
transport stream. The ultimate goal is to segment it in a HLS stream.
{{{
/home/vihai/ffmpeg/ffmpeg -rtsp_transport tcp -i "rtsp://195.72.223.6:555
/axis-media/media.amp?streamprofile=streaming_450&camera=1" \
-vcodec copy -acodec copy \
-bsf h264_mp4toannexb \
out.ts
}}}
Applying the h264_mp4toannexb bitstream filter directly is produces:
{{{
ffmpeg version N-51696-gb4eb06d Copyright (c) 2000-2013 the FFmpeg
developers
built on Apr 9 2013 17:52:58 with gcc 4.7 (Ubuntu/Linaro
4.7.2-2ubuntu1)
configuration: --enable-gpl --enable-libx264
libavutil 52. 25.100 / 52. 25.100
libavcodec 55. 2.100 / 55. 2.100
libavformat 55. 1.100 / 55. 1.100
libavdevice 55. 0.100 / 55. 0.100
libavfilter 3. 49.101 / 3. 49.101
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
Input #0, rtsp, from 'rtsp://195.72.223.6:555/axis-
media/media.amp?streamprofile=streaming_450&camera=1':
Metadata:
title : Media Presentation
Duration: N/A, start: 0.020375, bitrate: N/A
Stream #0:0: Video: h264 (Baseline), yuvj420p, 800x450 [SAR 1:1 DAR
16:9], 10 tbr, 90k tbn, 180k tbc
Stream #0:1: Audio: aac, 16000 Hz, mono, fltp
Output #0, mpegts, to 'a.ts':
Metadata:
title : Media Presentation
encoder : Lavf55.1.100
Stream #0:0: Video: h264, yuvj420p, 800x450 [SAR 1:1 DAR 16:9],
q=2-31, 90k tbn, 90k tbc
Stream #0:1: Audio: aac, 16000 Hz, mono
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
Failed to open bitstream filter h264_mp4toannexb for stream 0 with codec
copy: Invalid argument
Failed to open bitstream filter h264_mp4toannexb for stream 0 with codec
copy: Invalid argument
[adts @ 0x1d552e0] Encoder did not produce proper pts, making some up.
Failed to open bitstream filter h264_mp4toannexb for stream 0 with codec
copy: Invalid argument
Failed to open bitstream filter h264_mp4toannexb for stream 0 with codec
copy: Invalid argument
Failed to open bitstream filter h264_mp4toannexb for stream 0 with codec
copy: Invalid argument
Failed to open bitstream filter h264_mp4toannexb for stream 0 with codec
copy: Invalid argument
Failed to open bitstream filter h264_mp4toannexb for stream 0 with codec
copy: Invalid argument
}}}
If, however, I do take the stream, convert it to flv and pipe it again to
ffmpeg the error goes away:
{{{
ffmpeg -rtsp_transport tcp -i "rtsp://195.72.223.6:555/axis-
media/media.amp?streamprofile=streaming_720&camera=1" -re -vcodec copy
-acodec copy -f flv - |\
ffmpeg -i - -re \
-vcodec copy -acodec copy \
-vbsf h264_mp4toannexb \
out.ts
}}}
This makes me presume I'm not trying to do something impossible :)
The camera's IP address is real and temporarily open if you want to test
directly.
The issue seems somewhat to be related to RTSP. If I dump the stream in
mp4 and then convert it to ts with the bitstream filter it works.
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2453>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list