LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   trying to convert from flv to mp3 (https://www.linuxquestions.org/questions/linux-general-1/trying-to-convert-from-flv-to-mp3-4175495873/)

mia_tech 02-22-2014 02:34 PM

trying to convert from flv to mp3
 
guys, I've downloaded a prebuild version of ffmpeg and I'm using it to convert flv to mp3; however, I'm getting errors
Code:

ffmpeg -vn -sn -i input.flv -acodec libmp3lame law4.mp3
ffmpeg version N-56794-g2e2a2d8 Copyright (c) 2000-2013 the FFmpeg developers
  built on Oct  1 2013 05:31:00 with gcc 4.6 (Debian 4.6.3-1)
  configuration: --prefix=/root/ffmpeg-static/32bit --arch=x86_32 --extra-cflags='-m32 -I/root/ffmpeg-static/32bit/include -static' --extra-ldflags='-m32 -L/root/ffmpeg-static/32bit/lib -static' --extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-ffserver --disable-doc --enable-bzlib --enable-zlib --enable-postproc --enable-runtime-cpudetect --enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-gray --enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 --enable-libvpx
  libavutil      52. 46.100 / 52. 46.100
  libavcodec    55. 33.101 / 55. 33.101
  libavformat    55. 18.104 / 55. 18.104
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter    3. 88.100 /  3. 88.100
  libswscale      2.  5.100 /  2.  5.100
  libswresample  0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '48 laws of power by Robert Greene Law 04.flv':
  Metadata:
    major_brand    : dash
    minor_version  : 0
    compatible_brands: iso6avc1mp41
    creation_time  : 2014-01-16 09:38:05
  Duration: 00:04:55.10, start: 0.000000, bitrate: 344 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 854x480, 341 kb/s, 29.97 tbr, 90k tbn, 59.94 tbc (default)
    Metadata:
      creation_time  : 2014-01-16 09:38:05
      handler_name    : VideoHandler
File 'law4.mp3' already exists. Overwrite ? [y/N] y
Output #0, mp3, to 'law4.mp3':
  Metadata:
    major_brand    : dash
    minor_version  : 0
    compatible_brands: iso6avc1mp41
Output file #0 does not contain any stream


paziulek 02-22-2014 02:55 PM

get mediainfo and check the integrity of the flv, and all codecs used.
it seems like the ffmpeg does not recognize any audio stream, it has been compiled without support for the specific codec used in the flv container.
are you able to play the flv via mplayer? if yes, paste the output of

Code:

mplayer  input.flv  -vo null -endpos 1
if the ffmpeg does not support the audio codec, either
1> get mencoder to demux the flv ( if mplayer works fine )
Code:

mencoder input.flv -of rawaudio -oac mp3lame -ovc copy -o audio.mp3
2> get avidemux via apt-get

3> recompile ffmpeg or mplayer/mencoder with the audio codec support

mia_tech 02-22-2014 05:47 PM

Quote:

Originally Posted by paziulek (Post 5122934)
get mediainfo and check the integrity of the flv, and all codecs used.
it seems like the ffmpeg does not recognize any audio stream, it has been compiled without support for the specific codec used in the flv container.
are you able to play the flv via mplayer? if yes, paste the output of

Code:

mplayer  input.flv  -vo null -endpos 1
if the ffmpeg does not support the audio codec, either
1> get mencoder to demux the flv ( if mplayer works fine )
Code:

mencoder input.flv -of rawaudio -oac mp3lame -ovc copy -o audio.mp3
2> get avidemux via apt-get

3> recompile ffmpeg or mplayer/mencoder with the audio codec support

apparently I don't have the codec for flv audio because mplayer is not playing the files, and like you said, it seems that ffmpeg it has been compiled without audio codec either.... how can I get the audio codec for ffmpeg and mplayer to play flv?

Code:

mplayer  "48 laws of power by Robert Greene Law 04.flv"  -vo null -endpos 1
MPlayer svn r34540 (Ubuntu), built with gcc-4.7 (C) 2000-2012 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing 48 laws of power by Robert Greene Law 04.flv.
libavformat version 53.21.1 (external)
Mismatching header version 53.19.0
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
VIDEO:  [H264]  854x480  24bpp  29.970 fps    0.0 kbps ( 0.0 kbyte/s)
Clip info:
 major_brand: dash
 minor_version: 0
 compatible_brands: iso6avc1mp41
 creation_time: 2014-01-16 09:38:05
Load subtitles in ./
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 53.35.0 (external)
Mismatching header version 53.32.2
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
Audio: no sound
Starting playback...
Unsupported PixelFormat 61
Unsupported PixelFormat 53
Unsupported PixelFormat 81
Movie-Aspect is undefined - no prescaling applied.
VO: [null] 854x480 => 854x480 Planar YV12
V: 295.1  0/  0 ??% ??% ??,?% 0 0


Exiting... (End of file)

thanks

mia_tech 02-22-2014 07:19 PM

according to my ffmpeg installation it supports Muxing and Demuxing for flv files

Code:

ffmpeg -formats | grep flv
ffmpeg version N-56794-g2e2a2d8 Copyright (c) 2000-2013 the FFmpeg developers
  built on Oct  1 2013 05:31:00 with gcc 4.6 (Debian 4.6.3-1)
  configuration: --prefix=/root/ffmpeg-static/32bit --arch=x86_32 --extra-cflags='-m32 -I/root/ffmpeg-static/32bit/include -static' --extra-ldflags='-m32 -L/root/ffmpeg-static/32bit/lib -static' --extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-ffserver --disable-doc --enable-bzlib --enable-zlib --enable-postproc --enable-runtime-cpudetect --enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-gray --enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 --enable-libvpx
  libavutil      52. 46.100 / 52. 46.100
  libavcodec    55. 33.101 / 55. 33.101
  libavformat    55. 18.104 / 55. 18.104
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter    3. 88.100 /  3. 88.100
  libswscale      2.  5.100 /  2.  5.100
  libswresample  0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
 DE flv            FLV (Flash Video)


paziulek 02-23-2014 01:05 AM

post the output of 'mediainfo' utility

and

get the mplayer source:
http://www.mplayerhq.hu/MPlayer/rele...apshot.tar.bz2

now, you might need to install 'git' ( if you do not have it already ) - it will pull ffmpeg source ( mplayer dependency )

once the snapshot extracted, enter the source directory and run:
# ./configure
# make clean
# make
# make install
the new mplayer will be installed in '/usr/local/bin/mplayer' so in order to ececute the new version you will need to enter the full path, or use uninstall mplayer via apt-get or aptitude...
also, there is a few of other codec packages, that do not come with mplayer:

faad - freeware Advanced Audio Decoder player
faad2-dbg - freeware Advanced Audio Decoder - debugging symbols
libfaad-dev - freeware Advanced Audio Decoder - development files
libfaad2 - freeware Advanced Audio Decoder - runtime files

libvorbis-dev - The Vorbis General Audio Compression Codec (development files)
libvorbis0a - The Vorbis General Audio Compression Codec (Decoder library)
libvorbisenc2 - The Vorbis General Audio Compression Codec (Encoder library)
libvorbisfile3 - The Vorbis General Audio Compression Codec (High Level API)

so if you still unable to use mplayer after recompiling, get these packages, re-run ./configure, and repeat all make steps...

being able to process a 'flv' container does not mean it will be able to play all the a/v content... you still need a player that has access to the codecs ( either internal via libavcodec or external ones used during the compilation process, or shared libraries )...
without knowing what type of codec is being used in the flv, it is sometimes not easy to guess... sometimes codecs used in a container are closed source/proprietary, mediainfo should be able to give you/us some idea...

andrew.46 03-05-2014 01:10 AM

Your file has no audio stream...


All times are GMT -5. The time now is 08:09 PM.