LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   ffmpeg : mp4 conversion - no video in output file (https://www.linuxquestions.org/questions/linux-software-2/ffmpeg-mp4-conversion-no-video-in-output-file-4175600733/)

DBabo 02-27-2017 09:40 PM

ffmpeg : mp4 conversion - no video in output file
 
Hello,
i have a few files downloaded from youtube as mp4. They play just fine in vlc.
I'd like to convert them either into avi or mkv. And my naive attempts to leverage ffmpeg have failed.

in all attempts i get an audio track in a fil, but no video.
Please advise what am doing wrong.

Thank you
Code:

ffmpeg -i '2015%20Rhythmic%20Worlds,%20Stuttgart%20(GER)%20-%20Highlights%204,%20All-Around%20Final%20(group%20A).mp4'  out.aviffmpeg version 3.2.4 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.1 (GCC) 20161221 (Red Hat 6.3.1-1)
  configuration: --arch=x86_64 --bindir=/usr/bin --datadir=/usr/share/ffmpeg --disable-debug --disable-static --disable-stripping --enable-avfilter --enable-avresample --enable-bzlib --enable-cuda --enable-cuvid --enable-libnpp --enable-doc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gpl --enable-iconv --enable-libass --enable-libbluray --enable-libcdio --enable-libdc1394 --enable-libebur128 --enable-libfdk-aac --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libkvazaar --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libv4l2 --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxcb-shm --enable-libxcb-xfixes --enable-libxcb-shape --enable-libxvid --enable-libzvbi --enable-lzma --enable-nonfree --enable-openal --enable-opencl --enable-nvenc --enable-opengl --enable-postproc --enable-pthreads --enable-sdl2 --enable-shared --enable-version3 --enable-x11grab --enable-xlib --enable-zlib --extra-cflags='-I/usr/include/nvenc -I/usr/include/cuda' --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --prefix=/usr --shlibdir=/usr/lib64 --enable-runtime-cpudetect
  libavutil      55. 34.101 / 55. 34.101
  libavcodec    57. 64.101 / 57. 64.101
  libavformat    57. 56.101 / 57. 56.101
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter    6. 65.100 /  6. 65.100
  libavresample  3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample  2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2015%20Rhythmic%20Worlds,%20Stuttgart%20(GER)%20-%20Highlights%204,%20All-Around%20Final%20(group%20A).mp4':
  Metadata:
    major_brand    : isom
    minor_version  : 0
    compatible_brands: mp41avc1
    creation_time  : 2017-02-28T02:39:23.000000Z
    encoder        : vlc 3.0.0-git stream output
    encoder-eng    : vlc 3.0.0-git stream output
  Duration: 00:26:36.70, start: 0.000000, bitrate: 130 kb/s
    Stream #0:0(eng): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, s16p, 127 kb/s (default)
    Metadata:
      creation_time  : 2017-02-28T02:39:23.000000Z
      handler_name    : SoundHandler
Output #0, avi, to 'out.avi':
  Metadata:
    major_brand    : isom
    minor_version  : 0
    compatible_brands: mp41avc1
    ISFT            : Lavf57.56.101
    Stream #0:0(eng): Audio: mp3 (libmp3lame) (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p (default)
    Metadata:
      creation_time  : 2017-02-28T02:39:23.000000Z
      handler_name    : SoundHandler
      encoder        : Lavc57.64.101 libmp3lame
Stream mapping:
  Stream #0:0 -> #0:0 (mp3 (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
size=  26501kB time=00:26:36.69 bitrate= 136.0kbits/s speed=14.4x   
video:0kB audio:24936kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 6.275330%

to MKV:
Code:

[az@toshiba Desktop]$ ffmpeg -i '2015%20Rhythmic%20Worlds,%20Stuttgart%20(GER)%20-%20Highlights%204,%20All-Around%20Final%20(group%20A).mp4'  out.mkv
ffmpeg version 3.2.4 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.1 (GCC) 20161221 (Red Hat 6.3.1-1)
  configuration: --arch=x86_64 --bindir=/usr/bin --datadir=/usr/share/ffmpeg --disable-debug --disable-static --disable-stripping --enable-avfilter --enable-avresample --enable-bzlib --enable-cuda --enable-cuvid --enable-libnpp --enable-doc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gpl --enable-iconv --enable-libass --enable-libbluray --enable-libcdio --enable-libdc1394 --enable-libebur128 --enable-libfdk-aac --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libkvazaar --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libv4l2 --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxcb-shm --enable-libxcb-xfixes --enable-libxcb-shape --enable-libxvid --enable-libzvbi --enable-lzma --enable-nonfree --enable-openal --enable-opencl --enable-nvenc --enable-opengl --enable-postproc --enable-pthreads --enable-sdl2 --enable-shared --enable-version3 --enable-x11grab --enable-xlib --enable-zlib --extra-cflags='-I/usr/include/nvenc -I/usr/include/cuda' --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --prefix=/usr --shlibdir=/usr/lib64 --enable-runtime-cpudetect
  libavutil      55. 34.101 / 55. 34.101
  libavcodec    57. 64.101 / 57. 64.101
  libavformat    57. 56.101 / 57. 56.101
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter    6. 65.100 /  6. 65.100
  libavresample  3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample  2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2015%20Rhythmic%20Worlds,%20Stuttgart%20(GER)%20-%20Highlights%204,%20All-Around%20Final%20(group%20A).mp4':
  Metadata:
    major_brand    : isom
    minor_version  : 0
    compatible_brands: mp41avc1
    creation_time  : 2017-02-28T02:39:23.000000Z
    encoder        : vlc 3.0.0-git stream output
    encoder-eng    : vlc 3.0.0-git stream output
  Duration: 00:26:36.70, start: 0.000000, bitrate: 130 kb/s
    Stream #0:0(eng): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, s16p, 127 kb/s (default)
    Metadata:
      creation_time  : 2017-02-28T02:39:23.000000Z
      handler_name    : SoundHandler
Output #0, matroska, to 'out.mkv':
  Metadata:
    major_brand    : isom
    minor_version  : 0
    compatible_brands: mp41avc1
    encoder        : Lavf57.56.101
    Stream #0:0(eng): Audio: vorbis (libvorbis) (oV[0][0] / 0x566F), 48000 Hz, stereo, fltp (default)
    Metadata:
      creation_time  : 2017-02-28T02:39:23.000000Z
      handler_name    : SoundHandler
      encoder        : Lavc57.64.101 libvorbis
Stream mapping:
  Stream #0:0 -> #0:0 (mp3 (native) -> vorbis (libvorbis))
Press [q] to stop, [?] for help
size=  21911kB time=00:26:36.70 bitrate= 112.4kbits/s speed=17.7x   
video:0kB audio:21092kB subtitle:0kB other streams:0kB global headers:4kB muxing overhead: 3.884141%


DBabo 02-27-2017 10:05 PM

mmm....
It is difficult to convert something that doesn't exist to begin with...
Of course i can continue trying and one day I might even succeed...

Less excited action, but more pragmatic, is to get sources with video...

teckk 02-28-2017 03:06 PM

That file name is a mess. It has commas, parenthesis, % chars in it.
Start with a file_name.mp4 FileName.mp4 or similar.
Quote:

I'd like to convert them either into avi or mkv
If all that you want to do is change containers:
Code:

ffmpeg -i file.mp4 -c:a copy -c:v copy file.avi
Depending on what you start with that will probably be h264 video and aac audio.
If you want just the audio from it
Code:

ffmpeg -i file.mp4 -vn -c:a copy file.m4a
If you look, utube vids come in different formats. You can get just the
audio, or the video resolution and size that you want from the start.

From an example:
Code:

format code  extension  resolution note
249          webm      audio only DASH audio  66k , opus @ 50k, 1.32MiB
250          webm      audio only DASH audio  86k , opus @ 70k, 1.73MiB
140          m4a        audio only DASH audio  128k , m4a_dash container, mp4a.40.2@128k (44100Hz), 2.91MiB
171          webm      audio only DASH audio  131k , vorbis@128k, 2.95MiB
251          webm      audio only DASH audio  158k , opus @160k, 3.33MiB
278          webm      256x144    144p  103k , webm container, vp9, 30fps, video only, 2.10MiB
160          mp4        256x144    DASH video  112k , avc1.4d400c, 30fps, video only, 1.53MiB
242          webm      426x240    240p  237k , vp9, 30fps, video only, 3.71MiB
133          mp4        426x240    DASH video  247k , avc1.4d4015, 30fps, video only, 3.34MiB
134          mp4        640x360    DASH video  372k , avc1.4d401e, 30fps, video only, 5.02MiB
243          webm      640x360    360p  432k , vp9, 30fps, video only, 7.04MiB
135          mp4        854x480    DASH video  738k , avc1.4d401f, 30fps, video only, 10.47MiB
244          webm      854x480    480p  762k , vp9, 30fps, video only, 11.88MiB
136          mp4        1280x720  DASH video 1506k , avc1.4d401f, 30fps, video only, 22.58MiB
247          webm      1280x720  720p 1523k , vp9, 30fps, video only, 25.51MiB
248          webm      1920x1080  1080p 2766k , vp9, 30fps, video only, 53.58MiB
137          mp4        1920x1080  DASH video 3834k , avc1.640028, 30fps, video only, 67.39MiB
17          3gp        176x144    small , mp4v.20.3,  mp4a.40.2@ 24k
36          3gp        320x180    small , mp4v.20.3,  mp4a.40.2
43          webm      640x360    medium , vp8.0,  vorbis@128k
18          mp4        640x360    medium , avc1.42001E,  mp4a.40.2@ 96k
22          mp4        1280x720  hd720 , avc1.64001F,  mp4a.40.2@192k (best)



All times are GMT -5. The time now is 01:19 AM.