LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-27-2010, 07:41 AM   #1
kdelover
Member
 
Registered: Aug 2009
Posts: 311

Rep: Reputation: 36
converting the input captured through ffmpeg & webcam !


Hi,

I have captured the input from a webcam using ffmpeg and dumped it to a file.can i play that file straight away in mplayer or do i need to encode it something? Thanks

Code:
ffmpeg -b 100K -an -f video4linux2 -s 320x240 -r 10 -i /dev/video0 -b 100K -f image2pipe -vcodec mjpeg - > vids
Code:
file vids
vids: data
 
Old 11-27-2010, 11:17 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,335
Blog Entries: 55

Rep: Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535Reputation: 3535
If 'ffmpeg -i vids' or 'mediainfo vids' returns anything that even remotely looks like a video stream then (c)VLC, mplayer or Xine should be able to play it. I use ffmpeg mostly as converter and not to stream video.
 
Old 11-27-2010, 02:46 PM   #3
kdelover
Member
 
Registered: Aug 2009
Posts: 311

Original Poster
Rep: Reputation: 36
Hi,

Then what did ffmpeg dump to the file? I cant play it in mplayer or vlc.
 
Old 11-27-2010, 04:55 PM   #4
aus9
LQ Guru
 
Registered: Oct 2003
Distribution: Fedora 25 Gnome (Wayland)
Posts: 5,132

Rep: Reputation: Disabled
hi

there is dedicated software to capture your webcam images and sound.

eg cheese, camstream, luvcview

Look at your package manager and choose one based on what your device is....is it video4linux compliant? uvc compliant etc?
 
Old 11-27-2010, 10:40 PM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
I don't understand why you are creating a stream, if you want a video file.
ffmpeg -b 100k -an -f video4linux2 -s 320:240 -i /dev/video0 -vcodec mjpeg -r 10 -y test.avi

However, it may be better using another tool to create the video, or to control the camera to set a higher resolution, frame rate, or bit rate.
The -s option here will resize the original stream, not cause the camera to stream at that size. Part of your problem may also be that you didn't indicate a container format. For an mjpeg video stream, you can use .avi for example.
 
Old 11-28-2010, 08:16 AM   #6
kdelover
Member
 
Registered: Aug 2009
Posts: 311

Original Poster
Rep: Reputation: 36
thanks jschiwal. I am just wondering,if i create video stream and dump it to a file,do i need to convert it so thats its playable in mplayer or anyother media player?

Also,if i dump the video stream to a namedpipe,can mplayer/xine/vlc play it?
 
Old 11-30-2010, 01:37 AM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
You might want to look at the examples for ffserver. For playing feeds, vlc is probably the best. I used it at work to check on audio levels in a cable headend. The digital video were udp streams at the internal switch.

I think it would be better to use a pipe as an input for ffmpeg. Then transcode the video and save it as a file, instead of saving the stream dump and trying to work with that.
 
Old 12-01-2010, 04:53 AM   #8
kdelover
Member
 
Registered: Aug 2009
Posts: 311

Original Poster
Rep: Reputation: 36
Thanks,the problem is i do not know how do you transcode it.
 
  


Reply


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
How to view the Captured Image from webcam using C? boidi Linux - Software 1 09-22-2010 08:43 AM
How to view the Captured Image from webcam using C? boidi Linux - Software 6 09-22-2010 06:14 AM
[SOLVED] Aaargh! errors converting m4b to mp3 with ffmpeg & VLC irreverent Linux - Software 1 08-28-2010 11:44 PM
LXer: Converting video & audio files using ffmpeg in GNU/Linux LXer Syndicated Linux News 0 05-30-2009 04:31 AM
Problem whiile streaming the captured image from a webcam!! nitin.redhat Linux - General 0 10-06-2006 04:11 PM


All times are GMT -5. The time now is 03:43 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration