GSTREAMER RECORDING VIDEO WITH AUDIO

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GSTREAMER RECORDING VIDEO WITH AUDIO

6,940 Views
shanmugamsundar
Contributor IV

hi all,

      i am using i.MX535qsb board, i am using camera interface application in that, i need to record the video with audio enabled, for that i am using the below gst command

COMMAND:

gst-launch mfw_v4lsrc fps-n=30 capture-width=1280 capture-height=720 capture-mode=4  ! queue ! mfw_vpuencoder codec-type=0 ! mux. alsasrc ! mfw_mp3encoder bitrate=64 ! queue  ! mux. avimux name=mux ! filesink location=shan3.avi sync=false

     In the above command the video is recording, but the audio is not coming, i want to change any parameters? can any one help me

NOTE:

I am using MOVIE player to open the recorded file in that it shows no audio.

But, if i use GNOME player to open the video the sound is coming, but the video runs very fast.

Thanks,

shan

Labels (3)
7 Replies

1,968 Views
LeonardoSandova
Specialist I

what if sync=true?

0 Kudos

1,968 Views
shanmugamsundar
Contributor IV

hi,

i used the following command the video with audio is coming but the video runs too fast there is no correct sync between the audio and video, in this command the num-buffers is used when i tried to increase the buffer size the audio is not coming, i don't know what's the problem can any one help me with some suggestions

can any one tell me what is num-buffers and what it will do ?

COMMAND:

gst-launch-0.10 mfw_v4lsrc fps-n=30 capture-width=640 capture-height=480 capture-mode=0 num-buffers=300 blocksize=115200 ! queue2 max-size-buffers=1000 max-size-bytes=0 max-size-time=0 ! mfw_vpuencoder codec-type=0 name=venc  alsasrc num-buffers=300 ! audio/x-raw-int,rate=32000,channels=1,depth=16 ! audioconvert ! queue2 max-size-buffers=1000 max-size-bytes=0 max-size-time=0 ! mfw_mp3encoder name=aenc avimux name=mux ! filesink location=all_in_one.avi aenc. ! mux. venc. ! mux.

Thanks ,

shan

0 Kudos

1,968 Views
LeonardoSandova
Specialist I

AFAIK (FabioEstevam let me know if I am wrong), the element which syncs audio and video is the muxer. Do not specify num-buffers and stop the pipeline with Control+C. As the name implies, num-buffers captures the number of buffers specified in the pipeline; hardcoding these values for recording it is not so trivial, I believe.

1,968 Views
shanmugamsundar
Contributor IV

hi leonardo,

         if i use sync=true there is no change in the video or audio same status

And if i am not mention the num-buffers in the command the video is recording normally but the audio is not coming. If i increased the buffer size same problem occurs

NOTE:

    If i remove the num-buffers the audio is not coming when i play the video in movie player the audio properties are not coming.

    If i use the num-buffers=300 same as in the command the video recording is get stopped when the buffer fills. how can i get the continuous video with audio in correct sync without using this

you can see my sample video in this link http://youtu.be/tthnFQ9H8aA

Thanks

shan

0 Kudos

1,968 Views
LeonardoSandova
Specialist I

I am not sure the root cause of your ploblem. Does audio (no video) recording work fine? can you try another muxer?

Leo

1,968 Views
shanmugamsundar
Contributor IV

hi leo,

Thanks for your help,

    Now,I am using matroskamux in that the video and audio is coming in correct sync at the beginning  but the sync is missing in the middle and the video getting struck in-between, do you have any idea?, i am recording the video through the LAN cable from board to pc

COMMAND:

gst-launch-0.10 mfw_v4lsrc capture-mode=4 capture-width=1280 capture-height=720 fps-n=30 num-buffers=2500 blocksize=115200 ! queue2 max-size-buffers=5000 max-size-bytes=0 max-size-time=0 ! ffmpegcolorspace ! mfw_vpuencoder codec-type=0 name=venc  alsasrc num-buffers=2500 ! audio/x-raw-int,rate=32000,channels=1,depth=16 ! audioconvert ! queue2 max-size-buffers=5000 max-size-bytes=0 max-size-time=0 ! mfw_mp3encoder name=aenc matroskamux name=mux ! filesink location=all1_in_one.avi aenc. ! mux. venc. ! mux.

NOTE:

For your reference  i had attached the sample video link http://youtu.be/SIA8MLTVke0

Thanks,

shan

0 Kudos

1,968 Views
shanmugamsundar
Contributor IV

hi leo,

     Now  it is ok when i stored the video in sd card.

     when i used to store the video in sd card there is no problem its perfect

     how can i store in server pc through LAN with a correct sync

Thanks

shan