Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3869
  • Last Modified:

Need VLC help transcoding to .flv

I would like to capture a live video feed and transcode it to a .flv file using VLC. I am not sure if I have all the necessary libraries, or proper versions of VLC and ffmpeg. I need help to determine if I have what I need to, and what the proper syntax would be to properly transcode .flv with audio. I have included the script I use to transcode to mp1v, which is working fine. I have also encluded the results of ffmpeg -formats below it.

I am running the newest version of Linux Mint
VLC version 0.9.4
FFmpeg version r11872+debian_3:0.svn20080206-12ubuntu3.1


 vlc -vvv v4l:// :v4l-vdev= :v4l-adev= :v4l-norm=0 :v4l-frequency=0 :v4l-caching=300 :v4l-vdev="/dev/video0" :v4l-adev="/dev/dsp" :v4l-chroma="I420" :v4l-fps=-1 :v4l-samplerate=44100 :v4l-channel=1 :v4l-tuner=-1 :v4l-norm=1 :v4l-frequency=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=0 :v4l-height=0 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 :sout='#transcode{vcodec=mp1v,vb=512,scale=1,acodec=mpga,ab=64,channels=2}:duplicate{dst=display,dst=std{access=file,mux=mpeg1,dst=/home/raymond/cc090414.mpeg}}


FFmpeg version r11872+debian_3:0.svn20080206-12ubuntu3.1, Copyright (c) 2000-2008 Fabrice Bellard, et al.
  configuration: --enable-gpl --enable-pp --enable-swscaler --enable-x11grab --prefix=/usr --enable-libgsm --enable-libtheora --enable-libvorbis --enable-pthreads --disable-strip --enable-libfaad --enable-libfaadbin --enable-liba52 --enable-liba52bin --enable-libdc1394 --disable-armv5te --disable-armv6 --disable-altivec --disable-vis --enable-shared --disable-static
  libavutil version: 49.6.0
  libavcodec version: 51.50.0
  libavformat version: 52.7.0
  libavdevice version: 52.0.0
  built on Mar 13 2009 17:48:10, gcc: 4.3.2

0
tamray_tech
Asked:
tamray_tech
  • 9
  • 8
3 Solutions
 
ai_ja_naiCommented:
Have you just tested it, before coming here?
0
 
tamray_techAuthor Commented:
I have been trying to find this solution for months. The VLC web site is extremely stingy about helping people with this type of question. I have moved from one distro to another, hoping to find one that is better suited to my needs. This submitted info does work to capture and transcode to mpeg-1. In the end I want a box that will transcode to mp4, avi, wmv, mp3, and flv  . I am sure this can be done, just need to find the right expert.

0
 
ai_ja_naiCommented:
Then, use this method and put a mpeg1 -> flv converson tool in cascade and you are done. It's more.. Linux way :)
0
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
tamray_techAuthor Commented:
I have tried that in the past, and did it again last night. I get video, but no audio. If I convert to avi from an mpeg, it works fine.


0
 
ai_ja_naiCommented:
And if you convert mpeg1 to flv you lose audio, am I right? What program do you use? O_o
0
 
tamray_techAuthor Commented:
My goal is not to convert it, but when I need to, like now, I use ffmpeg.
0
 
ai_ja_naiCommented:
Anyway, the key string is

 :sout='#transcode{vcodec=mp1v,vb=512,scale=1,acodec=mpga,ab=64,channels=2}

you have to change vcodec and vb to change the video codec and acodec and ab to change the audio codec. If vcodec is missing, the video codec will stay the same (same for acodec). For example, to code mpeg-2 use

 :sout='#transcode{vcodec=mp2v,vb=4096,acodec=mp2a,ab=192,scale=1,channels=2,deinterlace,audio-sync}

You just have to find the right codec for you
0
 
ai_ja_naiCommented:
Anyway, VLC doesn't support flv properly, you are bound to choose ffmpeg as a postprocessing step

ffmpeg -i fileinput.wmv -ab AUDIOBITRATE -ar AUDIOSAMPLINGRATEHERE -b VIDEOBITRATE -r FRAMERATE -s WIDTHxHEIGHT fileoutput.flv
0
 
tamray_techAuthor Commented:
Yes, that is why I asked my question, because I have not been able to produce an .flv video with audio.

  Using vlc, transcoding to Mp1v with mga produces a poor quality  video from a live source for me.

 Ogg encapsulation, and transcoding  seem to produce a better quality video, but again, I have not been able to transcode to .flv..

 I don't have a problem using ffmpeg, but in order to consider an answer acceptable I would need a complete solution that would include capturing and transcoding live video, and successfully converting it to an .flv file that has audio.

0
 
ai_ja_naiCommented:
Vlc directly can't transcode properly in flv, that's the point.
You have to choose a pivot format and in a second time convert the pivot output in the final format.

>Using vlc, transcoding to Mp1v with mga produces a poor quality  video from a live source for me
probably you selected a low bitrate. First, try using mpeg2, since mpeg1 is old and deprecated.
Then, try selecting a better video bitrate by adjusting vb value to your needs. You should give it some tries before you find the one which is right for you
0
 
tamray_techAuthor Commented:
My comment indicates I understand that " I don't have a problem using ffmpeg, but in order to consider an answer acceptable I would need a complete solution that would include capturing and transcoding live video, and successfully converting it to an .flv file that has audio."

 I need a solution that describes what format to transcode the live stream,  along with the ffmpeg command that will convert it to.flv with audio. I have not been successful with any transcoding combination. The best I have been able to do is create an Mp1v, or ogv file (with audio), but have not been able to convert the file to .flv. I am looking for very specific instructions on how to accomplish this.
0
 
ai_ja_naiCommented:
I belive I've provided that ffmpeg command at http://www.experts-exchange.com/Programming/Multimedia_Programming/Video_Editing/Q_24338748.html?cid=1066#a24202633

and I provided the change you have to perform in your current vlc syntax to have a mpeg2 (that's better than mpeg1) at http://www.experts-exchange.com/Programming/Multimedia_Programming/Video_Editing/Q_24338748.html?cid=1066#a24202601

Just run vlc transconding with mpeg2 syntax, then converti it via ffmpeg with the command I provided, try it
0
 
tamray_techAuthor Commented:
I apologize, I was focused more on the fact that I did understand your comments:)

OK... I believe we are almost there. The resulting .flv file must not be using the proper audio codec. I get video, but no audio when played in vlc, although, I can see it did transcode audio when looking at the file size.

This is the error when attempting to play the resulting file in vlc:

No suitable decoder module:
VLC does not support the audio or video format "undf". Unfortunately there is no way for you to fix this.

I downloaded an flv file from the Internet, and VLC plays it just fine, which is why I think it must be the audio codec ffmpeg defaults to.

0
 
ai_ja_naiCommented:
But do you hear any sound in the mpeg2 output, before sending it to ffmpeg?
0
 
tamray_techAuthor Commented:
Yes
0
 
ai_ja_naiCommented:
You have to install lame mp3 codec and use '-acodec mp3' switch
0
 
tamray_techAuthor Commented:
The three accepted answers together gave me the desired result I was looking for.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 9
  • 8
Tackle projects and never again get stuck behind a technical roadblock.
Join Now