Hi,
In the Jetson AGX Xavier board, I have one 1080p mp4 file, that conains video as well as audio.
Now using gstreamer, I want to play the video with audio and I also want to downscale the video to 720p, mux with the audio and store it to new mp4 file.
I used the following pipeline.
gst-launch-1.0 filesrc location=stopwatch_1080p.mp4 ! qtdemux name=demux demux.video_0 ! queue ! h264parse ! nvv4l2decoder ! tee name=tee tee. ! queue ! nv3dsink demux.audio_0 ! queue ! aacparse ! faad ! audioconvert ! tee name=tee2 tee2. ! audioresample ! alsasink tee. ! nvvidconv ! ‘video/x-raw(memory:NVMM),width=1280,height=720’ ! nvv4l2h264enc profile=4 bitrate=1081000 ! ‘video/x-h264, stream-format=(string)byte-stream’ ! h264parse ! mux. tee2. ! ‘audio/x-raw,format=(string)S16LE,layout=(string)interleaved,rate=(int)48000’ ! voaacenc ! mux. qtmux name=mux ! filesink location=new.mp4
After launching the pipeline, screen comes with the video playing and immediately hangs.
So if someone give any suggestion on this, it will helpful.
Maybe the audio is not what you are expecting. Try:
gst-launch-1.0 -ev \
qtmux name=mux ! filesink location=new.mp4 \
filesrc location=stopwatch_1080p.mp4 ! qtdemux name=demux \
demux.video_0 ! queue ! h264parse ! nvv4l2decoder ! tee name=video \
video. ! queue ! nv3dsink \
video. ! queue ! nvvidconv ! 'video/x-raw(memory:NVMM),width=1280,height=720' ! nvv4l2h264enc profile=4 bitrate=1081000 ! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! queue ! mux.video_0 \
demux.audio_0 ! queue ! decodebin ! tee name=audio \
audio. ! queue ! audioresample ! alsasink \
audio. ! queue ! audioconvert ! 'audio/x-raw,format=(string)S16LE,layout=(string)interleaved,rate=(int)48000' ! voaacenc ! queue ! mux.audio_0
# Check with:
gst-play-1.0 new.mp4
Hi @Honey_Patouceul ,
Thank you for your quick response.
For the above pipeline also, I am facing same issue.
But here I observed 2 things.
-
Below pipeline for recording video without muxing the audio, works perfectly fine.
gst-launch-1.0 -ev
qtmux name=mux ! filesink location=new.mp4
filesrc location=stopwatch_1080p.mp4 ! qtdemux name=demux
demux.video_0 ! queue ! h264parse ! nvv4l2decoder ! tee name=video
video. ! queue ! nv3dsink
video. ! queue ! nvvidconv ! ‘video/x-raw(memory:NVMM),width=1280,height=720’ ! nvv4l2h264enc profile=4 bitrate=1081000 ! ‘video/x-h264, stream-format=(string)byte-stream’ ! h264parse ! queue ! mux.video_0 \
demux.audio_0 ! queue ! decodebin ! tee name=audio
audio. ! queue ! audioresample ! alsasink
-
Below pipeline for recording video with muxing audio as well, but without playing video, also works fine.
gst-launch-1.0 -ev
qtmux name=mux ! filesink location=new.mp4
filesrc location=stopwatch_1080p.mp4 ! qtdemux name=demux
demux.video_0 ! queue ! h264parse ! nvv4l2decoder ! tee name=video
video. ! queue ! nvvidconv ! ‘video/x-raw(memory:NVMM),width=1280,height=720’ ! nvv4l2h264enc profile=4 bitrate=1081000 ! ‘video/x-h264, stream-format=(string)byte-stream’ ! h264parse ! queue ! mux.video_0
demux.audio_0 ! queue ! decodebin ! tee name=audio
audio. ! queue ! audioconvert ! ‘audio/x-raw,format=(string)S16LE,layout=(string)interleaved,rate=(int)48000’ ! voaacenc ! queue ! mux.audio_0
(Though I don’t need tee elements here, I kept it for ease of comparison)
But at last, when I am trying to run all thing (playing video with audio + recoring video muxing audio) in one pipeline, video hangs immediately after opening.
Update:
I am able to run all things at a time now.
The correct pipeline is…
gst-launch-1.0 -ev
qtmux name=mux ! filesink location=new.mp4
filesrc location=stopwatch_1080p.mp4 ! qtdemux name=demux
demux.video_0 ! queue ! h264parse ! nvv4l2decoder ! tee name=video
video. ! queue ! nv3dsink
video. ! queue ! nvvidconv ! ‘video/x-raw(memory:NVMM),width=1280,height=720’ ! nvv4l2h264enc profile=4 bitrate=1081000 ! ‘video/x-h264, stream-format=(string)byte-stream’ ! h264parse ! queue ! mux.video_0
demux.audio_0 ! queue ! aacparse ! faad ! audioconvert ! tee name=audio
audio. ! queue ! audioresample ! alsasink
audio. ! queue ! ‘audio/x-raw,format=(string)S16LE,layout=(string)interleaved,rate=(int)48000’ ! voaacenc ! queue ! mux.audio_0
Thank you @Honey_Patouceul for your help.