Difference between revisions of "Digital Video"

From Eugene Eric Kim
Eekim>Adsl-71-146-140-195.dsl.pltn13.sbcglobal.net
m (13 revisions imported: Imported from WebFaction on September 13, 2021 with Interwiki prefix Eekim)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
I'm starting to deal with DigitalVideo much more, what with video from my camera, MythTV, my DVD collection, and my Cowon D2. Here are my notes on codecs, conversions, and the like. {nid N2T}
I'm starting to deal with [[Digital Video]] much more, what with video from my camera, [[MythTV]], my DVD collection, and my Cowon D2. Here are my notes on codecs, conversions, and the like.


= Cowon D2 {nid N2U} =
== Concatenating Video ==


The D2 plays the following video format: {nid N2V}
In theory, ffmpeg concat mode should be the easiest way to do this, but it hasn't worked for me. I use the [https://trac.ffmpeg.org/wiki/How%20to%20concatenate%20(join,%20merge)%20media%20files demuxer]. Create a file mylist.txt:
# this is a comment
file '/path/to/file1'
file '/path/to/file2'
file '/path/to/file3'


{{{
Then run:
   AVI
ffmpeg -f concat -i mylist.txt -c copy output
   - XviD
 
For different codecs:
   ffmpeg -i video_a.mov -i video_b.mov -filter_complex '[0:v] [0:a:0] [1:v] [1:a:0] concat=n=2:v=1:a=1 [v] [a]' -map '[v]' -map '[a]' -strict -2 output.mp4
 
== Timelapse Cameras ==
 
* [[GoPro]]
* Canon with CHDK
* Laptop with [http://gphoto.sourceforge.net/proj/libgphoto2/support.php attached camera]
** [https://github.com/headrotor/camscript headrotor's scripts]
* [[Brinno]]
 
== [[Motorola Droid]] ==
 
You can [http://lifehacker.com/5635016/how-do-i-convert-video-for-my-android-phone use] Handbrake to encode videos for Droid playback. Use the iPhone preset, then click on Picture Settings and adjust the size to 848x480 (or as close to that as possible).
 
== Cowon D2 ==
 
The D2 plays the following video format:
 
<pre>  AVI
   - [[Xvi D]]
   - 320x240
   - 320x240
   - 30 fps
   - 30 fps
Line 13: Line 38:


   MP3
   MP3
   - 128 kbps {nid N2W}
   - 128 kbps</pre>
}}}
 


Windows Media Player does not have the [http://www.xvidmovies.com/codec/ XviD codec] by default, so you need to install it separately. {nid N2X}
Windows Media Player does not have the [http://www.xvidmovies.com/codec/ XviD codec] by default, so you need to install it separately.


ffmpeg settings: {nid N2Y}
ffmpeg settings:


[http://ubuntuforums.org/showpost.php?p=3989850&postcount=19 Example 1]: {nid N2Z}
[http://ubuntuforums.org/showpost.php?p=3989850&postcount=19 Example 1]:


{{{
<pre>ffmpeg -i INPUT -s 320x240 -vcodec mpeg4 -vtag XVID -b 500kb -mbd rd
ffmpeg -i INPUT -s 320x240 -vcodec mpeg4 -vtag XVID -b 500kb -mbd rd
       -flags +4mv+trell+aic -cmp 2 -subcmp 2 -g 300 -r 29.97 -acodec mp3
       -flags +4mv+trell+aic -cmp 2 -subcmp 2 -g 300 -r 29.97 -acodec mp3
       -ab 128 -ac 2 -async 1 OUTPUT.avi {nid N30}
       -ab 128 -ac 2 -async 1 OUTPUT.avi</pre>
}}}
 


[http://iaudiophile.net/forums/showpost.php?p=131712&postcount=2 Example 2]: {nid N31}
[http://iaudiophile.net/forums/showpost.php?p=131712&postcount=2 Example 2]:


{{{
<pre>ffmpeg -i INPUT -pass 1 -s 320x240 -vcodec mpeg4 -vtag XVID -b 500kb -mbd rd
ffmpeg -i INPUT -pass 1 -s 320x240 -vcodec mpeg4 -vtag XVID -b 500kb -mbd rd
       -flags +4mv+trell+aic -cmp 2 -subcmp 2 -g 300 -acodec copy null.avi
       -flags +4mv+trell+aic -cmp 2 -subcmp 2 -g 300 -acodec copy null.avi
       -threads 2
       -threads 2
Line 37: Line 60:
ffmpeg -i INPUT -pass 2 -s 320x240 -vcodec mpeg4 -vtag XVID -b 500kb -mbd rd
ffmpeg -i INPUT -pass 2 -s 320x240 -vcodec mpeg4 -vtag XVID -b 500kb -mbd rd
       -flags +4mv+trell+aic -cmp 2 -subcmp 2 -g 300 -acodec mp3 -ab 128
       -flags +4mv+trell+aic -cmp 2 -subcmp 2 -g 300 -acodec mp3 -ab 128
       -ac 2 -async 1 OUTPUT.avi -threads 2 {nid N32}
       -ac 2 -async 1 OUTPUT.avi -threads 2</pre>
}}}
 
 
(You can use 320x180 plus -padtop 30 and -padbottom 30 for 16:9 aspect ratio content. For mid-quality bitrates, use 350; for low-quality, use 250.)
 
=== Handbrake ===
 
I use a [http://handbrake.fr/ Handbrake] [http://iaudiophile.net/forums/archive/index.php/t-17525.html script] to rip movies directly to Cowon format. I'm considering playing with [http://forum.handbrake.fr/viewtopic.php?f=7&t=7095#p39935 other parameters].
 
=== VLC ===
 
You can use VLC to [http://lifehacker.com/397573/master-your-digital-media-with-vlc rip video].
 
== [[Panasonic Lumix DMC-ZS3]] ==
 
VLC plays AVCHD (.MTS files) just fine. To convert it to AVI, I [http://wesleybailey.com/articles/ffmpeg-tutorial-convert-avchd-mts-m2ts use ffmpeg]. First, I figure out the bitrate of the original file:
 
  ffmpeg -i file.mts
 
Then I convert using the bitrate information. It's important to do this; otherwise, the converted file will be pixelated:
 
  ffmpeg -i file.mts -b ''BBBBB''k file.avi
 
where ''BBBBB'' is the bitrate in kbits/sec.
 
== VHS to DVD ==


(You can use 320x180 plus -padtop 30 and -padbottom 30 for 16:9 aspect ratio content. For mid-quality bitrates, use 350; for low-quality, use 250.) {nid N33}
Considering [http://www.amazon.com/Toshiba-DVR670-DVR670KU-Recorder-Built/dp/B001TOD3KU/ref=cm_cr_pr_product_top Toshiba DVR670] or (less likely) the [http://www.amazon.com/Magnavox-ZV457MG9-Dual-Deck-Recorder/dp/B001QTW2BE/ref=cm_cr_pr_product_top Magnavox ZV457MG9] for Mom and Dad.


== Handbrake {nid N3I} ==
== See Also ==


I use a [http://handbrake.fr/ Handbrake] [http://iaudiophile.net/forums/archive/index.php/t-17525.html script] to rip movies directly to Cowon format. I'm considering playing with [http://forum.handbrake.fr/viewtopic.php?f=7&t=7095#p39935 other parameters]. {nid N3J}
* [http://www.videohelp.com/dvanalog Capture analog video using a digital camcorder]

Latest revision as of 19:32, 13 September 2021

I'm starting to deal with Digital Video much more, what with video from my camera, MythTV, my DVD collection, and my Cowon D2. Here are my notes on codecs, conversions, and the like.

Concatenating Video

In theory, ffmpeg concat mode should be the easiest way to do this, but it hasn't worked for me. I use the demuxer. Create a file mylist.txt:

# this is a comment
file '/path/to/file1'
file '/path/to/file2'
file '/path/to/file3'

Then run:

ffmpeg -f concat -i mylist.txt -c copy output

For different codecs:

 ffmpeg -i video_a.mov -i video_b.mov -filter_complex '[0:v] [0:a:0] [1:v] [1:a:0] concat=n=2:v=1:a=1 [v] [a]' -map '[v]' -map '[a]' -strict -2 output.mp4

Timelapse Cameras

Motorola Droid

You can use Handbrake to encode videos for Droid playback. Use the iPhone preset, then click on Picture Settings and adjust the size to 848x480 (or as close to that as possible).

Cowon D2

The D2 plays the following video format:

  AVI
  - [[Xvi D]]
  - 320x240
  - 30 fps
  - VBR 50

  MP3
  - 128 kbps


Windows Media Player does not have the XviD codec by default, so you need to install it separately.

ffmpeg settings:

Example 1:

ffmpeg -i INPUT -s 320x240 -vcodec mpeg4 -vtag XVID -b 500kb -mbd rd
       -flags +4mv+trell+aic -cmp 2 -subcmp 2 -g 300 -r 29.97 -acodec mp3
       -ab 128 -ac 2 -async 1 OUTPUT.avi


Example 2:

ffmpeg -i INPUT -pass 1 -s 320x240 -vcodec mpeg4 -vtag XVID -b 500kb -mbd rd
       -flags +4mv+trell+aic -cmp 2 -subcmp 2 -g 300 -acodec copy null.avi
       -threads 2

ffmpeg -i INPUT -pass 2 -s 320x240 -vcodec mpeg4 -vtag XVID -b 500kb -mbd rd
       -flags +4mv+trell+aic -cmp 2 -subcmp 2 -g 300 -acodec mp3 -ab 128
       -ac 2 -async 1 OUTPUT.avi -threads 2


(You can use 320x180 plus -padtop 30 and -padbottom 30 for 16:9 aspect ratio content. For mid-quality bitrates, use 350; for low-quality, use 250.)

Handbrake

I use a Handbrake script to rip movies directly to Cowon format. I'm considering playing with other parameters.

VLC

You can use VLC to rip video.

Panasonic Lumix DMC-ZS3

VLC plays AVCHD (.MTS files) just fine. To convert it to AVI, I use ffmpeg. First, I figure out the bitrate of the original file:

 ffmpeg -i file.mts

Then I convert using the bitrate information. It's important to do this; otherwise, the converted file will be pixelated:

 ffmpeg -i file.mts -b BBBBBk file.avi

where BBBBB is the bitrate in kbits/sec.

VHS to DVD

Considering Toshiba DVR670 or (less likely) the Magnavox ZV457MG9 for Mom and Dad.

See Also