LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 08-29-2011, 07:00 PM   #1
alfredoyong
LQ Newbie
 
Registered: Aug 2011
Posts: 3

Rep: Reputation: Disabled
play video .wmv files while they are uploaded with rsync


hello,

I have a public server updated with rsync running each minute from a local server. The files copied are videos for our customers. These videos are constantly produced in .wmv format, some 400 each day. Our customers must be able to see them as soon as posible, they access them using a home-developed php web site that publish them.

The problem is, the video cant be viewed until finished the rsync. videos can be any size from 1 Mb to 150 Mb, with my internet access speed that can be anything from a few seconds to dozens of minutes.

While copying a file, rsync creates a temporary file with the real name of the file, but with a '.' prefix and a ramdomly generated suffix. So, from php I can know that a file is being uploaded, an actually start the play, but then rsync finish the transmission and mv the file to its correct name. To play the file I use this: <object id="MediaPlayer" width="320" height="320" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ...
<param name="FileName" value="myvideo.wmv">
<param name="AutoStart" value="true">

Is there a way to stream the file without interruption during its upload to the server, and even after finishing the upload, while it is moved (renamed)?

thanks in advance,
 
Old 08-29-2011, 07:19 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 326Reputation: 326Reputation: 326Reputation: 326
I haven't tried this for your particular type of application, but the '--inplace' option should copy directly to the destination file without the rename. Check 'man rsync' for the details on the option.
 
Old 08-29-2011, 08:21 PM   #3
alfredoyong
LQ Newbie
 
Registered: Aug 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks! I will try it, but this is in the rasyn man for the '--inplace' option:

WARNING: The file’s data will be in an inconsistent state during the transfer (and possibly afterward if the transfer gets interrupted), so you should not use this option to update files that are in use.

May be that warning is specific to certain type of files, and does not apply to videos? Besides, will the new parts of the file be played?

thanks again,
 
Old 08-29-2011, 08:28 PM   #4
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 326Reputation: 326Reputation: 326Reputation: 326
What the warning is telling you is that the file is being written to; the file is changing as you are reading. The inconsistent state in this case for your application is that while it appears to all be there (the length is correct) if you try to seek past the data that has been written, the application will get an error until the rsync completes.
 
  


Reply

Tags
rsync, streaming, wmv


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot play wmv video files with mplayer igadoter Slackware 10 02-06-2011 12:54 AM
can not play WMV video files Mistreated Linux - Software 10 12-22-2005 03:43 PM
video encoding from uploaded files dtra Linux - Software 5 04-14-2005 01:05 AM
"How to Play .wmv video files in Linux - FC2" manikantha Linux - Software 3 09-24-2004 04:24 PM
How can I play .wmv video in Linux? chinaundead Mandriva 10 03-01-2004 09:11 PM


All times are GMT -5. The time now is 11:57 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration