Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: timvideos/gst-switch
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ebbf7288036a
Choose a base ref
...
head repository: timvideos/gst-switch
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ea35e54030e9
Choose a head ref
  • 4 commits
  • 3 files changed
  • 1 contributor

Commits on Jan 8, 2015

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    895b11f View commit details
  2. Changing the recording file format.

     * Encode the video with lossless jpeg
     * Don't encode the audio
     * Output in streamable mkv format
    mithro committed Jan 8, 2015
    Copy the full SHA
    23a4fd9 View commit details
  3. Copy the full SHA
    7bb0b4b View commit details
  4. Merge pull request #97 from mithro/output-format-fix

    Changing output format to a streamable format.
    mithro committed Jan 8, 2015
    Copy the full SHA
    ea35e54 View commit details
Showing with 42 additions and 60 deletions.
  1. +3 −3 .gitignore
  2. +37 −55 tools/gstrecorder.c
  3. +2 −2 tools/gstswitchserver.c
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -65,8 +65,8 @@ imgurbash.sh.*
/timestamped*
/frames
/transition-strips
/record*.dat
*.data
*.log
/tools/gst-switch-ptz
test-driver
*.dat*
*.avi
*.mkv
92 changes: 37 additions & 55 deletions tools/gstrecorder.c
Original file line number Diff line number Diff line change
@@ -286,73 +286,55 @@ gst_recorder_get_pipeline_string (GstRecorder * rec)

desc = g_string_new ("");

g_string_append_printf (desc, "intervideosrc name=source_video "
"channel=composite_video ");
g_string_append_printf (desc, "interaudiosrc name=source_audio "
"channel=composite_audio ");

g_string_append_printf (desc,
"source_video. ! video/x-raw,width=%d,height=%d ",
rec->width, rec->height);
/*
ASSESS ("assess-record-video-source");
*/
g_string_append_printf (desc, "! queue2 ");
/*
ASSESS ("assess-record-video-encode-queued");
*/
g_string_append_printf (desc, "! vp8enc ");
/*
ASSESS ("assess-record-video-encoded");
*/
// Encode the video with lossless jpeg
g_string_append_printf (
desc,
"intervideosrc name=source_video channel=composite_video ");
g_string_append_printf (
desc,
"! video/x-raw,width=%d,height=%d ", rec->width, rec->height);
g_string_append_printf (desc, "! jpegenc quality=100 ");
g_string_append_printf (desc, "! mux. ");
g_string_append_printf (desc, "\n");

g_string_append_printf (desc, "source_audio. ");
/*
ASSESS ("assess-record-audio-source");
*/
g_string_append_printf (desc, "! queue2 ");
/*
ASSESS ("assess-record-audio-queued");
*/
g_string_append_printf (desc, "! voaacenc ");
/*
ASSESS ("assess-record-audio-encoded");
*/
// Don't encode the audio
g_string_append_printf (
desc,
"interaudiosrc name=source_audio channel=composite_audio ");
g_string_append_printf (desc, "! mux. ");

g_string_append_printf (desc, "avimux name=mux ");
/*
ASSESS ("assess-record-mux-result");
*/
g_string_append_printf (desc, "\n");

// Output in streamable mkv format
g_string_append_printf (
desc,
"matroskamux name=mux"
" streamable=true "
" writing-app='gst-switch' "
" min-index-interval=1000000 "
);
g_string_append_printf (desc, "! tee name=result ");
g_string_append_printf (desc, "\n");

if (filename) {
g_string_append_printf (desc, "filesink name=disk_sink sync=false "
"location=\"%s\" ", filename);
g_free ((gpointer) filename);
g_string_append_printf (desc, "result. ");
/*
ASSESS ("assess-record-file-to-queue");
*/
g_string_append_printf (desc, "! queue2 ");
/*
ASSESS ("assess-record-file-to-sink");
*/
g_string_append_printf (desc, "! disk_sink. ");
g_string_append_printf (
desc,
"! filesink name=disk_sink sync=false location=\"%s\" ", filename);
g_free ((gpointer) filename);
g_string_append_printf (desc, "\n");
}

g_string_append_printf (desc, "tcpserversink name=tcp_sink sync=false "
"port=%d ", rec->sink_port);
g_string_append_printf (desc, "result. ");
/*
ASSESS ("assess-record-tcp-to-queue");
*/
g_string_append_printf (desc, "! queue2 ");
/*
ASSESS ("assess-record-tcp-to-sink");
*/
g_string_append_printf (desc, "! gdppay ! tcp_sink. ");
g_string_append_printf (desc, "! gdppay ");
g_string_append_printf (
desc,
"! tcpserversink name=tcp_sink sync=false port=%d ",
rec->sink_port);

INFO("Recording pipeline\n----\n%s\n---", desc->str);

return desc;
}

4 changes: 2 additions & 2 deletions tools/gstswitchserver.c
Original file line number Diff line number Diff line change
@@ -52,8 +52,8 @@
#define GST_SWITCH_SERVER_LISTEN_BACKLOG 8 /* client connection queue */

#define GST_SWITCH_SERVER_HOST_SPEC "%q"
#define GST_SWITCH_SERVER_DEFAULT_RECORD_FILE GST_SWITCH_SERVER_HOST_SPEC "_record_%Y%m%d%T"
#define GST_SWITCH_SERVER_DEFAULT_RECORD_EXT ".avi"
#define GST_SWITCH_SERVER_DEFAULT_RECORD_FILE "recording-%q-%Y%m%d-%H%M%S"
#define GST_SWITCH_SERVER_DEFAULT_RECORD_EXT ".mkv"

#define GST_SWITCH_SERVER_LOCK_MAIN_LOOP(srv) (g_mutex_lock (&(srv)->main_loop_lock))
#define GST_SWITCH_SERVER_UNLOCK_MAIN_LOOP(srv) (g_mutex_unlock (&(srv)->main_loop_lock))