Recherche avancée

Médias (91)

Sur d’autres sites (1816)

  • Streaming raw h264 video from Raspberry PI to server for capture and viewing [closed]

    24 juin 2024, par tbullers

    This is really an optimization question - I have been able to stream h264 from a raspberry pi 5 to a linux system and capture the streams and save them to .mp4 files.

    


    But I intend to run the video capture and sending on a battery powered Pi Zero 2 W and want to use the least amount of power to maximize battery life and still providing good video quality.

    


    I've explored many different configuration settings but am getting lost in all the options.

    


    This is what I run on the pi :

    


    rpicam-vid -t 30s --framerate 30 --hdr --inline --listen -o tcp://0.0.0.0:5000


    


    I retrieve this video from the more powerful Ubuntu server with :

    


    ffmpeg -r 30 -i tcp://ralph:5000 -vcodec copy video_out103.mp4


    


    It generally works but I receive lots of errors on the server side like this :

    


    [mp4 @ 0x5f9aab5d0800] pts has no valuee= 975.4kbits/s speed=1.19x
Last message repeated 15 times
[mp4 @ 0x5f9aab5d0800] pts has no valuee=1035.3kbits/s speed=1.19x
Last message repeated 15 times
[mp4 @ 0x5f9aab5d0800] pts has no valuee=1014.8kbits/s speed=1.18x
Last message repeated 9 times
[mp4 @ 0x5f9aab5d0800] pts has no valuee=1001.1kbits/s speed=1.17x
Last message repeated 7 times
[mp4 @ 0x5f9aab5d0800] pts has no value
Last message repeated 1 times
[out#0/mp4 @ 0x5f9aab5ad5c0] video:3546kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead : 0.120360%
size= 3550kB time=00:00:27.50 bitrate=1057.5kbits/s speed=1.18x

    


    Any suggestions on how to correct these errors ?

    


    Also any suggestions on how to make the video capture side more efficient ? Should I use a different codec ? (yuv instead of h264 ?) Would using UDP decrease overhead ? Can I improve video quality with the mode or hdr options ? What does denoise do ?

    


    With all the options available with these tools I think it's unlikely that I have a well thought out approach to capture and streaming. I'm hoping that people who are more familiar with this space might be able to provide some suggestions.

    


    Thank you !

    


    -tom

    


  • ffmpeg - mpegts Multicast [closed]

    7 juin 2024, par Miguel Duarte

    I'm generating a multicast stream with this command :

    


    ffmpeg -hwaccel_device 1 -format_code Hi50 -re -f decklink -i 'DeckLink Duo (1)' -pix_fmt yuv420p -c:v h264_nvenc -profile:v high -b:v 3500k -rc 2 -cbr true -maxrate 3500k -bufsize 7000k -c:a mp2 -b:a 192k -f mpegts "udp://239.1.1.2:5000?ttl=2&pkt_size=1316"


    


    My problem is that if I open this stream on a device with a 100Mb/s connection, it's heavily pixelated. The same stream on a 1Gb/s device displays fine.

    


    I have other multicast streams from our ISP and they display fine regardless of connection speed.

    


    Has someone come across this issue ? This seems ffmpeg related.

    


    I tried several settings, bitrates, etc. Also playing on VLC, OBS. Same result.

    


    Version :

    


    ffmpeg version N-111519-gefa6cec759


    


    Thanks in advance.

    


  • Could not find ffmpeg executable, tried "/srv/linux-x64/ffmpeg"

    20 mai 2024, par Alan

    I am trying to run my docker image on AWS EC2 Instance. However, I am having a trouble with the image file. When I run a task in AWS ECS, it says :

    


    Could not find ffmpeg executable, tried "/srv/linux-x64/ffmpeg", "/srv/app/node_modules/@ffmpeg-installer/linux-x64/ffmpeg" and "/srv/app/node_modules/@ffmpeg-installer/linux-x64/ffmpeg"


    


    This is my Dockerfile :

    


    FROM node:latest as server
WORKDIR /srv/app
COPY ./server/package*.json ./
RUN apt-get update && apt-get install -y 'ffmpeg'
RUN npm install
COPY ./server .
RUN npm run build

FROM node:latest as client
WORKDIR /srv/app
COPY ./client/package*.json ./
RUN npm install
COPY ./client .
RUN npm run build

FROM node:latest as production
WORKDIR /srv/app
RUN mkdir /public
COPY --from=server /srv/app/dist ./
COPY --from=client /srv/app/dist ./public
ENV NODE_ENV=production
EXPOSE 5000
CMD ["node", "app.js"]


    


    This is my package.json :

    


      },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@ffmpeg-installer/ffmpeg": "^1.1.0",
    "@types/ffmpeg": "^1.0.7",
    "@types/fluent-ffmpeg": "^2.1.24"
  }


    


    This is how I used ffmpeg in my code :

    


    import ffmpegPath from '@ffmpeg-installer/ffmpeg';
import ffmpeg from 'fluent-ffmpeg';
ffmpeg.setFfmpegPath(ffmpegPath.path);


    


    Please help me fix this error.