Is Pi-Cam MPEG-2 encoding in software?

Discussion about this major DATV Project. See https://wiki.batc.org.uk/The_Portsdown_Transmitter
Post Reply
KenW6HHC
Posts: 309
Joined: Mon Jun 01, 2009 4:20 pm

Is Pi-Cam MPEG-2 encoding in software?

Post by KenW6HHC » Tue Apr 04, 2017 3:04 pm

While reading up on the wiki material for Portsdown-with-DATV-Express user guide. I saw the following listing:
Capability
Using the touchscreen, the following capabilities can be controlled:
DVB-S H264 transmissions using the Pi Camera at Symbol Rates from 125 KS to 4 MS.
DVB-S MPEG-2 transmissions using the Pi Camera at Symbol Rates from 125 KS to 4 MS.
I know that the RPi3 H264 encoding for Pi-Cam is performed in RPi3 hardware.
Is the MPEG-2 encoding for Pi-Cam performed in software? Perhaps via FFMPEG inside the RpiDATV software??

It may be possible that Pi-Cam/MPEG-2 is a typo…and MPEG-2 can only can only be achieved with other cameras (aka EasyCAP, etc.)?

Just trying to get the Portsdown-DATV-Express MPEG-2 concepts correctly understood in my mind…before I start configuring set-up again.

Thank you for any guidance…de Ken W6HHC

G8GKQ
Site Admin
Posts: 2928
Joined: Sun Mar 22, 2009 1:21 pm

Re: Is Pi-Cam MPEG-2 encoding in software?

Post by G8GKQ » Tue Apr 04, 2017 4:42 pm

Hi Ken

Yes, the mpeg-2 encoding is done in software using ffmpeg. The command is in ~/rpidatv/scripts/a.sh here https://github.com/BritishAmateurTelevi ... ripts/a.sh and the full command is:

Code: Select all

 # ******************************* MPEG-2 VIDEO WITH AUDIO ************************************
      sudo nice -n -30 arecord -f S16_LE -r 44100 -c 1 -M -D hw:1\
        |sudo nice -n -30 $PATHRPI"/ffmpeg" -loglevel $MODE_DEBUG -itsoffset "$ITS_OFFSET"\
        -analyzeduration 0 -probesize 2048  -fpsprobesize 0 -ac 1 -thread_queue_size 512\
        -i -  -f v4l2 -framerate $VIDEO_FPS -video_size "$VIDEO_WIDTH"x"$VIDEO_HEIGHT"\
        -i /dev/video0 -fflags nobuffer -vcodec mpeg2video -s "$VIDEO_WIDTH"x"$VIDEO_HEIGHT"\
        -aspect 4:3 -b:v $BITRATE_VIDEO -minrate:v $BITRATE_VIDEO -maxrate:v  $BITRATE_VIDEO\
        -f mpegts  -blocksize 1880 -strict experimental  -acodec mp2 -ab 64K -ar 44100 -ac 1\
        -mpegts_original_network_id 1 -mpegts_transport_stream_id 1 -mpegts_service_id $SERVICEID\
        -mpegts_pmt_start_pid $PIDPMT -mpegts_start_pid $PIDVIDEO -metadata service_provider=$CALL\
        -metadata service_name=$CHANNEL -muxrate $BITRATE_TS -y $OUTPUT &
Currently it is only the PiCam that can be encoded in mpeg-2, but I am looking to see if the external analogue capture can be encoded that way as well. I had thought it was impossible, but I saw a few frames of a jerky picture yesterday, so I'll keep playing!

Currently PiCam mpeg-2 is the only mode that supports sound transmission as well. Something else that I'm working on.

73

Dave

KenW6HHC
Posts: 309
Joined: Mon Jun 01, 2009 4:20 pm

Re: Is Pi-Cam MPEG-2 encoding in software?

Post by KenW6HHC » Tue Apr 04, 2017 5:13 pm

Hi Dave G8GKQ,

Thank you for confirming the concepts for MPEG-2 encoding. That is terrific that the Pi-Cam can be also used with MPEG-2.

It looks like I will get back to working on Portsdown-Rpi3-DATV-express again on this Friday

73...de Ken W6HHC

Post Reply

Return to “The Portsdown Digital ATV System”