video.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sat, 10 Feb 2018 01:36:16 +0200
changeset 2229 1a0b6597e594
parent 2228 837f1337c59b
child 2230 9e6ad6607a9e
permissions -rw-r--r--
Mark block quot in HTMLe.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1308
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     1
.. -*- coding: utf-8; -*-
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     2
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
========
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
 Video.
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
========
1346
a2fbf50a43f4 Fix: Has no 'contents::' directive.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
     6
.. contents::
1905
fba288d59662 Include only local subsections into TOC. This prevent duplication of
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1772
diff changeset
     7
   :local:
1308
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     9
Players for linux?
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    10
==================
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
::
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    12
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    13
  $ sudo apt-get install vlc
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    14
  $ sudo apt-get install mplayer
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    15
2013
0feb538ef035 Make screenshot from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    16
Determine video format
0feb538ef035 Make screenshot from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    17
======================
1355
22bbad2a94db Determine video format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    18
::
22bbad2a94db Determine video format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    19
22bbad2a94db Determine video format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    20
  $ file $VIDEO
22bbad2a94db Determine video format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    21
  $ mplayer -frames 0 -vo null -ao null -identify $VIDEO
2017
6ffd71b07385 Determine video format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2015
diff changeset
    22
  $ ffprobe $VIDEO
1355
22bbad2a94db Determine video format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    23
  $ mediainfo $VIDEO
22bbad2a94db Determine video format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    24
22bbad2a94db Determine video format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    25
See:
22bbad2a94db Determine video format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    26
2228
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2020
diff changeset
    27
http://en.gentoo-wiki.com/wiki/Show_Video_Codecs
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2020
diff changeset
    28
  Show Video Codecs
1355
22bbad2a94db Determine video format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1346
diff changeset
    29
2013
0feb538ef035 Make screenshot from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    30
Make screenshot from video
0feb538ef035 Make screenshot from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    31
==========================
0feb538ef035 Make screenshot from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    32
0feb538ef035 Make screenshot from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    33
Seek to desired position with ``-ss`` option::
0feb538ef035 Make screenshot from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    34
0feb538ef035 Make screenshot from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    35
   $ ffmpeg -ss 600 -i $IN.avi -vframes 1 $OUT.png
0feb538ef035 Make screenshot from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    36
0feb538ef035 Make screenshot from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    37
You can apply filters, like resize::
0feb538ef035 Make screenshot from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    38
0feb538ef035 Make screenshot from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    39
   $ ffmpeg -ss 600 -i $IN.avi -vframes 1 -s 320x240 $OUT.png
0feb538ef035 Make screenshot from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    40
2015
bd2e3f9ac037 Extract frames from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2013
diff changeset
    41
Extract frames from video
bd2e3f9ac037 Extract frames from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2013
diff changeset
    42
=========================
bd2e3f9ac037 Extract frames from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2013
diff changeset
    43
bd2e3f9ac037 Extract frames from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2013
diff changeset
    44
Extract one frame per second::
bd2e3f9ac037 Extract frames from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2013
diff changeset
    45
bd2e3f9ac037 Extract frames from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2013
diff changeset
    46
  $ ffmpeg -i $IN.avi -vf fps=1 image-%03d.png
bd2e3f9ac037 Extract frames from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2013
diff changeset
    47
2018
813aa342d9ce Extract subtitles from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2017
diff changeset
    48
Extract subtitles from video
813aa342d9ce Extract subtitles from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2017
diff changeset
    49
============================
813aa342d9ce Extract subtitles from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2017
diff changeset
    50
813aa342d9ce Extract subtitles from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2017
diff changeset
    51
Find stream id with ``ffprobe $VIDEO`` and pass to::
813aa342d9ce Extract subtitles from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2017
diff changeset
    52
813aa342d9ce Extract subtitles from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2017
diff changeset
    53
  $ ffmpeg -y -i in.mkv -map 0:$ID -f webvtt out.vtt
813aa342d9ce Extract subtitles from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2017
diff changeset
    54
813aa342d9ce Extract subtitles from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2017
diff changeset
    55
List of supported by ``ffmpeg`` subtitle formats::
813aa342d9ce Extract subtitles from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2017
diff changeset
    56
813aa342d9ce Extract subtitles from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2017
diff changeset
    57
  $ ffmpeg -formats | grep subt
2015
bd2e3f9ac037 Extract frames from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2013
diff changeset
    58
2019
48ef940fd6b9 Integrating subtitles into video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2018
diff changeset
    59
Integrating subtitles into video
48ef940fd6b9 Integrating subtitles into video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2018
diff changeset
    60
================================
48ef940fd6b9 Integrating subtitles into video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2018
diff changeset
    61
::
48ef940fd6b9 Integrating subtitles into video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2018
diff changeset
    62
2020
065c06927ba9 Fix typo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2019
diff changeset
    63
  $ ffmpeg -i in.avi -vf subtitles=subtitle.srt out.avi
2019
48ef940fd6b9 Integrating subtitles into video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2018
diff changeset
    64
2228
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2020
diff changeset
    65
* https://trac.ffmpeg.org/wiki/HowToBurnSubtitlesIntoVideo
2019
48ef940fd6b9 Integrating subtitles into video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2018
diff changeset
    66
2013
0feb538ef035 Make screenshot from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    67
Playing 3d film
0feb538ef035 Make screenshot from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    68
===============
1309
0ea0a71c226d 3d film.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1308
diff changeset
    69
::
0ea0a71c226d 3d film.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1308
diff changeset
    70
0ea0a71c226d 3d film.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1308
diff changeset
    71
  $ mplayer -vf stereo3d=side_by_side_left_first:anaglyph_red_cyan_color -vo gl $VIDEO
0ea0a71c226d 3d film.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1308
diff changeset
    72
  $ mplayer -vf stereo3d=above_below_left_first:anaglyph_red_cyan_color -vo gl $VIDEO
0ea0a71c226d 3d film.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1308
diff changeset
    73
0ea0a71c226d 3d film.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1308
diff changeset
    74
See ``man 1 mplayer``.
0ea0a71c226d 3d film.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1308
diff changeset
    75
1308
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    76
Web camera.
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    77
===========
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    78
1499
b19fe371e90e Make screenshort from web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1498
diff changeset
    79
View picture from web camera on display screen::
1308
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    80
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    81
  $ mplayer tv://
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    82
  $ mplayer tv:// -tv driver=v4l2:width=640:height=480:fps=15:device=/dev/video0
1772
f2e72be1412b guvcview
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1545
diff changeset
    83
  $ guvcview
1308
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    84
  $ cheese
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    85
  $ camorama
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    86
2013
0feb538ef035 Make screenshot from video.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    87
Make screenshot from web camera::
1499
b19fe371e90e Make screenshort from web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1498
diff changeset
    88
b19fe371e90e Make screenshort from web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1498
diff changeset
    89
  $ ffmpeg -f video4linux2 -i /dev/v4l/by-id/CAMERA -vframes 1 test.jpeg
b19fe371e90e Make screenshort from web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1498
diff changeset
    90
  $ ffmpeg -f video4linux2 -i /dev/v4l/by-id/CAMERA -vframes 4 test%3d.jpeg
b19fe371e90e Make screenshort from web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1498
diff changeset
    91
b19fe371e90e Make screenshort from web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1498
diff changeset
    92
Record web camera to a file::
1498
094d7e74252a Recording web camera to file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1361
diff changeset
    93
094d7e74252a Recording web camera to file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1361
diff changeset
    94
  $ mencoder -fps 15 tv:// -ovc lavc -o my.avi
1772
f2e72be1412b guvcview
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1545
diff changeset
    95
  $ guvcview
1498
094d7e74252a Recording web camera to file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1361
diff changeset
    96
1308
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    97
See:
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    98
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    99
  http://wiki.debian.org/Webcam
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   100
                Debian wiki.
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   101
1359
9ea67efc1fac Extract audio from video file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1358
diff changeset
   102
Extract audio from video file.
9ea67efc1fac Extract audio from video file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1358
diff changeset
   103
==============================
1532
53d1eee0ee05 Extract audio from video file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1518
diff changeset
   104
53d1eee0ee05 Extract audio from video file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1518
diff changeset
   105
``$NO`` - autio strean number::
53d1eee0ee05 Extract audio from video file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1518
diff changeset
   106
1545
bce7c524f517 Fix typo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1532
diff changeset
   107
  $ ffmpeg -i $IN -c:a:$NO $OUT.mp3
1359
9ea67efc1fac Extract audio from video file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1358
diff changeset
   108
9ea67efc1fac Extract audio from video file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1358
diff changeset
   109
  $ mplayer -ao pcm:fast:file=audio.wav -vc null -vo null  input.avi
9ea67efc1fac Extract audio from video file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1358
diff changeset
   110
1360
380c5205ef4e Integrate audio to video file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1359
diff changeset
   111
Integrate audio to video file.
380c5205ef4e Integrate audio to video file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1359
diff changeset
   112
==============================
380c5205ef4e Integrate audio to video file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1359
diff changeset
   113
::
380c5205ef4e Integrate audio to video file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1359
diff changeset
   114
380c5205ef4e Integrate audio to video file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1359
diff changeset
   115
  $ mencoder \
380c5205ef4e Integrate audio to video file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1359
diff changeset
   116
    -ffourcc divx \
380c5205ef4e Integrate audio to video file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1359
diff changeset
   117
    -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=400 \
380c5205ef4e Integrate audio to video file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1359
diff changeset
   118
    -audiofile audio.wav \
380c5205ef4e Integrate audio to video file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1359
diff changeset
   119
    -oac mp3lame -lameopts vbr=3 \
380c5205ef4e Integrate audio to video file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1359
diff changeset
   120
    -o output.avi input.mkv
380c5205ef4e Integrate audio to video file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1359
diff changeset
   121
1358
7a93143dbf53 Synchronise video and audio streams.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1355
diff changeset
   122
Synchronise video and audio streams.
7a93143dbf53 Synchronise video and audio streams.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1355
diff changeset
   123
====================================
7a93143dbf53 Synchronise video and audio streams.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1355
diff changeset
   124
::
7a93143dbf53 Synchronise video and audio streams.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1355
diff changeset
   125
7a93143dbf53 Synchronise video and audio streams.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1355
diff changeset
   126
  $ mencoder -delay 0.7 -oac copy -ovc copy in.avi -o out.avi
7a93143dbf53 Synchronise video and audio streams.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1355
diff changeset
   127
  $ mencoder -mc 0 -of lavf -lavfopts format=mp4 -oac lavc -ovc lavc \
7a93143dbf53 Synchronise video and audio streams.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1355
diff changeset
   128
    -lavcopts aglobal=1:vglobal=1:acodec=libmp3lame:abitrate=128:vcodec=mpeg4:vbitrate=500:keyint=200
7a93143dbf53 Synchronise video and audio streams.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1355
diff changeset
   129
    -vf scale=-3:240,crop=320:240,harddup -af lavcresample=44100 -o out.mp4 in.mp4
7a93143dbf53 Synchronise video and audio streams.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1355
diff changeset
   130
1361
f62fc97ba770 Convert video for Nokia 5320.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1360
diff changeset
   131
Convert video for Nokia 5320.
f62fc97ba770 Convert video for Nokia 5320.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1360
diff changeset
   132
=============================
f62fc97ba770 Convert video for Nokia 5320.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1360
diff changeset
   133
::
f62fc97ba770 Convert video for Nokia 5320.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1360
diff changeset
   134
f62fc97ba770 Convert video for Nokia 5320.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1360
diff changeset
   135
  $ mencoder -mc 0 -of lavf -lavfopts format=mp4 \
f62fc97ba770 Convert video for Nokia 5320.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1360
diff changeset
   136
    -oac lavc -ovc lavc \
f62fc97ba770 Convert video for Nokia 5320.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1360
diff changeset
   137
    -lavcopts aglobal=1:vglobal=1:acodec=libmp3lame:abitrate=96:vcodec=mpeg4:vbitrate=400:keyint=100 \
f62fc97ba770 Convert video for Nokia 5320.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1360
diff changeset
   138
    -vf scale=-3:240,crop=320:240,harddup -af lavcresample=44100 -ofps 15 \
f62fc97ba770 Convert video for Nokia 5320.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1360
diff changeset
   139
    -o out.mp4 in.avi
1358
7a93143dbf53 Synchronise video and audio streams.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1355
diff changeset
   140
1308
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   141
How convert .3gp to .avi(mpeg)?
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   142
===============================
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   143
::
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   144
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   145
  $ sudo apt-get install ffmpeg
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   146
  $ ffmpeg -i test.3gp -f mpegvideo -ar 44100 -ac 1 -acodec mp3 test.mpg
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   147
  $ for i in `ls -1 *.3gp | cut -d. -f1`; do ffmpeg -y -i $i.3gp -sameq -f mpegvideo -s cif -r 25 -ar 32000 -ac 1 mpegs/$i.mpg; done
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   148
  $ ffmpeg -i video-in.3gp -b 250 -s 160×120 -r 15 -f avi -an video-out.avi
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   149
  $ mencoder -oac mp3lame -ovc lavc -o video-out.avi -vf pp,2xsai,scale video-in.3gp
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   150
  $ mencoder -o video-in.avi -vf pp,2xsai,scale -ovc lavc video-out.3gp
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   151
  $ mencoder -o video-in.avi -vf rotate=2 -oac pcm -ovc divx4 video-out.3gp
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   152
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   153
You need to compile FFmpeg with AMR support (--enable-amr_nb --enable-amr_wb).
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   154
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   155
AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   156
V5.1.0 from
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   157
http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   158
and extracted the source to libavcodec/amrwb_float
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   159
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   160
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   161
AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   162
REL-5 V5.1.0 from
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   163
http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   164
and extracted the source to libavcodec/amr_float
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   165
and if u try this on an alpha, u may need to change Word32 to int in
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   166
amr/typedef.h
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   167
1518
46c3367e73c8 Video editors.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1499
diff changeset
   168
Video editors.
46c3367e73c8 Video editors.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1499
diff changeset
   169
==============
46c3367e73c8 Video editors.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1499
diff changeset
   170
::
1308
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   171
1518
46c3367e73c8 Video editors.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1499
diff changeset
   172
  $ sudo apt-get install pitivi kino
1308
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   173
1518
46c3367e73c8 Video editors.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1499
diff changeset
   174
See:
1308
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   175
2228
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2020
diff changeset
   176
http://www.pitivi.org/
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2020
diff changeset
   177
  pitivi home page.
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2020
diff changeset
   178
http://www.kinodv.org/
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2020
diff changeset
   179
  Kino home page.
1308
879d342c6e37 Web camera.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   180