Page 1 of 1

Saving incoming stream to a file

Posted: 28 Jun 2007 15:03
by tanir
Dear All, I already know how to save an incoming stream to a file but my problem is slightly different. When VLC saves an incoming stream to a file, the saved file usually has higher quality than the 'real-time' displayed version. I believe the reasoning behind this is that, the server side sends video packets even if their playout deadlines have passed. When these packets are received at the client, they can be used for improving the quality of the saved file, but not for the 'real-time' displayed version. So the version viewed at the client side while streaming has lower quality.

I want both versions to have the same quality. Is there a way that I can save incoming video exactly as it is actually displayed in real time? I need this for my scientific research.

Regards,
Tanir

Re: Saving incoming stream to a file

Posted: 09 Jul 2007 12:50
by dionoea
You can dump video frames to images using the image video output (just append "-V image" to your command line) and then compare the images. Or maybe just increase the cache size on the client's size to make sure that it never misses late packets.

Re: Saving incoming stream to a file

Posted: 10 Jul 2007 17:44
by yinglcs
Hi,
Can you please tell me how do you save a incoming stream to a file using just command line parameters?

Thank you.

Re: Saving incoming stream to a file

Posted: 10 Jul 2007 17:53
by dionoea

Code: Select all

vlc <input> --sout file/ts://somefile.ts

Re: Saving incoming stream to a file

Posted: 10 Jul 2007 21:09
by yinglcs
I am using these parameter for transcoding ,and it works (#1):

Code: Select all

#transcode{vcodec=mp4v,vb=400,acodec=mpga,ab=128}:rtp{dst=127.0.0.1,port-video=1234,port-audio=1235,sdp=a.sdp}
But when I change it to this, it does not work (#2):

Code: Select all

#transcode{vcodec=mp4v,vb=400,acodec=mpga,ab=128}:standard{access=rtp,dst=127.0.0.1,port-video=1234,port-audio=1235,sdp=a.sdp}
From my understanding, I need to do this to save and boardcast a stream:

Code: Select all

#transcode{vcodec=mp4v,vb=400,acodec=mpga,ab=128}:duplicate{dst={standard{access=file, name='1.mp4'}, dst={standard{access=rtp,dst=127.0.0.1,port-video=1234,port-audio=1235,sdp=a.sdp}}}
and that is why I want to above #2 to work.

Please correct me if I am wrong.
Thank you.

Re: Saving incoming stream to a file

Posted: 10 Jul 2007 22:58
by dionoea
#2 has been deprecated in favor of #1 which is why it doesn't work anymore. And you're allowed to use rtp{} in duplicate too :)

Re: Saving incoming stream to a file

Posted: 11 Jul 2007 00:46
by yinglcs
Thanks for your help.

I have change my transcode parameter to this, per your advice:

Code: Select all

#transcode{vcodec=mp4v,vb=400,acodec=mpga,ab=128}:duplicate{dst={standard{access=file, name=file:///tmp/1.mp4}} , dst={rtp{dst=63.23.35.161,port-video=1234,port-audio=1251,sdp=file:///tmp/1.sdp}} }
The boradcast work, i.e. the part dest={rtp{.....}} works.

But I don't see any file get generated in /tmp/1.mp4. Can you please tell me why this part does not work:

Code: Select all

:duplicate{dst={standard{access=file, name=file:///tmp/1.mp4}}
Thank you.

Re: Saving incoming stream to a file

Posted: 11 Jul 2007 01:03
by yinglcs
I think I fix my problem by doing this:

Code: Select all

dst={standard{access=file, mux=mp4, dst=1.mp4}

I have have 1 question which is
If I do this, does that mean vlc will transcode the stream for me once? or twice (one for broadcasting, one for saving it to a file)?

Code: Select all

'#transcode{vcodec=mp4v,vb=400,acodec=mpga,ab=128}:duplicate{dst={standard{access=file, mux=mp4 dest=1.mp4}, dst={standard{access=rtp,dst=127.0.0.1,port-video=1234,port-audio=1235,sdp=a.sdp}}}
Thank you for any pointers.

Re: Saving incoming stream to a file

Posted: 11 Jul 2007 11:34
by dionoea
It will transcode it only once.

Re: Saving incoming stream to a file

Posted: 12 Jul 2007 01:22
by yinglcs
Thanks again.

I am using this argument to transcode from flv to mp4:

#transcode{vcodec=mp4v,vb=400,acodec=mpga,ab=128,width=176,height=144}

My question is why my final mp4 file is bigger (almost double) then my original flv:
original flv: 12430891
final mp4: 22409186

During the transoformation, I scale the video down (to 176X144). So I expect the mp4 file is smaller than flv.

Can you please tell me why?

Thank you.

Re: Saving incoming stream to a file

Posted: 16 Jul 2007 11:41
by tanir
The picture size is not the only determining factor for video size in bytes. You will have to reduce the transcoding bitrate (audio/video) if you want to reduce the mp4 file size.

Re: Saving incoming stream to a file

Posted: 17 Jul 2007 16:20
by dionoea
What video and audio bitrate did the original FLV file use? (You can view those in the "Stream and Media Info" dialog in VLC)