We use some essential cookies to make our website work.

We use optional cookies, as detailed in our cookie policy, to remember your settings and understand how you use our website.

1 post • Page 1 of 1
dennis.bohn
Posts: 1
Joined: Sun Apr 26, 2020 8:48 pm

Transcode (h264/ac3 [http-livestream]) to (h264/aac [rtmp-server])

Sun Apr 26, 2020 9:34 pm

Hello,

I am using ffmpeg on my pc at the moment to transcode and send a http-livestream from my satellite-receiver to a private server.

Code: Select all

ffmpeg -i http://xxx.xxx.xxx.xxx:8001/1:0:19:1519:455:1:C00000:0:0:0: -vf "yadif=0 ,scale=1280:720" -vcodec libx264 -vprofile high -preset slower -crf 22 -maxrate 2M -bufsize 4M -g 25 -acodec aac -strict -2 -f flv rtmp://my.server/hls
It works very well so I was wondering, if it is also possible on my RaspberryPi 3.

I compiled ffmpeg with --enable-omx, --enable-omx-rpi and --enable-mmal for testing and as long as I didnt deinterlace and scale the video the transcoding worked very well.

Code: Select all

ffmpeg -c:v h264_mmal -i http://xxx.xxx.xxx.xxx:8001/1:0:19:1519:455:1:C00000:0:0:0: -vcodec h264_omx -b:v 2M -acodec aac -strict -2 -f flv rtmp://my.server/hls
But when I tried to deinterlace and scale the video, the framerate dropped to 5fps.

Code: Select all

ffmpeg -c:v h264_mmal -i http://xxx.xxx.xxx.xxx:8001/1:0:19:1519:455:1:C00000:0:0:0: -vf "yadif=0 ,scale=1280:720" -vcodec h264_omx -b:v 2M -acodec aac -strict -2 -f flv rtmp://my.server/hls
So I was wondering, if it would be possible with gstreamer. Unfortunately I had now success with gst-launch-1.0.

The following steps worked so far.

Save the http-livestream to a ts-file

Code: Select all

gst-launch-1.0 souphttpsrc location='http://xxx.xxx.xxx.xxx:8001/1:0:19:1519:455:1:C00000:0:0:0:' is-live=true ! filesink location=video.ts -e
Send a testvideo to my private server

Code: Select all

gst-launch-1.0 videotestsrc ! 'video/x-raw, format=(string)I420, width=(int)640, height=(int)480' ! omxh264enc ! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! flvmux streamable=true ! rtmpsink location=rtmp://my.server/hls
But I have no clue how to build a command line for the following steps.

1. STREAM: Read live-stream over http
2. STREAM: Demux live-stream
3. VIDEO: Decode Video [h264, 25fps]
4. VIDEO: Deinterlace Video
5. VIDEO: Resize Video [1280x720]
6. VIDEO: Encode Video [h264, 2Mbit/s]
7. AUDIO: Decode Audio [ac3]
8. AUDIO: Encode Audio [aac, 128Kbit/s]
9. STREAM: Mux [flv]
10. STEAM: Send to rtmp-server

My last try to get at least video to work was this one.

Code: Select all

gst-launch-1.0 -v souphttpsrc location='http://xxx.xxx.xxx.xxx:8001/1:0:19:1519:455:1:C00000:0:0:0:' is-live=true ! decodebin ! tsdemux ! h264parse ! omxh264dec ! videoconvert ! omxh264enc ! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! flvmux streamable=true ! rtmpsink location=rtmp://my.server/hls
But I get always the following warning
mpegtspacketizer mpegtspacketizer.c:2331:mpegts_packetizer_pts_to_ts: Not enough information to calculate proper timestamp
Is this even possible with gst-launch-1.0 on a RaspberryPi 3?

Best regards
Dennis

1 post • Page 1 of 1

Return to "OpenMAX"

AltStyle によって変換されたページ (->オリジナル) /