mirror of
https://github.com/flavioribeiro/donut.git
synced 2025-09-26 19:11:11 +08:00
bypass with annex b
This commit is contained in:
@@ -114,9 +114,9 @@ func (d *donutEngine) RecipeFor(server, client *entities.StreamInfo) (*entities.
|
||||
r := &entities.DonutRecipe{
|
||||
Input: appetizer,
|
||||
Video: entities.DonutMediaTask{
|
||||
// Action: entities.DonutBypass,
|
||||
Action: entities.DonutTranscode,
|
||||
Codec: entities.H264,
|
||||
Action: entities.DonutBypass,
|
||||
// Action: entities.DonutTranscode,
|
||||
Codec: entities.H264,
|
||||
},
|
||||
Audio: entities.DonutMediaTask{
|
||||
Action: entities.DonutTranscode,
|
||||
|
@@ -184,6 +184,7 @@ func (c *LibAVFFmpegStreamer) Stream(donut *entities.DonutParameters) {
|
||||
// }
|
||||
// }
|
||||
|
||||
// https://github.com/FFmpeg/FFmpeg/blob/9c6c4f3d476d7a8d423ec3b954254c6a67ebc792/libavformat/mux.c#L1351
|
||||
bistreamFilter := astiav.FindBitStreamFilterByName("h264_mp4toannexb")
|
||||
if bistreamFilter == nil {
|
||||
c.l.Info("cannot find bit stream filter")
|
||||
@@ -194,6 +195,13 @@ func (c *LibAVFFmpegStreamer) Stream(donut *entities.DonutParameters) {
|
||||
c.l.Info("error while AllocBitStreamContext", err)
|
||||
return
|
||||
}
|
||||
|
||||
bsfCtx.SetTimeBaseIn(s.inputStream.TimeBase())
|
||||
if err := s.inputStream.CodecParameters().Copy(bsfCtx.CodecParametersIn()); err != nil {
|
||||
c.l.Info("error copying codec parameter", err)
|
||||
return
|
||||
}
|
||||
|
||||
if err := bsfCtx.Init(); err != nil {
|
||||
c.l.Info("error while init", err)
|
||||
return
|
||||
|
@@ -6,7 +6,6 @@ do
|
||||
-f lavfi -i sine=frequency=1000:sample_rate=44100 \
|
||||
-c:v libx264 -preset veryfast -tune zerolatency -profile:v baseline \
|
||||
-vf "drawtext=text='RTMP streaming':box=1:boxborderw=10:x=(w-text_w)/2:y=(h-text_h)/2:fontsize=128:fontcolor=black" \
|
||||
-bsf:v h264_mp4toannexb \
|
||||
-b:v 1000k -bufsize 2000k -x264opts keyint=30:min-keyint=30:scenecut=-1 \
|
||||
-c:a aac -b:a 128k \
|
||||
-f flv -listen 1 -rtmp_live live "rtmp://${RTMP_HOST}:${RTMP_PORT}/live/app"
|
||||
|
Reference in New Issue
Block a user