Ip camera stream problem with insert logo
Hello I have raspberry pi and ffmpeg but I not can insert logo in coman line I have this error --> Streamcopy requested for output stream 0:0, which is fed from a complex filtergraph. Filtering and streamcopy cannot be used together. This is my comand line #!/bin/bash SERVICE="ffmpeg" RTSP_URL="rtsp://admin:password@ip:554/1/h264major" YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" YOUTUBE_KEY="XXXXXXXXXX" COMMAND="sudo ffmpeg -f lavfi -i anullsrc -thread_queue_size 2048 -re -r 30 use_wallclock_as_timestamps 1 -rtsp_transport tcp -i ${RTSP_URL} -i /home/pi/logo.png -filter_complex overlay -tune zerolatency -vcodec libx264 -t 12:00:00 -pix_fmt + -c:v copy -c:a aac -strict experimental -f flv ${YOUTUBE_URL}/${YOUTUBE_KEY}" if sudo /usr/bin/pgrep $SERVICE > /dev/null then echo "${SERVICE} is already running." else echo "${SERVICE} is NOT running! Starting now..." $COMMAND fi Please for Help Best Regards From Free1video.com LTD https://www.youtube.com/channel/UCTaWaFjf5ZBIHiEWHkos5cQ
On Sun, Jul 14, 2019 at 19:04:39 +0300, Free1video wrote:
line I have this error --> Streamcopy requested for output stream 0:0, which is fed from a complex filtergraph. Filtering and streamcopy cannot be used together.
That error message is pretty clear. You are trying to use "-c:v copy" while applying a filter. That can never work. Actually, you are providing the codec twice: "-vcodec libx264" and "-c:v copy". Probably, the latter is just a copy/paste error. I am convinced you will run into other issues with your command line. E.g. I believe you are not mapping your inputs correctly, and I think YouTube requires a stereo audio stream. But I'm just guessing. Please be sure to always provide the complete, uncut console output (minus your YouTube key) of your ffmpeg command when asking for assistence here.
COMMAND="sudo ffmpeg -f lavfi -i anullsrc -thread_queue_size 2048 -re -r 30 use_wallclock_as_timestamps 1 -rtsp_transport tcp -i ${RTSP_URL} -i /home/pi/logo.png -filter_complex overlay -tune zerolatency -vcodec libx264 -t 12:00:00 -pix_fmt + -c:v copy -c:a aac -strict experimental -f flv ${YOUTUBE_URL}/${YOUTUBE_KEY}"
BTW, there's usually nothing (at all!) which justifies running such a command with root priviledges. Cheers, Moritz
I believe you are not mapping your inputs correctly OK How is the correctly mapping ? I delete -vcodec libx264 only with -c:v copy I can stream with actual fps betwen 25fps and 30fps Tell me how I can set logo in my Live Stream and how I can set audio from my ip camera I have four option ACC ,PCM,G711-U,G711-A and G726 COMMAND="sudo ffmpeg -f lavfi -i anullsrc -thread_queue_size 2048 -re -r 25 -use_wallclock_as_timestamps 1 -rtsp_transport tcp -i ${RTSP_URL} -i logo.png -tune zerolatency -t 12:00:00 -pix_fmt yuv420p -acodec aac -ac 2 -ab 8k -ar 44100 -strict experimental -f flv ${YOUTUBE_URL}/${YOUTUBE_KEY}" This is my result in console ffmpeg version 3.2.14-1~deb9u1+rpt1 Copyright (c) 2000-2019 the FFmpeg developers configuration: --prefix=/usr --extra-version='1~deb9u1+rpt1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-omx-rpi --enable-mmal --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --arch=armhf --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared libavutil 55. 34.101 / 55. 34.101 libavcodec 57. 64.101 / 57. 64.101 libavformat 57. 56.101 / 57. 56.101 libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100 libavresample 3. 1. 0 / 3. 1. 0 libswscale 4. 2.100 / 4. 2.100 libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100 / 54. 1.100 Input #0, lavfi, from 'anullsrc': Duration: N/A, start: 0.000000, bitrate: 705 kb/s Stream #0:0: Audio: pcm_u8, 44100 Hz, stereo, u8, 705 kb/s [aac @ 0x86ca80] Multiple frames in a packet. [aac @ 0x86ca80] SBR was found before the first channel element. [aac @ 0x86ca80] Sample rate index in program config element does not match the sample rate index configured by the container. [aac @ 0x86ca80] Remapped id too large [aac @ 0x86ca80] is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. [aac @ 0x86ca80] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org) Input #1, rtsp, from 'rtsp://xxxxxxx:xxxxxxxx@ip:554/1/h264major': Metadata: title : 1/h264major comment : 1/h264major Duration: N/A, start: 1563126542.561500, bitrate: N/A Stream #1:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1920x1080, 25 fps, 21.83 tbr, 90k tbn, 50 tbc Stream #1:1: Audio: aac (LC), 8000 Hz, mono, fltp Input #2, png_pipe, from 'logo.png': Duration: N/A, bitrate: N/A Stream #2:0: Video: png, rgba(pc), 50x50 [SAR 3780:3780 DAR 1:1], 25 tbr, 25 tbn, 25 tbc Codec AVOption tune (Tune the encoding to a specific scenario) specified for output file #0 (rtmp://a.rtmp.youtube.com/live2/xxxxxxxxxxxxx) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream. [swscaler @ 0x8f0f10] deprecated pixel format used, make sure you did set range correctly Output #0, flv, to 'rtmp://a.rtmp.youtube.com/live2/xxxxxxxxxxxxxx': Metadata: encoder : Lavf57.56.101 Stream #0:0: Video: flv1 (flv) ([2][0][0][0] / 0x0002), yuv420p, 1920x1080, q=2-31, 200 kb/s, 25 fps, 1k tbn, 25 tbc Metadata: encoder : Lavc57.64.101 flv Side data: cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1 Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 44100 Hz, stereo, fltp, 8 kb/s Metadata: encoder : Lavc57.64.101 aac Stream mapping: Stream #1:0 -> #0:0 (h264 (native) -> flv1 (flv)) Stream #0:0 -> #0:1 (pcm_u8 (native) -> aac (native)) Press [q] to stop, [?] for help frame= 47 fps=2.2 q=31.0 Lsize= 954kB time=00:00:01.88 bitrate=4156.6kbits/s speed=0.0866x video:952kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.251420% [aac @ 0xa0cb90] Qavg: 63995.770 Exiting normally, received signal 2. I want to set logo and audio but not can write true comand line PLEASE HELP ME On Sun, Jul 14, 2019 at 7:52 PM Moritz Barsnick <barsnick@gmx.net> wrote:
On Sun, Jul 14, 2019 at 19:04:39 +0300, Free1video wrote:
line I have this error --> Streamcopy requested for output stream 0:0, which is fed from a complex filtergraph. Filtering and streamcopy cannot be used together.
That error message is pretty clear. You are trying to use "-c:v copy" while applying a filter. That can never work.
Actually, you are providing the codec twice: "-vcodec libx264" and "-c:v copy". Probably, the latter is just a copy/paste error.
I am convinced you will run into other issues with your command line. E.g. I believe you are not mapping your inputs correctly, and I think YouTube requires a stereo audio stream. But I'm just guessing. Please be sure to always provide the complete, uncut console output (minus your YouTube key) of your ffmpeg command when asking for assistence here.
COMMAND="sudo ffmpeg -f lavfi -i anullsrc -thread_queue_size 2048 -re -r 30 use_wallclock_as_timestamps 1 -rtsp_transport tcp -i ${RTSP_URL} -i /home/pi/logo.png -filter_complex overlay -tune zerolatency -vcodec libx264 -t 12:00:00 -pix_fmt + -c:v copy -c:a aac -strict experimental -f flv ${YOUTUBE_URL}/${YOUTUBE_KEY}"
BTW, there's usually nothing (at all!) which justifies running such a command with root priviledges.
Cheers, Moritz _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
On Sun, Jul 14, 2019 at 20:56:10 +0300, Free1video wrote:
I delete -vcodec libx264 only with -c:v copy I can stream with actual fps betwen 25fps and 30fps
No, I wrote:
That error message is pretty clear. You are trying to use "-c:v copy" while applying a filter. That can never work.
That means you need to keep libx264 and remove the copy. Furthermore:
ffmpeg version 3.2.14-1~deb9u1+rpt1 Copyright (c) 2000-2019 the FFmpeg
Your ffmpeg version is quite old, which is probably why the aac encoder is throwing those errors. Please try to get hold of a newer one. (I realize that may be tricky for ARM. You may need to build yourself.) Cheers, Moritz
participants (2)
-
Free1video -
Moritz Barsnick