FFMPEG-Empfangsstream von Pipe über Netcat schlägt fehl

1920
David Rodd

Ich versuche, einen Stream über netcat zu empfangen und an FFMPEG weiterzuleiten und dann in eine Datei auszugeben. Ich erhalte jedoch eine Fehlermeldung.

Der grundlegendste Befehl, den ich ausprobierte, war:

$ nc -l -p 1935 | ffmpeg -v debug -y -f h264 -i pipe:0 out.mp4  ffmpeg version 3.1 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 4.8.2 (GCC) configuration: --prefix=/pkg/ffmpeg.org/3.1/ffmpeg --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include --enable-gpl --enable-libx264 --enable-shared --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libschroedinger --enable-libtheora --enable-libvorbis --enable-libx264 --enable-postproc --enable-runtime-cpudetect --enable-memalign-hack --enable-pthreads --disable-x11grab --enable-bzlib --enable-zlib --enable-static --enable-libmp3lame --enable-libx264 --enable-librtmp libavutil 55. 27.100 / 55. 27.100 libavcodec 57. 48.101 / 57. 48.101 libavformat 57. 40.101 / 57. 40.101 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 46.102 / 6. 46.102 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 1.100 / 2. 1.100 libpostproc 54. 0.100 / 54. 0.100 Splitting the commandline. Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'. Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'. Reading option '-f' ... matched as option 'f' (force format) with argument 'h264'. Reading option '-i' ... matched as input file with argument 'pipe:0'. Reading option 'out.mp4' ... matched as output file. Finished splitting the commandline. Parsing a group of options: global . Applying option v (set logging level) with argument debug. Applying option y (overwrite output files) with argument 1. Successfully parsed a group of options. Parsing a group of options: input file pipe:0. Applying option f (force format) with argument h264. Successfully parsed a group of options. Opening an input file: pipe:0. [pipe @ 0xe79c80] Setting default whitelist 'crypto' [h264 @ 0xe794c0] Before avformat_find_stream_info() pos: 0 bytes read:1537 seeks:0 nb_streams:1 [h264 @ 0xe82b00] sps_id 5 out of range [h264 @ 0xe82b00] missing picture in access unit with size 1537 [h264 @ 0xe82b00] Invalid NAL unit 0, skipping. [h264 @ 0xe82b00] no frame! [h264 @ 0xe794c0] decoding for stream 0 failed [h264 @ 0xe794c0] Could not find codec parameters for stream 0 (Video: h264, 1 reference frame, none(left)): unspecified size Consider increasing the value for the 'analyzeduration' and 'probesize' options [h264 @ 0xe794c0] After avformat_find_stream_info() pos: 1537 bytes read:1537 seeks:0 frames:1 Input #0, h264, from 'pipe:0': Duration: N/A, bitrate: N/A Stream #0:0, 1, 1/1200000: Video: h264, 1 reference frame, none(left), 25 tbr, 1200k tbn, 50 tbc Successfully opened the file. Parsing a group of options: output file out.mp4. Successfully parsed a group of options. Opening an output file: out.mp4. [file @ 0xe925c0] Setting default whitelist 'file,crypto' Successfully opened the file. detected 1 logical cores   [graph 0 input from stream 0:0 @ 0xe9ac60] Setting 'video_size' to value '0x0' [buffer @ 0xe9ad60] Unable to parse option value "0x0" as image size [graph 0 input from stream 0:0 @ 0xe9ac60] Setting 'pix_fmt' to value '-1' [buffer @ 0xe9ad60] Unable to parse option value "-1" as pixel format [graph 0 input from stream 0:0 @ 0xe9ac60] Setting 'time_base' to value '1/1200000' [graph 0 input from stream 0:0 @ 0xe9ac60] Setting 'pixel_aspect' to value '0/1' [graph 0 input from stream 0:0 @ 0xe9ac60] Setting 'sws_param' to value 'flags=2' [graph 0 input from stream 0:0 @ 0xe9ac60] Setting 'frame_rate' to value '50/2' [buffer @ 0xe9ad60] Unable to parse option value "0x0" as image size [buffer @ 0xe9ad60] Error setting option video_size to value 0x0. [graph 0 input from stream 0:0 @ 0xe9ac60] Error applying options to the filter. Error opening filters! [AVIOContext @ 0xe9a700] Statistics: 0 seeks, 0 writeouts [AVIOContext @ 0xe82000] Statistics: 1537 bytes read, 0 seeks 

Wegen der Consider increasing the value for the 'analyzeduration' and 'probesize' optionsNachricht habe ich dann versucht:

nc -l -p 1935 | ffmpeg -v debug -y -f h264 -analyzeduration 9M -probesize 9M -i pipe:0 out.mp4

Ich habe den gleichen Fehler erhalten, also habe ich angefangen, meine eigenen Codec-Parameter hinzuzufügen, da es den Anschein hat, als könne er nicht feststellen, um welche Art von Stream es sich handelt.

nc -l -p 1935 | ffmpeg -v debug -y -f h264 -c:a aac -pix_fmt yuv420p -s 1280x720 -framerate 30 -analyzeduration 9M -probesize 9M -i pipe:0 out.mp4

Aber jetzt bekomme ich:

Option video_size not found.

Irgendwelche Ideen?

1
Was ist mit größeren Zahlen für die Analyse / Messung? rogerdpack vor 7 Jahren 0

0 Antworten auf die Frage