Building a DVR box is a hefty project and on my to-do list, but currently I lack the time to tinker with that. Perhaps in a couple of months. For now I seek a short-term recording solution.
I found many different perspectives for recording TV over the air with mencoder. After some surfing and experimenting I decided on the following:
Code:
mencoder dvb://${1} -oac copy -ovc copy -endpos ${2} -o ${FILENAME} -cache 8192 -quiet
Where ${1} is the station as listed in channels.conf and ${2} is the recording period.
The file is AVI. The picture quality is great. Running
ffmpeg -i reveals the video format is MPEG2. I also have noticed that various stations transmit at different resolutions (1080p, 780p, 480p) and resolution varies from show to show.
So what is the problem?
Although picture quality is great, I cannot view the video at any point other than from the very beginning. Whenever I move the position slider, the slider immediately returns to the beginning of the video.
I have some AVIs using MPEG4 and they do not behave this way. I figured the slider problem was related to the MPEG2 format and I needed to convert the TV broadcast on-the-fly to MPEG4. I snipped the following from some web site:
Code:
OPT="vbitrate=2160000:mbd=2:keyint=132:v4mv:vqmin=3:lumi_mask=0.07:dark_mask=0.2:scplx_mask=0.1:tcplx_mask=0.1:naq"
mencoder dvb://${1} -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vpass=1:${OPT} -endpos ${2} -o ${FILENAME} -cache 8192 -quiet
I received the following error message:
The selected video_out device is incompatible with this codec.
Additionally, the picture quality deteriorates despite ffmpeg reporting the video is in MPEG4. Files sizes are much smaller too, which confirms the lower resolution.
Watching TV live with either Xine or Kaffeine works fine. Kaffeine provides a fairly nice interface to record TV and even provides an option to repeat the schedule. Not bad. Kaffeine saves the file in m2t format and I have no slider issues when watching such files. Yet my computer is primarily a workstation and not a multimedia center. Until I can build a dedicated box, I prefer to record from the command line and in the background. Less overhead and I can schedule with cron/at. Additionally, Kaffeine sometimes stalls and I prefer not to run Kaffeine to record.
Oddly, ffmpeg reports the m2t file uses MPEG2 for the video. Perhaps then the problem is not the MPEG2 format but something else.
I have a Hauppauge HVR-1250 TV capture card. Only digital TV drivers are available. No analog or infra red drivers yet exist.
Using mencoder seems to be a straightforward method for recording. I can live with the direct copy and not having slider control, but having high quality and slider control would be better.
How do I convert on-the-fly to MPEG4? Or do I have to convert after recording? Do I need to convert or is there another way to restore slider control?
Lastly, can I record TV with ffmpeg?
I'm using Slackware 12.2, mencoder 1.0rc2-4.2.3, ffmpeg 20081105.
Thanks.